1. In the system environment, CentOS 6.3, master a ip: 192.168.1.28, and master B ip: 192.168.1.29.
2. Install cmake and mysql
1. Install cmake
# Tar xf cmake-2.8.8.tar.gz
# Cd cmake-2.8.8
#./Bootstrap
# Gmake & gmake install
2. Install mysql
# Useradd-r mysql-s/sbin/nologin
# Mkdir-p/data/mysql/{data, binlog, relaylog}
# Chown mysql: mysql-R/data/mysql
# Tar xf mysql-5.5.27.tar.gz
# Cd mysql-5.5.27
# Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-DEXTRA_CHARSETS = all-rows = 1-rows = 1-rows = 1-rows =//mysql/data-DWITH_DEBUG = 0-DSYSCONFDIR =/etc-DMYSQL_TCP_PORT = 3306
# Ncurses-devel, yum-y install ncurses-devel
# Rm-f CMakeCache. txe re-Execute./configure
# Make & make install
# Cd/usr/local/mysql
# Chown-R mysql: mysql *
# Cp support-files/mysql. server/etc/rc. d/init. d/mysqld
# Chmod + x/etc/init. d/mysqld
# Chkconfig mysqld on
# Vim/etc/profile add PATH = $ PATH:/usr/local/mysql/bin
#./Etc/profile (or export PATH = $ PATH:/usr/local/mysql/bin)
# Ln-sv/usr/local/mysql/include // usr/include/mysql
# Echo '/usr/local/mysql/lib'>/etc/ld. so. conf. d/mysql. conf load the library file
# Ldconfig-v | grep mysql
# Vim/etc/man. config Add a MANPATH/usr/local/mysql/man line
The environment is basically OK.
# Cd/usr/local/mysql
Scripts/mysql_install_db -- user = mysql -- datadir =/data/mysql
Clone the master server and modify the IP address and MAC address to ensure that the two servers can ping each other.