Install Deployment Phxsql

Source: Internet
Author: User
Tags deprecated percona rsync

。 Requirements: A company software use Phxsql has been deployed in 3 room, now need to add a Phxsql node in the new room, the following is the operation process, because the protection of privacy of 4 IP

1.1.1.1

2.2.2.2

3.3.3.3

The new IP is 4.4.4.4


。 Install Phxsql requires Python2.7 version, CentOS defaults to 2.6 version, need to upgrade

Cd/optwget--no-check-certificate Https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xztar XF PYTHON-2.7.6.TAR.XZCD python-2.7.6./configure--prefix=/usr/localmake && make install


。 Phxsql need to upgrade GLIBC package, Centos6.5 default to 2.12, upgrade to 2.20 version. Because Glic is the operating system underlying library, it is prudent to operate

Glibc-common-2.12-1.149.el6_6.5.x86_64glibc-2.12-1.149.el6_6.5.i686glibc-2.12-1.149.el6_6.5.x86_ 64glibc-headers-2.12-1.149.el6_6.5.x86_64glibc-devel-2.12-1.149.el6_6.5.x86_64

Upgrade action

RPM-UVH--aid--force--nodeps glibc-headers-2.20-8.fc21.x86_64.rpmrpm-uvh--aid--force--nodeps GLIBC-DEVEL-2.20-8.FC21.X86_64.RPMRPM-UVH--aid--force--nodeps GLIBC-2.20-8.FC21.X86_64.RPMRPM-UVH--aid--force-- Nodeps glibc-common-2.20-8.fc21.x86_64.rpm


。 Four PHXSQL nodes of the server, the firewall needs to open the following several ports

Iptables-a input-p tcp-m multiport--dports 11111,54321,54322-s 4.4.4.4-j ACCEPT


。 At any node in the Phxsql cluster, add the new node IP to the cluster when the new node has not started to install the deployment Phxsql

Phxbinlogsvr_tools_phxrpc-f addmember-h1.1.1.1-p17000-m 4.4.4.4

After adding, use the command line to check

Phxbinlogsvr_tools_phxrpc-f getmemberlist-h1.1.1.1-p 17000

。 Set the Phxsql Data directory, the official website tutorial definition directory for/tmp/data, this is changed to/data1/

Cd/data1/phxsql/tools/mkdir-p/data1/phxsql/tmp/data/logchown-r mysql:mysql/data1/phxsql/tmp/data/logpython2.7 Install.py-i "4.4.4.4"-P 54321-g 6000-y 11111-p 17000-a 8001-f/data1/phxsql/tmp/data/

The installation process will appear with the following information

Namespace (agent_port=6000, base_dir= '/data1/phxsql/',  data_dir= '/data1/phxsql/tmp/data/',  inner _ip= ' 183.36.122.100 ',  ip_list= ' 4.4.4.4 ',  module_name= ' test ',  mysql_port=11111, paxos_port= 8001, phxbinlogsvr_port=17000, phxsqlproxy_port=54321, process_name= ' All ',  skip_data=0) kill all binaries success....mkdir: cannot create directory  '/data1/phxsql/ Etc ': file existsgenerate all configs success....mkdir: cannot create  directory  '/data1/phxsql/tmp/data/log ':  file exists/data1/phxsql/tmp/data/phxbinlogsvrskip  data 0mkdir: cannot create directory  '/data1/phxsql/tmp/data/log ':  file  exists/data1/phxsql/tmp/data/percona.workspacecd /data1/phxsql/percona.src; ./scripts/mysql_ install_db --defaults-file=/data1/phxsql/etc/my.cnf --user=mysqlwarning: the host  ' CentOS '  could nOt be looked up with /data1/phxsql/percona.src/bin/resolveip. this probably means that your libc libraries are not 100 %  compatiblewith this binary MySQL version. The MySQL daemon,  mysqld, should worknormally with the exception that host name  Resolving will not work. this means that you should use ip addresses instead of  hostnameswhen specifying mysql privileges ! Installing mysql system tables ... 2017-05-04 04:07:27 0 [warning]  ' thread_concurrency '  is deprecated and  will be removed in a future release.2017-05-04 04:07:27 0 [ note] ./bin/mysqld  (Mysqld 5.6.31-77.0-log)  starting as process 55454  ... okfilling&Nbsp;help tables ... 2017-05-04 04:07:32 0 [warning]  ' thread_concurrency '  is deprecated and  will be removed in a future release.2017-05-04 04:07:32 0 [ note] ./bin/mysqld  (Mysqld 5.6.31-77.0-log)  starting as process 55496  ... okto start mysqld at boot time you have to copysupport-files/ Mysql.server to the right place for your systemplease remember to  set a password for the mysql root user ! to do so, start the server, then issue the following  commands:  /data1/phxsql/percona.src/bin/mysqladmin -u root password  ' New-password '   /data1/phxsql/percona.src/bin/mysqladmin -u root -h centos  password  ' New-password ' AlternAtively you can run:  /data1/phxsql/percona.src/bin/mysql_secure_installationwhich  will also give you the option of removing the testdatabases  and anonymous user created by default.  This isstrongly  Recommended for production servers. See the manual for more instructions. you can start the mysql daemon with:  cd . ; /data1/ Phxsql/percona.src/bin/mysqld_safe &you can test the mysql daemon with  mysql-test-run.pl  cd mysql-test ; perl mysql-test-run.plPlease  Report any problems at https://bugs.launchpad.net/percona-server/+filebugthe latest  information about percona server is available on the web at   http://www.percona.com/software/percona-serversupport percona by buying support at http:// www.percona.com/products/mysql-supportinstall all success....nohup: appending output  to  ' nohup.out ' nohup: appending output to  ' nohup.out ' Warning: logging before  initgooglelogging ()  is written to STDERRW0504 04:07:39.378021 55555  phx_glog.cpp:74] getdefaultpath get debuf path /data1/phxsql/etc/w0504  04:07:39.385524 55555 phx_glog.cpp:74] realreadfile  read path /data1/ Phxsql/etc/phxsqlproxy.conf donew0504 04:07:39.385609 55555 phx_glog.cpp:74] read  plugin config []w0504 04:07:39.385701 55555 phx_glog.cpp:74] realreadfile   read path /data1/phxsql/etc/phxsqlproxy.conf doneW0504 04:07:39.385752  55555 phx_glog.cpp:74] read plugin config []start master worker finished ...start slave  worker finished ...init pid 55580 env 0x7f77780008c0init pid 55582  env 0x7f777c0008c0init pid 55583 env 0x7f77700008c0init pid 55585  env 0x7f77800008c0init pid 55586 env 0x7f77740008c0init pid 55587  env 0x7f77840008c0init pid 55588 env 0x7f77780008c0init pid 55589  env 0x7f777c0008c0init pid 55592 env 0x7f77680008c0init pid 55593  env 0x7f776c0008c0init pid 55598 env 0x7f77700008c0init pid 55602  env 0x7f77680008c0init pid 55600 env 0x7f77600008c0init pid 55608  env 0x7f77640008c0init pid 55605 env 0x7f77600008c0


