This is already possible, since the 3.5.0 release:
https://zookeeper.apache.org/doc/r3.5.3-beta/zookeeperReconfig.html#sc_reconfig_standaloneEnabled

After your single node is up and running, you can connect other nodes to it
as described in the reconfig manual. See "Adding servers" in the link above.
Essentially, you need to specify the new server's initial config files so
that they can find some existing server and start syncing data. Once a
quorum
of the new config is up to date, you can invoke the reconfig command to
officially make them part of the configuration.

Thanks,
Alex

On Thu, Dec 30, 2021 at 8:57 AM Eric Edgar
<eric.ed...@smartthings.com.invalid> wrote:

> Also would it be possible to update the code for this edge case,  eg if the
> current quorum is 1, and you want to add a node then add a flag saying I
> trust the single master and reconfigure itself into a 2 node cluster?
> Thanks,
> Eric
>
> On Thu, Dec 30, 2021 at 10:49 AM Eric Edgar <eric.ed...@smartthings.com>
> wrote:
>
> > Are there any examples with a k8 orchestrator or some sort of docker init
> > scripts handling the initial cluster configuration?
> > Thanks,
> > Eric
> >
> > On Thu, Dec 30, 2021 at 9:44 AM Chris T. <c.turks...@gmail.com> wrote:
> >
> >> If you want to run a zookeeper cluster you have to start with at least 2
> >> members. From there you can scale up with the dynamic reconfig commands.
> >> Regards
> >> Chris
> >>
> >> On 30 December 2021 16:40:40 Eric Edgar
> >> <eric.ed...@smartthings.com.INVALID> wrote:
> >>
> >> > I am experimenting with zk and the reconfig feature and trying to
> >> > understand if I can start a single zk node and then reconfig/bootstrap
> >> the
> >> > other 2 nodes into the ensemble.  The reconfig command is throwing an
> >> error
> >> > that there isn't a quorum yet.  Is this line of thinking possible?  or
> >> do I
> >> > need to setup the first 3 nodes manually the first time?
> >> > I am basing this experiment off of this web page.
> >> >
> >>
> https://blog.container-solutions.com/dynamic-zookeeper-cluster-with-docker
> >> >
> >> > /opt/zookeeper/zookeeper/bin/zkCli.sh -server 10.1.1.104:2181
> reconfig
> >> -add
> >> > "server.2=10.1.1.40:2888:3888:participant;2181"
> >> > No quorum of new config is connected and up-to-date with the leader of
> >> last
> >> > commmitted config - try invoking reconfiguration after new servers are
> >> > connected and synced
> >> >
> >> > /opt/zookeeper/zookeeper/bin/zkCli.sh -server 10.1.1.104:2181 config
> >> > server.1=10.1.1.104:2888:3888:participant;0.0.0.0:2181
> >> >
> >> > cat ./zoo.cfg
> >> > autopurge.purgeInterval=1
> >> > initLimit=10
> >> > syncLimit=5
> >> > autopurge.snapRetainCount=6
> >> > tickTime=2000
> >> > dataDir=/mnt/zookeeper/data
> >> > reconfigEnabled=true
> >> > standaloneEnabled=false
> >> >
> >>
> dynamicConfigFile=/opt/zookeeper/zookeeper/conf/zoo.cfg.dynamic.1600000000
> >> >
> >> > What is the best solution for an unattended bootstrap setup of a new
> >> > cluster from scratch?
> >> >
> >> >
> >> > This was something that we were able to accomplish with exhibitor on
> >> older
> >> > versions of zookeeper in the past.
> >>
> >>
>

Reply via email to