It appears that q has a replication option that is not reallydocumented at all. I’ve been trying to understand how it works andI’ve gotten it to work on the same host between 2 different processesbut not from another host. Is there any other documentation on thesubject? It seems you have to start the primary process with loggingturned on. The slave process then points to the first process’ port.Any write I issue on the first process (via the kdbc/jdbc port ONLY…command prompt writes are not propagated) is replicated to the second.It further seems that the second process may require access to the".log" file directly?? If i start the slave from a different directoryI get the error: '.log: No such file or directory.q -p 1777 -lq -p 2777 -r :localhost:1777
you’re running it without a database, try:q fff -p 7777 -las you’ve noticed it only logs client requests, so send in somethingto create some tablesq -r 7777will replicate from the task on 7777if you want to start from a different directory give the full pathwhen starting up the main sessionq /Users/simon/q/fff -p 7777 -lso clients can find the logfile2008/9/19 qBob <bob.pisani>:>> It appears that q has a replication option that is not really> documented at all. I’ve been trying to understand how it works and> I’ve gotten it to work on the same host between 2 different processes> but not from another host. Is there any other documentation on the> subject? It seems you have to start the primary process with logging> turned on. The slave process then points to the first process’ port.> Any write I issue on the first process (via the kdbc/jdbc port ONLY…> command prompt writes are not propagated) is replicated to the second.> It further seems that the second process may require access to the> “.log” file directly?? If i start the slave from a different directory> I get the error: '.log: No such file or directory.>> q -p 1777 -l> q -p 2777 -r :localhost:1777> >></bob.pisani>
When you say database, does that mean a database on disk or just a q script or a directory name etc.? I tried it as you described and it works when I run another q process on the same host. When I try it from another host it still errors out with “No such file or directory”. Does replication only work on the same host??? If so, does that mean the slave process is reading the log file directly to get the updates??
Thanks,
Bob
if you’re starting up withq fff -p 7777 -lthen there are potentially three files involvedfff.qdb which is the on-disk database, loaded on startupfff.log which is the log of all client changesandfff.q which is loaded if found at startupyou can compress the log (and rewrite fff.qdb) by entering\lat the q prompt, or perhaps running system"l" inside a timerany client replicating off this does need access to the file and thelog (these can be GB in size) but needn’t be on the same machine -they just need to be findable under the same fully qualified name forbothq -r :localhost:7777 -p 8888so the client/slave reads the log to replay it at startup, but thechanges thereafter come over tcpip2008/9/22 Bob Pisani <bob.pisani>:> When you say database, does that mean a database on disk or just a q script> or a directory name etc.? I tried it as you described and it works when I> run another q process on the same host. When I try it from another host it> still errors out with “No such file or directory”. Does replication only> work on the same host??? If so, does that mean the slave process is reading> the log file directly to get the updates??>> Thanks,> Bob>>> On Sat, Sep 20, 2008 at 3:09 AM, simon garland <simon.garland>> wrote:>>>> you’re running it without a database, try:>>>> q fff -p 7777 -l>>>> as you’ve noticed it only logs client requests, so send in something>> to create some tables>>>> q -r 7777>> will replicate from the task on 7777>> if you want to start from a different directory give the full path>> when starting up the main session>>>> q /Users/simon/q/fff -p 7777 -l>>>> so clients can find the logfile>>>> 2008/9/19 qBob <bob.pisani>:>> >>> > It appears that q has a replication option that is not really>> > documented at all. I’ve been trying to understand how it works and>> > I’ve gotten it to work on the same host between 2 different processes>> > but not from another host. Is there any other documentation on the>> > subject? It seems you have to start the primary process with logging>> > turned on. The slave process then points to the first process’ port.>> > Any write I issue on the first process (via the kdbc/jdbc port ONLY…>> > command prompt writes are not propagated) is replicated to the second.>> > It further seems that the second process may require access to the>> > “.log” file directly?? If i start the slave from a different directory>> > I get the error: '.log: No such file or directory.>> >>> > q -p 1777 -l>> > q -p 2777 -r :localhost:1777>> > >>> >>>>>>>> >></bob.pisani></simon.garland></bob.pisani>