SollmoStudio / beyond

Beyond: The Scalable Game Server Framework
http://www.beyondframework.com
Apache License 2.0
25 stars 9 forks source link

Support clustered ZooKeeper server. #192

Closed sgkim126 closed 9 years ago

sgkim126 commented 9 years ago

Currently, beyond launches ZooKeeper as standalone mode. This patch makes beyond launch ZooKeeper as clustered mode when there are server lists in the zookeeper config file and ass standalone mode when there is no server lists in the zookeeper config file. This behavior is implemented on QuorumPeerMain so This patch just uses QuorumPeerMain instead of ZooKeeperServerMain.

You have to add dataDir/myid file to use clustered mode. It's ZooKeeper's restriction. Read http://zookeeper.apache.org/doc/r3.4.6/zookeeperStarted.html#sc_RunningReplicatedZooKeeper for more information.

hatashiro commented 9 years ago

As I understand, QuorumPeerMain automatically turns on the server as a cluster if the list is defined in the config? So we don't need any other conditional or something like that, do we?

If true, LGTM.

sgkim126 commented 9 years ago

Yes, as you understand. QuorumPeerMain automatically turns on as cluster if the list is defined, and turns on as standalone if the list is not defined.

hatashiro commented 9 years ago

Brill. LGTM.

sgkim126 commented 9 years ago

I fixed some typo. I'll push it after travis passes.