cancel
Showing results for 
Search instead for 
Did you mean: 

startup script in .bashrc to start 8 separate q processes to use in

simon_watson_sj
New Contributor III
I'm trying to start up kdb with multiple processes to use to write scripts with KDB developer.
I understand that the processes that are set up need to be done so outside of the master process.

I have attempted to do this with a function in my .bashrc that creates 7 instances which are expecting a maximum of 8 processes. I then start up a final process with developer.
When I do this and try to connect, my OS informs developer that the connections are refused. 
Could you advise on the correct way to start 8 processes to use with IPC in KDB?
This is my multiple process startup function in .bashrc:

mq() {
echo "Spawning 7 q processes";
q -s -8 -p 20001;
q -s -8 -p 20002;
q -s -8 -p 20003;
q -s -8 -p 20004;
q -s -8 -p 20005;
q -s -8 -p 20006;
q -s -8 -p 20007;
}

This is the code in .bashrc to start developer:

# Assumes user name is claude and opens Q with 8 threads. (to build separate processes use a negative number) 
alias q='rlwrap -r q -s -8'
# Developer set to open with 8 threads. (to build separate processes use a negative number)
alias developer='source /pathToDir/developer/config/config.profile; rlwrap -r q /pathToDir/developer/launcher.q_'

To start all this up, I open one terminal and type ```mq``` then open another terminal and type 
developer
Once in developer, I assign a handle to each process like this:
{system "q -p ",string[x]," -q &"} each 20001+til 7;
Then the system tells me that the connection is refused.

How should I do this?

Thanks and regards,
Simon
0 REPLIES 0