Re: [jgroups-users] Ability to set the coordinator programaticaly and the ability to maintain a shared state
Questions/problems related to using JGroups <[email protected]> Thu, 3 May 2018 09:26:11 +0200
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <mailman.2513.1525332384.977.javagroups-users@lists.sourceforge.net> |
On 29/04/18 10:45, Questions/problems related to using JGroups wrote: > Hi all, > > I am new to jGroups but I found this is an elegant library for cluster > management. I have 2 main requirements for one of my projects. > > First, is it possible to programmatically change the coordinator of > the jGroups cluster?. I am using the jgroups coordinator as the > application level master (for some domain-specific application) of the > server's cluster. But for a given server to become the application level > master there are some application level criteria to be fulfilled. So in > case of the jGroups coordinator cannot fulfill those requirements I want > to change the coordinator of the jGroups programmatically. I found [1] > for this purpose, but I wanted to understand whether this is a reliable > method or is there any side effects of doing this. If there is a > recommanded approach, please share that with me. [1] certainly works, but is a kludge. I recommend implementing a membership plugin [2], which determines the order of members in a view. You can thus control who the coordinator is/becomes. [1] can be used to change the coordinator when no view is getting installed, e.g. triggered by the application. > The second question is about the ability to maintain a shared state. Is > it possible to maintain a state which is visible across the cluster?. So > the changes are synchronized among the available members and visible to > all members without explicit message passing about the changes. Yes, use state transfer, check the manual for details. Note that the state is the same across *all* cluster members, which may lead to heap exhaustion if you have a large state and/or many members. [2] http://www.jgroups.org/manual4/index.html#MembershipChangePolicy > > [1] > https://github.com/belaban/JGroups/wiki/Changing-the-coordinator-of-a-cluster > > Thanks & Regards! > Tharindu, > > Tharindu Munasinghe. > Undergraduate, Department of Computer Science and Engineering > University of Moratuwa. > Contact no. +94770460887 > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > > _______________________________________________ > javagroups-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/javagroups-users > -- Bela Ban | http://www.jgroups.org ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ javagroups-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/javagroups-users