1OCF_HEARTBEAT_MYSQL(7) OCF resource agents OCF_HEARTBEAT_MYSQL(7)
2
3
4
6 ocf_heartbeat_mysql - Manages a MySQL database instance
7
9 mysql [start | stop | status | monitor | promote | demote | meta-data |
10 validate-all]
11
13 Resource script for MySQL. May manage a standalone MySQL database, a
14 clone set with externally managed replication, or a complete
15 master/slave replication setup.
16
18 binary
19 Location of the MySQL server binary (optional, string, default
20 /usr/bin/safe_mysqld)
21
22 client_binary
23 Location of the MySQL client binary (optional, string, default
24 mysql)
25
26 config
27 Configuration file (optional, string, default /etc/my.cnf)
28
29 datadir
30 Directory containing databases (optional, string, default
31 /var/lib/mysql)
32
33 user
34 User running MySQL daemon (optional, string, default mysql)
35
36 group
37 Group running MySQL daemon (for logfile and directory permissions)
38 (optional, string, default mysql)
39
40 log
41 The logfile to be used for mysqld. (optional, string, default
42 /var/log/mysqld.log)
43
44 pid
45 The pidfile to be used for mysqld. (optional, string, default
46 /var/run/mysql/mysqld.pid)
47
48 socket
49 The socket to be used for mysqld. (optional, string, default
50 /var/lib/mysql/mysql.sock)
51
52 test_table
53 Table to be tested in monitor statement (in database.table
54 notation) (optional, string, default mysql.user)
55
56 test_user
57 MySQL test user (optional, string, default root)
58
59 test_passwd
60 MySQL test user password (optional, string, no default)
61
62 enable_creation
63 If the MySQL database does not exist, it will be created (optional,
64 integer, default 0)
65
66 additional_parameters
67 Additional parameters which are passed to the mysqld on startup.
68 (e.g. --skip-external-locking or --skip-grant-tables) (optional,
69 string, no default)
70
71 replication_user
72 MySQL replication user. This user is used for starting and stopping
73 MySQL replication, for setting and resetting the master host, and
74 for setting and unsetting read-only mode. Because of that, this
75 user must have SUPER, REPLICATION SLAVE, REPLICATION CLIENT, and
76 PROCESS privileges on all nodes within the cluster. (optional,
77 string, no default)
78
79 replication_passwd
80 MySQL replication password. Used for replication client and slave.
81 (optional, string, no default)
82
83 replication_port
84 The port on which the Master MySQL instance is listening.
85 (optional, string, default 3306)
86
87 max_slave_lag
88 The maximum number of seconds a replication slave is allowed to lag
89 behind its master. Do not set this to zero. What the cluster
90 manager does in case a slave exceeds this maximum lag is determined
91 by the evict_outdated_slaves parameter. (optional, integer,
92 default 3600)
93
94 evict_outdated_slaves
95 If set to true, any slave which is more than max_slave_lag seconds
96 behind the master has its MySQL instance shut down. If this
97 parameter is set to false in a primitive or clone resource, it is
98 simply ignored. If set to false in a master/slave resource, then
99 exceeding the maximum slave lag will merely push down the master
100 preference so the lagging slave is never promoted to the new
101 master. (optional, boolean, default false)
102
104 This resource agent supports the following actions (operations):
105
106 start
107 Starts the resource. Suggested minimum timeout: 120.
108
109 stop
110 Stops the resource. Suggested minimum timeout: 120.
111
112 status
113 Performs a status check. Suggested minimum timeout: 60.
114
115 monitor
116 Performs a detailed status check. Suggested minimum timeout: 30.
117 Suggested interval: 20.
118
119 monitor (Master role)
120 Performs a detailed status check. Suggested minimum timeout: 30.
121 Suggested interval: 10.
122
123 monitor (Slave role)
124 Performs a detailed status check. Suggested minimum timeout: 30.
125 Suggested interval: 30.
126
127 promote
128 Promotes the resource to the Master role. Suggested minimum
129 timeout: 120.
130
131 demote
132 Demotes the resource to the Slave role. Suggested minimum timeout:
133 120.
134
135 notify
136 Suggested minimum timeout: 90.
137
138 validate-all
139 Performs a validation of the resource configuration. Suggested
140 minimum timeout: 5.
141
142 meta-data
143 Retrieves resource agent metadata (internal use only). Suggested
144 minimum timeout: 5.
145
147 The following is an example configuration for a mysql resource using
148 the crm(8) shell:
149
150 primitive p_mysql ocf:heartbeat:mysql \
151 op monitor depth="0" timeout="30" interval="20" \
152 op monitor role="Master" depth="0" timeout="30" interval="10" \
153 op monitor role="Slave" depth="0" timeout="30" interval="30"
154
155 ms ms_mysql p_mysql \
156 meta notify="true" interleave="true"
157
159 http://www.linux-ha.org/wiki/mysql_(resource_agent)
160
162 Linux-HA contributors (see the resource agent source for information
163 about individual authors)
164
165
166
167resource-agents 3.9.2 07/08/2011 OCF_HEARTBEAT_MYSQL(7)