Re: About ZooKeeper Dynamic Reconfiguration

2019-10-08 Thread Gao,Wei
Hi oo4load,
  Where did you sent it to? Through this site or directly sent to my email?
I received your pseudo codes last week just like this shown below:

buildDatacenterAndServerModel(configurationFile) {
  enum zookeeperRole PARTICIPANT, OBSERVER, NONE, DOWN
  object datacenter has servers
  object server has zookeeperRole configuredRole, zookeeperRole activeRole
  parse(configurationFile) into (datacenter, servers);
}
shiftMajority(designatedSurvivorDatacenter) {
 
designatedSurvivorDatacenter.someObserver.dynamicReconfigure(server=PARTICIPANT)
  otherDatacenter.someParticipant.dynamicReconfigure(server=OBSERVER)
}
balanceServerRoles() {
  if (designatedSurvivorDatacenter.hasMinimumQuorum)
  someParticipant.dynamicReconfigure(server=OBSERVER)
  if (quorumSize.aboveSafeLimit)
  someObserver.dynamicReconfigure(server=PARTICIPANT)
  //This is a lot more complicated than 2 simple commands, you need an
algorithm or define several scenarios.
}


main() {
 buildDatacenterAndServerModel(configurationFile);
  while (IamLeader) {
parse(zk.getData(“/zookeeper/config”)) into servers.configuredRole;
foreach(server) getServerRole(“server:8081/commands/stat”) into
servers.activeRole;

foreach(server.activeRole=DOWN)  dynamicReconfigure(server=OBSERVER);
  server.setConfiguredRole(OBSERVER);

if(designatedSurvivorDatacenter != datacenter.hasMajority)
   shiftMajority(designatedSurvivorDatacenter);
   balanceServerRoles();
  }
}

If this above is not what you mean, would you please send it again?
Really appreciate for your kindness!





--
Sent from: http://zookeeper-user.578899.n2.nabble.com/


Re: About ZooKeeper Dynamic Reconfiguration

2019-10-08 Thread Chris T.
I sent it 1 week ago.

On Tue, Oct 8, 2019 at 10:08 AM Gao,Wei  wrote:

> Hi oo4load,
>   If it is convenient to you, I would like to get the actual code from you
> about the zookeeper cluster balancer implementation. My email address is:
> wei@arcserve.com
> Thank you again.
>
>
>
> --
> Sent from: http://zookeeper-user.578899.n2.nabble.com/
>


Re: About ZooKeeper Dynamic Reconfiguration

2019-10-08 Thread Gao,Wei
Hi oo4load,
  If it is convenient to you, I would like to get the actual code from you
about the zookeeper cluster balancer implementation. My email address is: 
wei@arcserve.com
Thank you again.



--
Sent from: http://zookeeper-user.578899.n2.nabble.com/