replication-manager ships with replication-manager-cli, a command line client that connects to the running daemon over the REST API. It can be used interactively via the terminal console or non-interactively for scripting and automation.
Start the interactive console:
replication-manager-cli console
For a specific cluster:
replication-manager-cli console --cluster=mycluster

| Key | Action |
|---|---|
Ctrl-D |
Print debug information |
Ctrl-F |
Manual failover |
Ctrl-I |
Toggle automatic / manual failover mode |
Ctrl-R |
Set replicas read-only |
Ctrl-S |
Switchover |
Ctrl-W |
Set replicas read-write |
Ctrl-P / Ctrl-N |
Switch between clusters |
Ctrl-Q |
Quit |
Trigger a controlled primary handoff:
replication-manager-cli switchover --cluster=mycluster
Trigger a failover without waiting for the primary to recover:
replication-manager-cli failover --cluster=mycluster
Initialize replication on existing database nodes that have no replication configured. Supported topologies:
master-slavemaster-slave-no-gtidmaxscale-binlogmulti-mastermulti-tier-slavereplication-manager-cli --cluster=mycluster bootstrap --clean-all --topology=multi-tier-slave
replication-manager-cli --cluster=mycluster status
Sample output:
| Group: mycluster | Mode: Manual
Id Host Port Status Failures Using GTID Current GTID Slave GTID Delay RO
5641630519400684578 127.0.0.1 3317 Master 0 No 0-3317-3124 0 OFF
9624235790336213315 127.0.0.1 3318 Maintenance 0 Slave_Pos 0-3317-3124 0-3317-3124 0 ON
3944708846436490796 127.0.0.1 3319 Slave 0 Slave_Pos 0-3317-3124 0-3317-3124 0 ON
replication-manager-cli topology
Place a specific server in maintenance mode using its numeric ID:
replication-manager-cli server --id=9624235790336213315 --maintenance