In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the installation steps of PXC5.7". In the daily operation, I believe many people have doubts about the installation steps of PXC5.7. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "installation steps of PXC5.7". Next, please follow the editor to study!
Node assignment
IP
Hostname
Use
192.168.137.201
C1
Node1
192.168.137.202
C2
Node2
192.168.137.203
C3
Node3
The bag you need
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
Install the epel source (all nodes)
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
Install dependency packages
Yum install perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes socat nc-y
Install xtrabackup
Wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.7/binary/redhat/6/x86_64/percona-xtrabackup-24-2.4.7-2.el6.x86_64.rpm
Rpm-ivh percona-xtrabackup-24-2.4.7-2.el6.x86_64.rpm
Database initialization
/ usr/local/mysql/bin/mysqld-defaults-file=/etc/my.cnf-basedir=/usr/local/mysql-datadir=/data/mysql/mysql3306/data-user=mysql-initialize
Modify mysqld_safe startup file
# the specific path to be replaced is queried in the mysqld_safe file according to the name of the installed package #
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.x86x64.ssl101
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
Add parameters related to PXC
Vi / etc/my.cnf
[mysqld]
...
# PXC
Wsrep_provider=/usr/local/mysql/lib/libgalera_smm.so
Wsrep_cluster_address=gcomm://192.168.137.201192.168.137.202192.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
Check the environment
[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]
Start the first node
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
Change root password and add sst account
Alter user user () identified by 'root'
Create user 'sst'@'localhost' identified by' jiangz'
Grant all on *. * to 'sst'@'localhost'
Clone the entire virtual machine two more
# modify hostname
Shell > hostname c2
Shell > vi / etc/sysconfig/network
Hostname=c2
# modify ip address
Shell > vi / etc/sysconfig/network-script/ifcfg-eth0
Shell > service network restart
# modify mysql configuration file
Shell > vi / etc/my.cnf
Server-id=203306
Pid-file = c2.pid
Wsrep_node_address=192.168.137.202
The second and third nodes are started.
Shell > / etc/init.d/mysql
Errors encountered
# error reported by starting the second node #
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 has nothing to do with xtrabackup version is too low
Daily startup and shutdown
# / etc/init.d/mysql stop
Restart after all nodes are shut down
The node started by the first node (if the cluster is all shut down, the first startup also needs to be in this form)
# / etc/init.d/mysql bootstrap-pxc
Other nodes
# / etc/init.d/mysql start
Note:
For example, if all the nodes in the cluster are shut down, there is no need to start # / etc/init.d/mysql bootstrap-pxc. Both can be used.
# / etc/init.d/mysql start
Activate.
At this point, the study on the "installation steps of PXC5.7" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.