Archived

This forum has been archived. Please start a new discussion on GitHub.

Master/Slave or Active/Passive architecture

Hi Team,

We are using IceGrid 3.4.2 in our projects. Till now we used it for services in Active/Active mode - it works brilliant (thank you guys a lot for IceGrid).

But now we require Master/Slave or Active/Passive mode. Is it possible to get it using IceGrid? Can't find it in documentation.

May be via Well-Known objects? As I can see IceAdmin will throw IceObjectExistsException if object already exists in Well-Known objects list. But what will be if some time ago master goes down? Does IceAdmin automatically remove object from the Well-Known objects list?

Many thanks for the help,
Emin

Comments

  • benoit
    benoit Rennes, France
    Hi Emin,

    I'm not sure I understand your question.

    Well-known proxies added using the IceGrid::Admin interface are stored in the IceGrid registry database. IceGrid doesn't monitor the state of the servers which hosts those well-known objects. If the well-known proxy points to multiple servers, IceGrid will always return all the endpoints regardless of the status of the servers.

    If however you manage your servers using the IceGrid deployment mechanism (with the IceGrid XML descriptors for example), the IceGrid nodes monitor the status of your servers and the IceGrid registry will be able to exclude endpoints for servers which are down when a client resolves a well-known proxy (assuming things are setup correctly).

    You can try this with the IceGrid replication demo provided with your Ice demo distribution.

    Cheers,
    Benoit.
  • Hi Benoit,

    Thanks for the reply. Ok, it means that we can't implement master/slave via Well-Known Objects. Is it possible to do it somehow else?

    In detail what is required:
    - Server1 and Server2 are started by IceGrid
    - Each of them trys to become Master but only one can do it. Server1 registers itself in Well-Known Objects list as soon as Server1 decided that he is master
    - The second Server2 sees that he is not a master and periodically tries to become master. As soon as Server1 goes down Server2 becomes a master and registers itself in Well-Known Objects.

    I know that we can use 3rd party libs and framework to implement it but may be IceGrid supports it already.

    Thanks for the help,
    Emin
  • benoit
    benoit Rennes, France
    Hi,

    You should be able to do what you describe if your servers take care of updating the well-known proxy with the IceGrid::Admin interface when they start.

    Cheers,
    Benoit.
  • benoit wrote: »

    You should be able to do what you describe if your servers take care of updating the well-known proxy with the IceGrid::Admin interface when they start.

    I'm sorry for bothering you. Agree that it will work if we require to avoid usage by clients server1 and server2 at the same time. But if, for example, master server should do some work in background that should be executed by one server only then it will not work :(

    What can help:
    - Have addIfAbsent in Ice::Admin
    - or IceGrid starts second server only if it can't start first server after N retries

    Thanks,
    Emin