Starting kdb+ tick setup

My current setup: Server_1: Linux 3.10 x86_64 Server_2: windows server 2008 Kdb+tick setup on Server_1 -StartTickerplant.sh: q tick.q sym log -p 5010 -startRDB.sh: q tick/r.q :5010 :5012 -p 5011 -startHDB.sh: q log/sym -p 5012 Steps to start tickerplant, rdb ,hdb: * From server_2 open 3 putty sessions to server_1. * Putty 1 : ./startTickerPlant.sh * Putty 2 : ./startRDB.sh * Putty 3 : ./startHDB.sh Everything is going well but if the putty session terminates(may be due to network connectivity issue or something else) the q process dies. Question: is the above approach correct? How do I run this properly? Thanks, Sumit

the “nohup” Linux command might help:

  $ nohup q tick.q…

check the docs - it helps make sure a process (here, q) doesn’t terminate when the shell exits.

Maybe need a “&” for every command, such as: ./startTickerPlant.sh&

? 2017?11?7??? UTC+8??5:53:15?21sumi…@gmail.com???

My current setup:
Server_1: Linux 3.10 x86_64
Server_2: windows server 2008

Kdb+tick setup on Server_1
-StartTickerplant.sh:
q tick.q sym log -p 5010

-startRDB.sh:
q tick/r.q :5010 :5012 -p 5011

-startHDB.sh:
q log/sym -p 5012

Steps to start tickerplant, rdb ,hdb:
* From server_2 open 3 putty sessions to server_1.
* Putty 1 : ./startTickerPlant.sh
* Putty 2 : ./startRDB.sh
* Putty 3 : ./startHDB.sh

Everything is going well but if the putty session terminates(may be due to network connectivity issue or something else) the q process dies.

Question: is the above approach correct?
How do I run this properly?

Thanks,
Sumit

Hi Sumit,

Typically speaking when I start a production process I use a combination of nohup (as mentioned below), redirect and & operators.

“nohup” (no hang up) gives a processes the potential to stay alive and running after the parent session/terminal has terminated or disconnected.

A useful link to these commands is given below which explains the individual parts better than I can.

https://stackoverflow.com/questions/10408816/how-do-i-use-the-nohup-command-without-getting-nohup-out

Typically, I also direct the standard error and standard out to a seperate file as well, so that any logging information is also available.

A typical start line would look something like:

nohup q  myscript.q -p 1234 </dev/null >mylog.txt 2>&1 &

Im far from an expert here, and really only copying the work from some of the frameworks available online at github (google kdb+ framework) but one tip I can share is that if a q session started with the syntax above isnt given a port to listen on the session, it will terminate. [“It has no reason to live”]

Michael

Thanks for the reply.
Sumit