Link Search Menu Expand Document
Start for Free

stardog-admin cluster promote

Description

Promote a replica cluster to a writable primary

Usage

stardog-admin [ --krb5 ] [ --krb5-disable-rdns ] [ --server <server url> ] cluster promote [ {-p | --passwd} <password> ] [ {-P | --ask-password} ] [ --run-as <username> ] [ --token <token> ] [ {-u | --username} <username> ] [ {-v | --verbose} ]

Options

Name, shorthand Description
--krb5 Use the Kerberos environment.
--krb5-disable-rdns Disable reverse DNS lookup for Kerberos clients.
-p <password>, --passwd <password> Password.
-P, --ask-password Prompt for password.
--run-as <username> User to impersonate when running the command
--server <server url> URL of Stardog Server. If this option isn’t specified, it will be read from JVM argument ‘stardog.default.cli.server’. If the JVM arg isn’t set, the default value ‘http://localhost:5820’ is used. If server URL has no explicit port value, the default port value ‘5820’ is used. Example: ‘stardog-admin –server http://12.34.56.78:5820 server stop’
--token <token> Stardog JWT token
-u <username>, --username <username> User name.
-v, --verbose Flag that can cause more detailed information to be printed such as errors and status. Exact output depends upon the command and options used.

Discussion

Issue this once, to any node of the replica cluster. The cluster stops replicating from its primary and starts accepting client writes, with no restart. Reads stay available throughout and no node leaves the cluster.

It runs in two steps. First every member detaches from the primary, which can take as long as a sync round already in progress needs to finish - a full copy crossing the WAN, in the worst case. Only then is the write gate lifted. If a member cannot be detached within pack.replicaCluster.promote.quiesce.timeout the command fails, no member accepts client writes, and the cluster is left no longer replicating. Run stardog-admin cluster status to see whether it has since detached, then run this command again to finish.

The write gate is not lifted while the cluster is in read-only mode. Run stardog-admin cluster readonly stop, then run this command again.

Transactions committed on the primary after this cluster’s last sync round are not present here and are not fetched afterwards. Run stardog-admin cluster status first to see the synced transaction of each database, which is the point this cluster is being cut over at.

Promotion does not fence the old primary. Stopping clients from writing to it is the operator’s job, through routing, a load balancer, or DNS.

A member that is unreachable when the write gate is lifted is reported and not expelled; it adopts the change when it comes back.

Afterwards, set pack.replicaCluster=false in stardog.properties on every node. The change is recorded only in ZooKeeper, so until then a node that restarts after ZooKeeper’s data is lost re-attaches to the former primary. The edit takes effect at each node’s next restart; none is needed now.