1OCF_HEARTBEAT_MARIAD(7)       OCF resource agents      OCF_HEARTBEAT_MARIAD(7)
2
3
4

NAME

6       ocf_heartbeat_mariadb - Manages a MariaDB master/slave instance
7

SYNOPSIS

9       mariadb [start | stop | status | monitor | promote | demote | meta-data
10               | validate-all]
11

DESCRIPTION

13       Resource script for MariaDB.
14
15       Manages a complete master/slave replication setup with GTID, for
16       simpler uses look at the mysql resource agent which supports older
17       replication forms which mysql and mariadb have in common.
18
19       The resource must be setup to use notifications. Set 'notify=true' in
20       the metadata attributes when defining a MariaDB master/slave instance.
21
22       The default behavior is to use uname -n values in the change master to
23       command. Other IPs can be specified manually by adding a node attribute
24       ${INSTANCE_ATTR_NAME}_mysql_master_IP giving the IP to use for
25       replication. For example, if the mariadb primitive you are using is
26       p_mariadb, the attribute to set will be p_mariadb_mysql_master_IP.
27

SUPPORTED PARAMETERS

29       binary
30           Location of the MariaDB server binary
31
32           (optional, string, default "/usr/bin/safe_mysqld")
33
34       client_binary
35           Location of the MariaDB client binary
36
37           (optional, string, default "mysql")
38
39       config
40           Configuration file
41
42           (optional, string, default "/etc/my.cnf")
43
44       datadir
45           Directory containing databases
46
47           (optional, string, default "/var/lib/mysql")
48
49       user
50           User running MariaDB daemon
51
52           (optional, string, default "mysql")
53
54       group
55           Group running MariaDB daemon (for logfile and directory
56           permissions)
57
58           (optional, string, default "mysql")
59
60       log
61           The logfile to be used for mysqld.
62
63           (optional, string, default "/var/log/mysqld.log")
64
65       node_list
66           All node names of nodes that will execute mariadb. Please separate
67           each node name with a space. This is required for the master
68           selection to function.
69
70           (required, string, no default)
71
72       pid
73           The pidfile to be used for mysqld.
74
75           (optional, string, default "/var/run/mysql/mysqld.pid")
76
77       socket
78           The socket to be used for mysqld.
79
80           (optional, string, default "/var/lib/mysql/mysql.sock")
81
82       test_table
83           Table to be tested in monitor statement (in database.table
84           notation)
85
86           (optional, string, default "mysql.user")
87
88       test_user
89           MariaDB test user, must have select privilege on test_table
90
91           (optional, string, default "root")
92
93       test_passwd
94           MariaDB test user password
95
96           (optional, string, no default)
97
98       enable_creation
99           If the MariaDB database does not exist, it will be created
100
101           (optional, boolean, default 0)
102
103       additional_parameters
104           Additional parameters which are passed to the mysqld on startup.
105           (e.g. --skip-external-locking or --skip-grant-tables)
106
107           (optional, string, no default)
108
109       replication_user
110           MariaDB replication user. This user is used for starting and
111           stopping MariaDB replication, for setting and resetting the master
112           host, and for setting and unsetting read-only mode. Because of
113           that, this user must have SUPER, REPLICATION SLAVE, REPLICATION
114           CLIENT, PROCESS and RELOAD privileges on all nodes within the
115           cluster. Mandatory if you define a master-slave resource.
116
117           (optional, string, default "root")
118
119       replication_passwd
120           MariaDB replication password. Used for replication client and
121           slave. Mandatory if you define a master-slave resource.
122
123           (optional, string, no default)
124
125       replication_port
126           The port on which the Master MariaDB instance is listening.
127
128           (optional, string, default "3306")
129

SUPPORTED ACTIONS

131       This resource agent supports the following actions (operations):
132
133       start
134           Starts the resource. Suggested minimum timeout: 120s.
135
136       stop
137           Stops the resource. Suggested minimum timeout: 120s.
138
139       status
140           Performs a status check. Suggested minimum timeout: 60s.
141
142       monitor
143           Performs a detailed status check. Suggested minimum timeout: 30s.
144           Suggested interval: 20s.
145
146       monitor (Master role)
147           Performs a detailed status check. Suggested minimum timeout: 30s.
148           Suggested interval: 10s.
149
150       monitor (Slave role)
151           Performs a detailed status check. Suggested minimum timeout: 30s.
152           Suggested interval: 30s.
153
154       promote
155           Promotes the resource to the Master role. Suggested minimum
156           timeout: 120s.
157
158       demote
159           Demotes the resource to the Slave role. Suggested minimum timeout:
160           120s.
161
162       notify
163           Suggested minimum timeout: 90s.
164
165       validate-all
166           Performs a validation of the resource configuration. Suggested
167           minimum timeout: 5s.
168
169       meta-data
170           Retrieves resource agent metadata (internal use only). Suggested
171           minimum timeout: 5s.
172

EXAMPLE CRM SHELL

174       The following is an example configuration for a mariadb resource using
175       the crm(8) shell:
176
177           primitive p_mariadb ocf:heartbeat:mariadb \
178             params \
179               node_list=string \
180             op monitor depth="0" timeout="30s" interval="20s" \
181             op monitor role="Master" depth="0" timeout="30s" interval="10s" \
182             op monitor role="Slave" depth="0" timeout="30s" interval="30s"
183
184           ms ms_mariadb p_mariadb \
185             meta notify="true" interleave="true"
186

EXAMPLE PCS

188       The following is an example configuration for a mariadb resource using
189       pcs(8)
190
191           pcs resource create p_mariadb ocf:heartbeat:mariadb \
192             node_list=string \
193             op monitor depth="0" timeout="30s" interval="20s" \
194             op monitor role="Master" depth="0" timeout="30s" interval="10s" \
195             op monitor role="Slave" depth="0" timeout="30s" interval="30s" --master
196

SEE ALSO

198       http://clusterlabs.org/
199

AUTHOR

201       ClusterLabs contributors (see the resource agent source for information
202       about individual authors)
203
204
205
206resource-agents UNKNOWN           10/24/2018           OCF_HEARTBEAT_MARIAD(7)
Impressum