Recovery Kit は、my.cnf ファイルが mysqld グループを使用していることを検知すると mysqld_multi コマンドを使用します。これに基づいて、LifeKeeper の制御下に配置する前に mysqld_multi を使用して MySQL インスタンスをテストすることができます。
以下は、mysqld_multi によって制御されている 2 つのデータベースインスタンスについて mysqld グループを使用した比較的複雑な my.cnf ファイルの解説です。mysqld_multi コマンド (および MySQL LifeKeeper Recovery Kit) は、管理者にさまざまな設定を行うためのオプションを提供しています。下記の例、 [mysqld1] では、さまざまな MySQL コマンドの大部分についてデフォルトのロケーションを使用する比較的単純な MySQL インスタンスを定義しています。その次の例、[mysqld55]では、より多くの変更を行っています。コメントは各セクションにおいて LifKeeper がどのように MySQL と相互作用しているかについて説明しているので参考にしてください。
# The following client section defines which username/password combination will be used for
# LifeKeeper connections. The username/password combination needs to be defined in each MySQL
# Database instance that will be d escribed in this my.cnf file.
[client]
user = steeleye
password = password
# This next section describes the default version of mysqld and mysqldadmin that mysqld_multi
# will use when processing mysqld_multi commands. The username/password combo defines the
# MySQL account that mysqld_multi will use when working with the database instances. This
# username and password combo needs to be d efined in each MySQL Database instance that will be
# controlled by mysqld_multi. See how to set up the multi_admin account in the MySQL Reference
# Manual, by issuing "mysqld_multi --example".
[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = multi_admin
password = password
# The next section defines the first of two MySQL Database instances in this my.cnf file. Note
# that each section starts with a [mysqldNN] where NN is the mysqld group number (or instance).
# Each group name must have a number. There are a number of directives that the LifeKeeper MySQL
# Recovery Kit will be looking for in these sections.
[mysqld1]
datadir = /s11/mysql-data5077 # Defines where the data files for the instance will live. For
# LifeKeeper, this directory must be on LifeKeeper protected
# (shared or replicated) storage.
mysqld = /usr/bin/mysqld_safe # Defines specifically which mysqld command will be used for
# starting the instance. This one is using the
# default mysqld_safe that came with the distribution.
socket=/s11/mysql-data5077/moe.socket # Defines the location of the socket for this instance.
# If the socket is not on LifeKeeper protected storage, it
# needs to be defined in exactly the same place on each
# node in the cluster and be owned by the "user" defined
# below.
port = 3307 # Each instance needs its own, unique TCP/IP port.
pid-file = /var/run/mysqld/mysqld.pid # The pid-file can be on LifeKeeper protected or
# non-LifeKeeper protected storage.
log-error= /var/log/mysqld.log # Location of the MySQL error log for this instance. Can be
# on LifeKeeper protected or non-LifeKeeper protected
# storage.
user = mysql # The Linux user name that will run the MySQL processes.
# The next section defines the more complicated of the two MySQL instances. Instance "55" is not
# using the default MySQL that came with the Linux distribution as it is using the 5.5.12 version
# of MySQL that was installed from source. The binaries for this version were installed onto shared
# storage, and the binary directory is LifeKeeper protected.
[mysqld55]
datadir = /s11/mysql-data5512 # Same as above; this instance uses a different data
# d irectory, and this directory is on LifeKeeper
# protected storage.
mysqld =/s11/mysql5512/bin/mysqld_safe # For this instance, a different version of mysqld_safe
# is used; the one that is included with 5.5.12.
socket=/s11/mysql-misc5512/larry.socket # This instance has the socket on LifeKeeper protected
# storage, but not in the default location (datadir).
port = 3308 # This instance has a unique TCP/IP port as well.
pid-file = /var/run/mysqld/mysqld55.pid # This instance's pid-file is not on LifeKeeper protected
# storage.
log-error = /var/log/mysqld55.log # This instance's log-error (error log) is not on
# LifeKeeper protected storage.
log-bin = /s11/mysql-log5512/larry # The log-bin directive specifies where the binary
# transaction logs are located for this instance.
# These logs must be on LifeKeeper protected storage
# (the recovery kit will enforce this). By default,
# these logs are in the datadir.
user = mysql # The Linux user name that will run the MySQL processes.