box.ctl.make_bootstrap_leader()
-
make_bootstrap_leader([opts])¶ Since: 3.0.0.
Make the instance a bootstrap leader of a replica set.
To be able to make the instance a bootstrap leader manually, the effective bootstrap strategy should be
supervised. This is the case whenbox.cfg{bootstrap_strategy = 'supervised'}is used or when replication.bootstrap_strategy in the YAML configuration is set tosupervisedornative. Withnative, the configuration logic normally callsbox.ctl.make_bootstrap_leader()automatically.In this case, the instances do not choose a bootstrap leader automatically but wait for it to be appointed manually. Configuration fails if no bootstrap leader is appointed during a replication.connect_timeout.
Parameters: - opts (
table) –optional parameters. The following option is available:
graceful(boolean) – iftrue, request a graceful bootstrap. If the local database is absent, the instance checks whether a bootstrap leader exists on connected peers and takes this role only if no bootstrap leader is found. If the local database already exists, the call is a no-op. The default value isfalse.
Note
The
gracefuloption is available since 3.4.0. It doesn’t protect an unbootstrapped replica set from two instances that simultaneously try to bootstrap it gracefully.Note
When a new instance joins a replica set configured with the
supervisedornativebootstrap strategy, this instance doesn’t choose the bootstrap leader automatically but joins to the instance on whichbox.ctl.make_bootstrap_leader()was executed last time.- opts (