Best way to start zookeeper server from java program -
i have 2 questions couldn't find popular/widely accepted solutions:
what easiest way start zookeeper server using java program?
and, possible add servers zookeeper cluster without having manually go each machine , update config files new node's id , ip:port entry?
can please help? thanks!
if want start new zookeeper server process java code, same way start other external process java, e.g. using processbuilder. there nothing special here in case of zookeeper. can check official docs on how actual command should like. gets complicated if want supervise process production use, in case better use provided on os (e.g. upstart, runit, etc...), or take @ exhibitor code examples: https://github.com/netflix/exhibitor.
if asking starting zookeeper cluster java program, complicate things further, since need supervise multiple zookeeper jvm processes on different hosts. take @ exhibitor.
if question starting zookeeper server instance inside same jvm process java code (embedded), possible. there few important details keep in mind, take @ answer: is possible start zookeeper server instance in process, unit tests?
regarding second question, real support dynamic cluster reconfiguration added recently, in 3.5.0: http://zookeeper.apache.org/doc/trunk/zookeeperreconfig.html.
prior this, can still "add servers zookeeper cluster without having manually go each machine , update config", have use configuration management tool chef, puppet or similar, , in case need restart of cluster uptake new config.
Comments
Post a Comment