wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
安装:
rpm -Uvh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -Uvh python-urlgrabber-3.9.1-11.el6.noarch.rpm
rpm -Uvh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -Uvh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
mv /etc/yum.repos.d/*.repo /root/
vi /etc/yum.repos.d/rhel-debuginfo.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
#[addons]
#name=CentOS-$releasever - Addons
#baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
#gpgcheck=1
#gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
vi /etc/hosts
192.168.2.6 mysql1
192.168.2.8 mysql2
192.168.2.9 heartbeat
yum -y groupinstall "Development tools"
yum -y groupinstall "High Availability"
yum -y groupinstall "High Availability Management"
yum -y install autoconf automake libtool gcc gcc-c++ libxml2-devel bzip2-devel glib2-devel libtool libtool-ltdl PyXML
yum -y install cluster-glue
yum -y install resource-agents
yum -y install pacemaker*
cd /etc/ha.d
vi ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
keepalive 500ms
deadtime 30
warntime 10
initdead 120
udpport 694
bcast eth0
ucast eth1 10.0.0.11
auto_failback off
node mysql1
node mysql2
ping 192.168.2.254
respawn hacluster /usr/lib64/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster
compression bz2
compression_threshold 2
vi /etc/ha.d/haresources
mysql1 192.168.2.9/24/eth0:1 Filesystem::/dev/sdb1::/hadata::ext4 mysqld
vi /etc/ha.d/authkeys
auth 2
2 crc
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/hadata/mysql \
-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \
-DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1
make
make install
cd /usr/local/mysql/support-files
cp mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld off
vi /etc/profile
PATH=/usr/local/mysql/bin:$PATH
export PATH
source /etc/profile