PXC安裝步驟_binary版本

longer3281發表於2015-11-06
1)安裝包
yum install -y cmake gcc gcc-c++ libaio libaio-devel automake autoconf bzr ncurses ncurses-devel boost bison libtool  [ Debian/Ubuntu: ncurses5-devel libncurses5-dev] 
yum install -y perl-DBD-MySQL    perl-DBI    perl-Time-HiRes
yum install -y scons boost* check* openssl #for GaleraCluster
yum install -y rsync lsof 
yum install -y crypt socat


socat 需要手工下載安裝
yum install percona-xtrabackup-2.2.6-5042.el6.x86_64.rpm
yum install socat-1.7.2.4-1.el6.rf.x86_64.rpm 


2)解壓 Percona-XtraDB-Cluster-5.6.22-rel72.0-25.8.978.Linux.x86_64.tar.gz 檔案【無需編譯】
#cd /soft
#tar -zxvf Percona-XtraDB-Cluster-5.6.22-rel72.0-25.8.978.Linux.x86_64.tar.gz -C /usr/local/  【解壓】
#cd /usr/local/  
#mv Percona-XtraDB-Cluster-5.6.22-rel72.0-25.8.978.Linux.x86_64 mysql   【修改路徑名】

3)將下載後的mysql安裝程式複製到其它節點

tar -zcvf PXC_MySQL_5.6.tar.gz mysql
scp 其它節點,解壓即可

4) galera元件
該元件已經在binary程式包中已經存在
/usr/local/mysql/bin/garbd
/usr/local/mysql/lib/libgalera_smm.so  


#cp /usr/local/mysql/lib/libgalera_smm.so /usr/lib64/


記得設定以下引數
wsrep_provider=/usr/lib64/libgalera_smm.so

5)配置引數檔案my.cnf

6)建立資料庫

X86_64真實環境 連結以下庫檔案
ln -sf /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.6
ln -sf /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.6


7)只在第一個主節點做以下操作
/usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql  --basedir=/usr/local/mysql --datadir=/home/mysql_data/

8)設定配置檔案
#cp support-files/mysql.server /etc/init.d/mysql 
#chkconfig --add mysqld
#chkconfig --level 2345 mysqld off

9) 啟動
第一個節點啟動:
service mysqld bootstrap-pxc
第二個節點啟動:
service mysqld start
第三個節點啟動:
service mysqld start

GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'sstuser'@'localhost'identified by 'sstuser789';
GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'sstuser'@'192.168.123.%'identified by 'sstuser789';
-------------------------

wsrep_restart_slave=1
wsrep_slave_threads=8
innodb_flush_method=O_DIRECT

OS引數設定:
vm.swappiness=0

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9606353/viewspace-1824283/,如需轉載,請註明出處,否則將追究法律責任。

相關文章