Archived

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

Icegrid bothering me

The last time I made a affixed to seek your help, but did not express clearly because of my deficiency in english. i'm now working over an item about chat system. in the creation of a cluster system, I encountered a problem .This issue can be illustrated using Glacier2 chat demo as you provided.I want to join the cluster system to achieve multiple servers simultaneously run in the round-robin way. Now, I joined two functional modules, icegrid and icebox in order to achieve the results I want. The actual outcome of this operation is as follows:
When only one example of a server-side is activiated, there is no problem; but when I started several server-side examples on one computer, clients will return a mistake “the object does not exist” .According to the tips you provided before, I have already worked on this problem for two weeks but can not solve it yet.:( :( Now I have to post my codes, hoping that you could give me further hints.

In the codes I post, in addition to some basic configuration files I provided, the rest is the Demo program you’ve provided.I hope that the issue will not waste too much of your time.

Thank you very much.

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Try changing:
    Glacier2::SessionPrx::uncheckedCast(current.adapter->addWithUUID(new ChatSessionI(userId)));
    

    With:
    Ice::ObjectPrx obj  = current.adapter->addWithUUID(new ChatSessionI(userId));
    Glacier2::SessionPrx::uncheckedCast(current.adapter->createIndirectProxy(obj->ice_getIdentity()));
    

    By default the object adapter addWithUUID() method returns an indirect proxy with the replica group ID. That's not what you want since the session object isn't replicated. The proxy created with the createIndirectProxy() method is an indirect proxy with the adapter ID of the server instead. Please see the Ice manual for more information.

    If you're still getting the Ice::ObjectNotExistException after this change, you should provide us the information requested in the previous posts (the output of the client run with --Ice.Trace.Network=2 and the output of Glacier2 run with --Glacier2.Client.Trace.Reject).

    Also, it's not exactly clear to me what you're trying to do. You should note that deploying multiple instances of the chat server using IceGrid replica groups won't automatically ensure that the chat server data is replicated. Each server will have its own data (chat rooms, sessions) unless you explicitly replicate the data between the different server instances.

    Cheers,
    Benoit.
  • Thank you very much!
    It works now,but I find all servers does not work in the round-robin way.all clients which is started connect to the same server.why?
    Also, it's not exactly clear to me what you're trying to do.
    I want to develop a chat room on the mobile phone.
    but i am so unfamiliar with ice. however i think ice could give me a chance to build a chat room on mobile phone.
    now,let servers run on different computers is a problem to me.
    You should note that deploying multiple instances of the chat server using IceGrid replica groups won't automatically ensure that the chat server data is replicated. Each server will have its own data (chat rooms, sessions) unless you explicitly replicate the data between the different server instances.
    Can icestorm solve the problem? if it does not,how?:)

    Best Wishes!
  • benoit
    benoit Rennes, France
    By default, Glacier2 caches the session manager endpoints returned by the locator. To disable this cache and contact the locator for each session manager create() call, you need to set the following property:
    Glacier2.SessionManager.LocatorCacheTimeout=0
    

    See the Ice manual for more information.

    IceStorm is a publish/subscribe messaging service. Although it might help to implement replication of your chat room servers, it won't provide replication out of the box. For information on how to implement replication, take a look at the "Implementing Master-Slave Replication with Ice" newsletter article.

    Note that explaining how to implement replication is out of the scope of the free support we can provide on the forums. If you need more information on this, I recommend looking into the literature on this subject.

    Cheers,
    Benoit.
  • :) Thank you so much!your help do me a good favour,especially to a beginner.Thanks.