Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration method of mysql5.6 Master-Slave Environment in Linux centos5.6 version

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "mysql5.6 master-slave environment installation configuration method under Linux centos5.6 version", the explanation content in the article is simple and clear, easy to learn and understand, please follow the idea of Xiaobian slowly, study and learn "mysql5.6 master-slave environment installation configuration method under Linux centos5.6 version" together!

Server configuration, specific iP, master-slave library is as follows

IP: 192.168.1.189 master server IP: 192.168.1.188 slave server

The server system is: centos 5.6. Download and install the software package as follows

MySQL-client-5.6.13-1.linux_glibc2.5.x86_64.rpmMySQL-devel-5.6.13-1.linux_glibc2.5.x86_64.rpmMySQL-server-5.6.13-1.linux_glibc2.5.x86_64.rpmMySQL-shared-5.6.13-1.linux_glibc2.5.x86_64.rpmMySQL-shared-compat-5.6.13-1.linux_glibc2.5.x86_64.rpmMySQL-test-5.6.13-1.linux_glibc2.5.x86_64.rpm

Install mysql, install all required rpm files through yum command

yum -y install libaio libaio-devel perl-Time-HiRes curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel perl-ExtUtils-MakeMaker perl-DBD-MySQLrpm -ivh MySQL-test-5.6.13-1.linux_glibc2.5.x86_64.rpmrpm -ivh MySQL-shared-5.6.13-1.linux_glibc2.5.x86_64.rpm rpm -ivh MySQL-shared-compat-5.6.13-1.linux_glibc2.5.x86_64.rpm rpm -ivh MySQL-server-5.6.13-1.linux_glibc2.5.x86_64.rpm rpm -ivh MySQL-devel-5.6.13-1.linux_glibc2.5.x86_64.rpm rpm -ivh MySQL-client-5.6.13-1.linux_glibc2.5.x86_64.rpm

Second, modify the master and slave configuration, note that some parameters should be adjusted according to the actual situation, the specific steps are as follows

Main library/etc/my.cnf Configuration:

[client]port = 3306socket = /state/partition1/mysql/mysql.sockdefault-character-set=utf8[mysqld]server-id=1025log-bin=mysql-master-binbinlog_format = mixedexpire_logs_days=15max_connections=1000innodb_flush_log_at_trx_commit=1sync_binlog=1binlog-do-db=denovo_ngbinlog-ignore-db=mysql,test,information_schemainnodb_buffer_pool_size = 46673Mskip-name-resolvedatadir = /state/partition1/mysql/dataport = 3306socket = /state/partition1/mysql/mysql.sockkey_buffer_size=16Mmax_allowed_packet=16Mjoin_buffer_size = 512Msort_buffer_size = 256Mread_rnd_buffer_size = 128M innodb_buffer_pool_size = 40960Msql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

From the library/etc/my.cnf configuration, the specific code is as follows

[client]port = 3306socket = /state/partition1/mysql/mysql.sock[mysqld]server-id=1052datadir = /state/partition1/mysql/dataport = 3306socket = /state/partition1/mysql/mysql.sockuser=mysqllog-bin=mysql-slave-binmax_binlog_size=1000Mbinlog_format = mixedexpire_logs_days=7innodb_flush_log_at_trx_commit=1sync_binlog=1read_only=1binlog-do-db=denovo_ngbinlog-ignore-db=mysql,test,information_schemainnodb_buffer_pool_size = 36673Mskip-name-resolvemax_connections=1000max_user_connections=490max_connect_errors=2key_buffer_size=16Mmax_allowed_packet=16Mjoin_buffer_size = 512Msort_buffer_size = 256Mread_rnd_buffer_size = 128M innodb_buffer_pool_size = 40960Msql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

III. Authorize the account number of master and slave library:

master library

grant replication slave on *.* to 'jpsync'@'192.168.1.189' identified by 'jppasswd';flush privileges;show master status; #View master library info

from the library

stop slave;change master to master_host='192.168.1.188',master_port=3306,master_user='jpsync',master_password='jppasswd', master_log_file='mysql-master-bin.000003',master_log_pos=408; start slave;show slave status\G;

if there is

Slave_IO_Running: YesSlave_SQL_Running: Yes

This indicates that mysql master-slave library succeeded.

Thank you for reading, the above is "Linux centos5.6 version mysql5.6 master-slave environment installation configuration method" content, after learning this article, I believe that everyone on Linux centos5.6 version mysql5.6 master-slave environment installation configuration method this problem has a deeper understanding, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report