Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Lefranc committed Mar 11, 2016
1 parent 5a9ce91 commit 12f9a7b
Showing 1 changed file with 46 additions and 22 deletions.
68 changes: 46 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,83 +32,107 @@ To perform switchover, mariadb-repmgr uses a mechanism similar to common mysql f

Start mariadb-repmgr in switchover interactive mode with master host db1 and slaves db2 and db3:

`mariadb-repmgr -hosts=db1,db2,db3 -user=root -rpluser=replicator -interactive -switchover=keep`
`mariadb-repmgr --hosts=db1,db2,db3 --user=root --rpluser=replicator --interactive --switchover=keep`

Start mariadb-repmgr in interactive failover mode using full host and port syntax, using root login for management and repl login for replication switchover, with failover scripts and added verbosity. Accept a maximum slave delay of 15 seconds before performing switchover:

`mariadb-repmgr -hosts=db1:3306,db2:3306,db2:3306 -user=root:pass -rpluser=repl:pass -pre-failover-script="/usr/local/bin/vipdown.sh" -post-failover-script="/usr/local/bin/vipup.sh" -verbose -maxdelay 15 -failover=monitor`
`mariadb-repmgr --hosts=db1:3306,db2:3306,db2:3306 --user=root:pass --rpluser=repl:pass --pre-failover-script="/usr/local/bin/vipdown.sh" -post-failover-script="/usr/local/bin/vipup.sh" --verbose --maxdelay 15 --failover=monitor`

Automatically failover a dead master in the above setup:
Failover non-interactively a dead master (similar setup as above):

`mariadb-repmgr -hosts=db1:3306,db2:3306,db2:3306 -user=root:pass -rpluser=repl:pass -pre-failover-script="/usr/local/bin/vipdown.sh" -post-failover-script="/usr/local/bin/vipup.sh" -failover=force -interactive=false`
`mariadb-repmgr --hosts=db1:3306,db2:3306,db2:3306 --user=root:pass --rpluser=repl:pass --pre-failover-script="/usr/local/bin/vipdown.sh" --post-failover-script="/usr/local/bin/vipup.sh" --failover=force --interactive=false`

## OPTIONS

* -failover `<state>`
* --autorejoin `bool`

Automatically rejoin a failed server to the current master. (default true)

* --connect-timeout `secs`

Database connection timeout in seconds (default 5)

* --failover `<state>`

Start the replication manager in failover mode. `state` can be either `monitor` or `force`, whether the manager should run in monitoring or command line mode. The action will result in removing the master of the current replication topology.

* -gtidcheck `<boolean>`
* --failcount `secs`

Trigger failover after N failures (interval 1s) (default 5)

* --failover-limit `count`

In auto-monitor mode, quit after N failovers (0: unlimited)

* --failover-time-limit `secs`

In auto-monitor mode, wait N seconds before attempting next failover (0: do not wait)

* --gtidcheck `<boolean>`

Check that GTID sequence numbers are identical before initiating failover. Default false. This must be used if you want your servers to be perfectly in sync before initiating master switchover. If false, mariadb-repmgr will wait for the slaves to be in sync before initiating.

* -hosts `<address>:[port],`
* --hosts `<address>:[port],`

List of MariaDB hosts IP and port (optional), specified in the `host:[port]` format and comma-separated.

* -ignore-servers `<address>:[port],`
* --ignore-servers `<address>:[port],`

List of servers in the `host:[port]` format to be ignored for slave promotion operations.

* -interactive `<boolean>`
* --interactive `<boolean>`

Runs the MariaDB monitor in interactive mode (default), asking for user interaction when failures are detected. A value of false also allows mariadb-repmgr to invoke switchover without displaying the interactive monitor.

* -maxdelay `<seconds>`
* --logfile `path`

Write MRM messages to a log file.

* --maxdelay `<seconds>`

Maximum slave replication delay allowed for initiating switchover, in seconds.

* -post-failover-script `<path>`
* --post-failover-script `<path>`

Path of post-failover script, to be invoked after new master promotion.

* -pre-failover-script `<path>`
* --pre-failover-script `<path>`

Path of pre-failover script to be invoked before master election.

* -prefmaster `<address>`
* --prefmaster `<address>`

Preferred candidate server for master failover, in `host:[port]` format.

* -readonly `<boolean>`
* --readonly `<boolean>`

Set slaves as read-only when performing switchover. Default true.

* -rpluser `<user>:[password]`
* --rpluser `<user>:[password]`

Replication user and password. This user must have REPLICATION SLAVE privileges and is used to setup the old master as a new slave.

* -switchover `<action>`
* --switchover `<action>`

Starts the replication manager in switchover mode. Action can be either `keep` to degrade the old master as a new slave, or `kill` to remove the old master from the replication topology.

* -socket `<path>`
* --socket `<path>`

Path of MariaDB unix socket. Default is "/var/run/mysqld/mysqld.sock"

* -user `<user>:[password]`
* --user `<user>:[password]`

User for MariaDB login, specified in the `user:[password]` format. Must have administrative privileges. This user is used to perform switchover.

* -verbose
* --verbose

Print detailed execution information.

* -version
* --version

Return softawre version.

* -wait-kill `<msecs>`
* --wait-kill `<msecs>`

Wait this many milliseconds before killing threads on demoted master. Default 5000 ms.

Expand All @@ -135,4 +159,4 @@ You should have received a copy of the GNU General Public License along with thi

## VERSION

**mariadb-repmgr** 0.5.2
**mariadb-repmgr** 0.6.0

0 comments on commit 12f9a7b

Please sign in to comment.