'\" t .\" Title: ocf_heartbeat_mariadb .\" Author: ClusterLabs contributors (see the resource agent source for information about individual authors) .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 12/17/2020 .\" Manual: OCF resource agents .\" Source: resource-agents UNKNOWN .\" Language: English .\" .TH "OCF_HEARTBEAT_MARIAD" "7" "12/17/2020" "resource-agents UNKNOWN" "OCF resource agents" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ocf_heartbeat_mariadb \- Manages a MariaDB master/slave instance .SH "SYNOPSIS" .HP \w'\fBmariadb\fR\ 'u \fBmariadb\fR [start | stop | status | monitor | promote | demote | meta\-data | validate\-all] .SH "DESCRIPTION" .PP Resource script for MariaDB\&. .PP Manages a complete master/slave replication setup with GTID, for simpler uses look at the mysql resource agent which supports older replication forms which mysql and mariadb have in common\&. .PP The resource must be setup to use notifications\&. Set \*(Aqnotify=true\*(Aq in the metadata attributes when defining a MariaDB master/slave instance\&. .PP The default behavior is to use uname \-n values in the change master to command\&. Other IPs can be specified manually by adding a node attribute ${INSTANCE_ATTR_NAME}_mysql_master_IP giving the IP to use for replication\&. For example, if the mariadb primitive you are using is p_mariadb, the attribute to set will be p_mariadb_mysql_master_IP\&. .SH "SUPPORTED PARAMETERS" .PP \fBbinary\fR .RS 4 Location of the MariaDB server binary .sp (optional, string, default "/usr/bin/mysqld_safe") .RE .PP \fBclient_binary\fR .RS 4 Location of the MariaDB client binary .sp (optional, string, default "mysql") .RE .PP \fBconfig\fR .RS 4 Configuration file .sp (optional, string, default "/etc/mysql/my\&.cnf") .RE .PP \fBdatadir\fR .RS 4 Directory containing databases .sp (optional, string, default "/var/lib/mysql") .RE .PP \fBuser\fR .RS 4 User running MariaDB daemon .sp (optional, string, default "mysql") .RE .PP \fBgroup\fR .RS 4 Group running MariaDB daemon (for logfile and directory permissions) .sp (optional, string, default "mysql") .RE .PP \fBlog\fR .RS 4 The logfile to be used for mysqld\&. .sp (optional, string, default "/var/log/mysql/error\&.log") .RE .PP \fBnode_list\fR .RS 4 All node names of nodes that will execute mariadb\&. Please separate each node name with a space\&. This is required for the master selection to function\&. .sp (required, string, no default) .RE .PP \fBpid\fR .RS 4 The pidfile to be used for mysqld\&. .sp (optional, string, default "/var/run/mysqld/mysqld\&.pid") .RE .PP \fBsocket\fR .RS 4 The socket to be used for mysqld\&. .sp (optional, string, default "/var/run/mysqld/mysqld\&.sock") .RE .PP \fBtest_table\fR .RS 4 Table to be tested in monitor statement (in database\&.table notation) .sp (optional, string, default "mysql\&.user") .RE .PP \fBtest_user\fR .RS 4 MariaDB test user, must have select privilege on test_table .sp (optional, string, default "root") .RE .PP \fBtest_passwd\fR .RS 4 MariaDB test user password .sp (optional, string, no default) .RE .PP \fBenable_creation\fR .RS 4 If the MariaDB database does not exist, it will be created .sp (optional, boolean, default 0) .RE .PP \fBadditional_parameters\fR .RS 4 Additional parameters which are passed to the mysqld on startup\&. (e\&.g\&. \-\-skip\-external\-locking or \-\-skip\-grant\-tables) .sp (optional, string, no default) .RE .PP \fBreplication_user\fR .RS 4 MariaDB replication user\&. This user is used for starting and stopping MariaDB replication, for setting and resetting the master host, and for setting and unsetting read\-only mode\&. Because of that, this user must have SUPER, REPLICATION SLAVE, REPLICATION CLIENT, PROCESS and RELOAD privileges on all nodes within the cluster\&. Mandatory if you define a master\-slave resource\&. .sp (optional, string, default "root") .RE .PP \fBreplication_passwd\fR .RS 4 MariaDB replication password\&. Used for replication client and slave\&. Mandatory if you define a master\-slave resource\&. .sp (optional, string, no default) .RE .PP \fBreplication_port\fR .RS 4 The port on which the Master MariaDB instance is listening\&. .sp (optional, string, default "3306") .RE .SH "SUPPORTED ACTIONS" .PP This resource agent supports the following actions (operations): .PP \fBstart\fR .RS 4 Starts the resource\&. Suggested minimum timeout: 120s\&. .RE .PP \fBstop\fR .RS 4 Stops the resource\&. Suggested minimum timeout: 120s\&. .RE .PP \fBstatus\fR .RS 4 Performs a status check\&. Suggested minimum timeout: 60s\&. .RE .PP \fBmonitor\fR .RS 4 Performs a detailed status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 20s\&. .RE .PP \fBmonitor (Master role)\fR .RS 4 Performs a detailed status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 10s\&. .RE .PP \fBmonitor (Slave role)\fR .RS 4 Performs a detailed status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 30s\&. .RE .PP \fBpromote\fR .RS 4 Promotes the resource to the Master role\&. Suggested minimum timeout: 120s\&. .RE .PP \fBdemote\fR .RS 4 Demotes the resource to the Slave role\&. Suggested minimum timeout: 120s\&. .RE .PP \fBnotify\fR .RS 4 Suggested minimum timeout: 90s\&. .RE .PP \fBvalidate\-all\fR .RS 4 Performs a validation of the resource configuration\&. Suggested minimum timeout: 5s\&. .RE .PP \fBmeta\-data\fR .RS 4 Retrieves resource agent metadata (internal use only)\&. Suggested minimum timeout: 5s\&. .RE .SH "EXAMPLE CRM SHELL" .PP The following is an example configuration for a mariadb resource using the \fBcrm\fR(8) shell: .sp .if n \{\ .RS 4 .\} .nf primitive p_mariadb ocf:heartbeat:mariadb \e params \e node_list=\fIstring\fR \e op monitor depth="0" timeout="30s" interval="20s" \e op monitor role="Master" depth="0" timeout="30s" interval="10s" \e op monitor role="Slave" depth="0" timeout="30s" interval="30s" .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf ms ms_mariadb p_mariadb \e meta notify="true" interleave="true" .fi .if n \{\ .RE .\} .SH "EXAMPLE PCS" .PP The following is an example configuration for a mariadb resource using \fBpcs\fR(8) .sp .if n \{\ .RS 4 .\} .nf pcs resource create p_mariadb ocf:heartbeat:mariadb \e node_list=\fIstring\fR \e op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="20s" \e op monitor role="Master" OCF_CHECK_LEVEL="0" timeout="30s" interval="10s" \e op monitor role="Slave" OCF_CHECK_LEVEL="0" timeout="30s" interval="30s" promotable .fi .if n \{\ .RE .\} .SH "SEE ALSO" .PP \m[blue]\fB\%http://clusterlabs.org/\fR\m[] .SH "AUTHOR" .PP \fBClusterLabs contributors (see the resource agent source for information about individual authors)\fR