mysql主从服务器搭建配置

主服务器的(db1)配置

●my.cnf设置

[mysqld]
default-character-set=utf8
skip-character-set-client-handshake
default-table-type=InnoDB
wait_timeout=31536000
interactive_timeout=31536000

max_connections = 3000
innodb_buffer_pool_size = 512M
innodb_additional_mem_pool_size = 20M
innodb_log_buffer_size = 128M
innodb_log_file_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
join_buffer_size = 256K
read_buffer_size = 2M
key_buffer_size = 1M
myisam_sort_buffer_size = 2M
table_open_cache = 1024
tmp_table_size = 16M

# Master/Slave
server-id = 1
log-bin = master-mysql-bin
binlog-do-db = mmy_production
binlog-do-db = ah_production

 

从服务器的配置
●my.cnf设置

[mysqld]
default-character-set=utf8
skip-character-set-client-handshake
default-table-type=InnoDB
wait_timeout=31536000
interactive_timeout=31536000

max_connections=300
innodb_buffer_pool_size = 512M
innodb_additional_mem_pool_size = 20M
innodb_log_buffer_size = 16M
innodb_log_file_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 8M
join_buffer_size = 256K
read_buffer_size = 2M
key_buffer_size = 1M
myisam_sort_buffer_size = 1M

# Master/Slave
server-id = 2
master-host=db1
master-user=replication
master-password=replication
master-port=3306
master-connect-retry=60
replicate-do-db = mmy_production
replicate-do_db = ah_production

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值