這篇文章主要介紹“PXC5.7的安裝步驟”,在日常操作中,相信很多人在PXC5.7的安裝步驟問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”PXC5.7的安裝步驟”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
十年的思茅網(wǎng)站建設(shè)經(jīng)驗,針對設(shè)計、前端、開發(fā)、售后、文案、推廣等六對一服務(wù),響應(yīng)快,48小時及時工作處理。網(wǎng)絡(luò)營銷推廣的優(yōu)勢是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動調(diào)整思茅建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計,從而大程度地提升瀏覽體驗。成都創(chuàng)新互聯(lián)公司從事“思茅網(wǎng)站設(shè)計”,“思茅網(wǎng)站推廣”以來,每個客戶項目都認(rèn)真落實執(zhí)行。節(jié)點分配
IP | hostname | 用途 |
192.168.137.201 | c1 | node1 |
192.168.137.202 | c2 | node2 |
192.168.137.203 | c3 | node3 |
需要的包
percona-xtrabackup-24-2.4.7-2.el6.x86_64.rpm
Percona-XtraDB-Cluster-5.7.18-rel15-29.20.1.Linux.x86_64.ssl101.tar.gz
安裝epel源(所有節(jié)點)
centos6
rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
centos7
rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
安裝依賴包
yum install perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes socat nc -y
安裝xtrabackup
wget /tupian/20230522/downloads rpm -ivh percona-xtrabackup-24-2.4.7-2.el6.x86_64.rpm
數(shù)據(jù)庫初始化
/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/mysql3306/data --user=mysql --initialize
修改mysqld_safe啟動文件
#####具體需要替換的路徑根據(jù)安裝的包名稱去mysqld_safe文件中查詢#############
sed -i 's#/mnt/workspace/percona-xtradb-cluster-5.7-binary-tarball/label_exp/centos6-64/Percona-XtraDB-Cluster-5.7.18-29.20/346/usr/local/Percona-XtraDB-Cluster-5.7.18-rel15-29.20.1.Linux.x86_64.ssl101#/usr/local/mysql#g' /usr/local/mysql/bin/mysqld_safe
vi /usr/local/mysql/support-files/mysql.server
basedir=/usr/local/mysql
datadir=/data/mysql/mysql3306/data
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
添加PXC相關(guān)的參數(shù)
vi /etc/my.cnf
[mysqld]
...
#PXC
wsrep_provider=/usr/local/mysql/lib/libgalera_smm.so
wsrep_cluster_address=gcomm://192.168.137.201,192.168.137.202,192.168.137.203
wsrep_node_address=192.168.137.201
wsrep_slave_threads=2
innodb_autoinc_lock_mode=2
binlog_format = ROW
default_storage_engine=InnoDB
wsrep_cluster_name=pxc-jiangzq
wsrep_sst_auth=sst:jiangzq
wsrep_sst_method=xtrabackup-v2
檢查環(huán)境
[root@c1 xtrabackup]# /etc/init.d/mysql --help
Usage: mysql {start|stop|restart|restart-bootstrap|reload|force-reload|status|bootstrap-pxc} [ MySQL (Percona XtraDB Cluster) options ]
啟動第一個節(jié)點
shell>/etc/init.d/mysql bootstrap-pxc
/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf bootstrap-pxc &
/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf bootstrap-pxc
修改root密碼和添加sst賬戶
alter user user() identified by 'root';
create user 'sst'@'localhost' identified by 'jiangz';
grant all on *.* to 'sst'@'localhost';
將整個虛擬機(jī)再克隆兩個
#####修改主機(jī)名
shell>hostname c2
shell>vi /etc/sysconfig/network
hostname=c2
#####修改ip地址
shell>vi /etc/sysconfig/network-script/ifcfg-eth0
shell>service network restart
#####修改mysql配置文件
shell>vi /etc/my.cnf
server-id=203306
pid-file = c2.pid
wsrep_node_address=192.168.137.202
第2、3個節(jié)點啟動
shell>/etc/init.d/mysql
遇到的錯誤
##############啟動第二個節(jié)點報的錯誤###############
2017-07-18T06:40:24.829678Z 0 [ERROR] WSREP: Failed to read 'ready ' from: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.137.202' --datadir '/data/mysql/mysql3306/data/' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --parent '10520' --binlog '/data/mysql/mysql3306/logs/mysql-bin'
Read: '(null)'
2017-07-18T06:40:24.829714Z 0 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '192.168.137.202'
--datadir '/data/mysql/mysql3306/data/' --defaults-file '/etc/my.cnf' --defaults-group-suffix '' --parent '10520' --binlog '/data/mysql/mysql3306/logs/mysql-bin' :
2 (No such file or directory)
selinux 沒關(guān)和xtrabackup版本太低
日常啟動關(guān)閉
#/etc/init.d/mysql stop
全部節(jié)點關(guān)閉后重啟
第一個節(jié)點啟動的節(jié)點( 如果集群全部關(guān)閉,第一個起動也需要用這樣的形式)
#/etc/init.d/mysql bootstrap-pxc
其它節(jié)點
#/etc/init.d/mysql start
備注:
如集群是不是所有的節(jié)點都關(guān)閉不用使#/etc/init.d/mysql bootstrap-pxc 啟動。都可以用
#/etc/init.d/mysql start
啟動。
到此,關(guān)于“PXC5.7的安裝步驟”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
分享題目:PXC5.7的安裝步驟-創(chuàng)新互聯(lián)
分享地址:http://weahome.cn/article/dsgdip.html