。 If the installation succeeds, the following 3 processes will start

Ps-ef|grep-v grep | grep phxsqlproxy

Ps-ef|grep-v grep | grep MySQL

Ps-ef|grep-v grep | grep phxbinlogsvr

Occasionally phxbinlogsvr won't start, but it doesn't matter, because if PHXBINLOGSVR starts, it needs to be killed.

Killall-9 PHXBINLOGSVR_PHXRPC


。 Adding environment variables

Vi/etc/profileexport Path=/data1/phxsql/sbin: $PATH. /etc/profile


。 Phxsql installed, is currently empty, need to from a data node to the data, usually choose from the point, through the command query which is master, and then avoid master, my side of the data is 200G, for exporting a large amount of data will be very expensive disk resources, You need to switch your business to another point.

Phxbinlogsvr_tools_phxrpc-f getmemberlist-h1.1.1.1-p 17000

。 Using mysqldump to export the data, you need to add a--quick parameter, in order to export the data without the buffer pool, but directly from the disk, and then save to the file, we recommend the use of script, to know how much time the derivative. Note that the total data--all-database is exported because the data volume of all the nodes under Phxsql is consistent, which is equivalent to multi-point redundancy

function Output_data () {start_date=$ (date +%s)/data1/phxsql/percona.src/bin/mysqldump--quick-uroot-s/data1/phx Sql/tmp/data/percona.workspace/tmp/percona.sock--all-databases > Phxsql.alldata end_date=$ (date +%s) backup_time =$ (($end _date-$start _date) echo "Export Time:" ${backup_time} "Seconds"}

200G data, export file 67G, about 3 times times the compression, altogether 2,393 seconds, the average 11 seconds can be exported 1G


。 There has been a confusion, iostat occupancy and load in the end of the threshold is how much, do not need to cut business? Is it necessary to move the business when it comes to derivatives?

avg-cpu:  %user   %nice %system %iowait  %steal    %idle           2.31    0.00     1.13    1.76    0.00   94.79device:          rrqm/s   wrqm/s      r/s     w/s   rsec/s   wsec/s avgrq-sz  avgqu-sz   await r_await w_await  svctm  %utilsda                0.00      0.00    0.00    1.00     0.00      8.00     8.00     0.00     3.00    0.00    3.00   3.00   0.30sdb                0.00   117.00  2048.00  362.00 65536.00  3832.00    28.78      0.67    0.28    0.23    0.56    0.23  56.40


。 After the data is sent out, use rsync to transfer to a server in another room

Rsync-av--port=8732--password-file=/home/lijunda/rsyncd_ccopy_passwd1--progress [email protected]::item/data1/ phxsql.alldata/data1/receiving Incremental file Listphxsql.alldata 30137810944 42% 113.03mb/s 0:05:52


。 In the new computer room DB import data, Phxsql no matter which node writes the data, will be routed through the proxy to the main library for writing, and now to import data from the library, you need to stop the read-only function

Mysql-uroot-s/data1/phxsql/tmp/data/percona.workspace/tmp/percona.sock-e "set global super_read_only=off; Set global Read_only=off;reset master; "; Mysql-uroot-s/data1/phxsql/tmp/data/percona.workspace/tmp/percona.sock < Phxsql.alldata





This article is from the "DBA Operations Summary" blog, reproduced please contact the author!

Install Deployment Phxsql

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.