Re: [Quickfix-developers] How to implement the QF/J failover sulotion.
Brought to you by:
orenmnero
|
From: Lin L. <le...@gm...> - 2005-10-31 01:56:26
|
Hi,Steve The solution which I implemented has not modify any code of QF/J excluding the JdbcStore code.So,when the active instance disconnected cause by network or other server errors,the client will create a new connection with TCP switch and connect to the another server instance IP address actually.And the relogining action is required.These don't base on the TCP level,but fix session level. The TCP level failover should be a better choice and also maybe cause more codes changing.Maybe it require a private protocol about server notification.If the first connection of active instance failed in errors,the TCP switch maybe return a fix reject or fail fix message to client(Maybe the client fix request is succed and the server fix reply fail in error,but the client don't know). And the client is connected to another server by TCP switch in TCP level(The connection of client and TCP switch does not disconnect so the client consider all are OK but only a reject or fail fix session message reply return.).The idle server instance copy(or read from db) all the active instance states and start up to service. Is above OK?We should make the TCP swich knowing fix protocol,I think,named FIX switch(Of couse,as now,I take some java codes as a TCP switch simulator). My first failover solution is not perfect but easy to be implemented.Making it working is the first step,I think:) Also,there are some problems in my first simple failover solution.When client failover from server1 to server2,it succeed.Next, client failover from server2 to server1,it cause error in server1 'Invalid state'(Is the client not clear session sate after disconneced?).And If I restart the client appliction,it get to work. I don't know why now. Lin Lejiang On 10/29/05, Steve Bate <st...@te...> wrote: > Hello Lin, > > I'd like to hear more about how you are implementing the > failover. Maybe we could add more direct support in the > code for it. > > Are you saying the reconnect to the idle instance would happen > at the TCP level (rather than a reconnect, relogon by the client)? > If so, your strategy for disabling the caching may work, but I'm > wondering about the other transient state in the session. For example, > information about whether a logon has been received for a specific > session instance. The failover Session instance may have problems > if some of this transient state data is not consistent with what > the client expects. This may cause problems with behaviors > like session logout since it expects to have seen a logon > at some point in the session history. > > Does your idle server receive an explicit notification when it > becomes active? If so, maybe the transient state could be > set up correctly at that time. > > Have you built a prototype of your failover solution? > > Regards, > > Steve > > > -----Original Message----- > > From: qui...@li... > > [mailto:qui...@li...] On > > Behalf Of Lin Lejiang > > Sent: Thursday, October 27, 2005 6:13 AM > > To: qui...@li... > > Subject: [Quickfix-developers] How to implement the QF/J > > failover sulotion. > > > > QuickFIX Documentation: > > http://www.quickfixengine.org/quickfix/doc/html/index.html > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > Hi, > > I try to deploy qf/j as fix engine in my project.I need > > double servers redundantly for failover.I have seen the topic > > about load balance and qf not support now. > > The two qf/j instances share the same store data(same jdbc > > data source).The client connected to one of them throgh a TCP > > switch,e.g.F5.And another instance is in idle state.The fix > > messages and SeqNum could have the right value when the > > client connection reconnect switching to the another qf/j > > instance.This is the process of qf/j failover in my project plan. > > The qf/j default JdbcStore/MysqlStore cache the session > > data in memory but not direct read from db.So the qf/j > > instances initialize the state and cache the state data from > > db after start up.The SeqNum of qf/j instance increase in > > service,but the another one cache the old SeqNum in memory > > because not in service. > > So,I implement my JdbcSybaseStore to remove the cache > > feature.And then the qf/j failover start to work OK.Of > > cause,I lost little perfomance in read/write db. > > I want to deploy this qf/j failover solution in my real > > project.Is it OK?Can someone have a better solution for failover? > > > > -- > > Lin Lejiang > > > > > > > > quote: > > Session management in load balanced situation? > > http://sourceforge.net/mailarchive/message.php?msg_id=3D11104323 > > On Tue, 8 Mar 2005 12:57:38 -0600, David Kuik > > <david.kuik@pr...> wrote: > > > > > I"m wondering how the engine manages sessions and message > > sequencing in a > load balanced environment. Does each > > server in the farm to manage a > separate session or do they > > somehow share a session? > > > > > > I"m trying to understand how this will work in a > > fault-tolerant 7x24 > environment that supports 1000"s of > > users. Can someone offer some comments? > > > > You could load balance sessions across multiple machines > > using a database-backed message store (e.g. > > MysqlStoreFactory). All of the session state is persisted > > to the database. You could run a number of Acceptors in > > parallel on different machines, each configured to accept > > all of your MySQL-backed sessions (e.g. same config file). > > > > However I don"t think there is currently a facility in QF > > for "locking" a session across multiple engines. In other > > words, if client A connects to server 1, that session should > > be "locked" in some way so any attempt to use it on servers > > 2 through n would result in an error in the same way that > > connecting to that session a second time on server 1 would. > > > > A similar approach would be to use the FileStoreFactory and > > share all the session state on an NFS mounted filesystem. > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by the JBoss Inc. > > Get Certified Today * Register for a JBoss Training Course > > Free Certification Exam for All Training Attendees Through > > End of 2005 Visit http://www.jboss.com/services/certification > > for more information _______________________________________________ > > Quickfix-developers mailing list > > Qui...@li... > > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > -- Lin Lejiang |