首页 > 数据库 >mysql5.1.73 双主的玩法

mysql5.1.73 双主的玩法

时间:2023-01-09 19:34:12浏览次数:38  
标签:2M buffer cache mysql5.1 73 mysql MASTER 双主 size

A机:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer_size = 384M
max_allowed_packet = 128M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8log-bin=mysql-bin
binlog-do-db=t_test
server-id = 1
auto-increment-increment=2
auto-increment-offset=1
log-slave-updates[mysqldump]
quick
max_allowed_packet = 128M [mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M[mysqlhotcopy]
interactive-timeout
B机:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock# Here follows entries for some specific programs
server_id=2
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer_size = 384M
max_allowed_packet = 128M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
server_id=2# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8# binary logging is required for replication
log-bin=mysql-bin
binlog-do-db=t_test ----指定数据库名称
server-id = 2
auto-increment-increment=2
auto-increment-offset=2
log-slave-updates[mysqldump]
quick
max_allowed_packet = 128M[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M[mysqlhotcopy]
interactive-timeout
--------------------------------------A机先搞一下
GRANT REPLICATION SLAVE ON *.* TO 'root' @'%' IDENTIFIED BY '';
mysql> flush privileges;
mysql> show master status;
记录下position的值
B机也搞一下
GRANT REPLICATION SLAVE ON *.* TO 'root' @'%' IDENTIFIED BY '';
mysql> flush privileges;
mysql> show master status;
也记录position的值
然后
A 机B机相互授权
B机
CHANGE MASTER TO MASTER_HOST='172.16.108.71',MASTER_USER='root',MASTER_PASSWORD='',MASTER_LOG_FILE='mysql-bin.000005',MASTER_LOG_POS=235;
START SLAVE;
A机
CHANGE MASTER TO MASTER_HOST='172.16.108.72',MASTER_USER='root',MASTER_PASSWORD='',MASTER_LOG_FILE='mysql-bin.000011',MASTER_LOG_POS=430;
START SLAVE;

然后测试增删改查

标签:2M,buffer,cache,mysql5.1,73,mysql,MASTER,双主,size
From: https://blog.51cto.com/u_14650780/5998741

相关文章

  • 华硕X99-e ws Xeon 2673v3 电脑 Hackintosh 黑苹果efi引导文件
    硬件型号驱动情况主板华硕X99-ews处理器Xeon2673v3已驱动内存8GB/16GBLPDDR3已驱动硬盘西数WDBlueSN570500GBSSD(500GB/固态硬盘)已驱动显卡5700XT  8gb已......
  • P1073 [NOIP2009 提高组] 最优贸易 分层图
    //题意:给出有向图,有环(SCC),每个节点有一个商品值,小明想从1点走向n点,同时想要进行一次贸易,即从路线上某个点买入商品,又在某个节点卖出,询问最大收益是多少(如果收益为负数......
  • P1073 [NOIP2009 提高组] 最优贸易 强联通分量+缩点
    //题意:给出有向图,有环(SCC),每个节点有一个商品值,小明想从1点走向n点,同时想要进行一次贸易,即从路线上某个点买入商品,又在某个节点卖出,询问最大收益是多少(如果收益为负数......
  • CodeForces - 1730B Meeting on the Line
    CodeForces-1730BMeetingontheLine题解:思维,找货舱位置/二分答案首先直接来引理,假设现在一个数轴上有许多点,那么一个点到这些点距离最短之和的点肯定在数轴最左端......
  • 【优先队列】LeetCode 973. 最接近原点的 K 个点
    题目链接973.最接近原点的K个点思路使用优先队列处理前k大问题代码classSolution{classNode{intx;inty;doubledistance;......
  • 搭建MyCat2双主双从的MySQL读写分离
    一、MySQL双主双从一个主机m1用于处理所有写请求,它的从机s1和另一台主机m2还有它的从机s2负责所有读请求。当m1主机宕机后,m2主机负责写请求,m1、m2互为备机。......
  • P8773 题解
    前言题目传送门!更好的阅读体验?一道有趣的题目。思路对于一个数\(a_i\),如果有\(a_i\oplust=x\),显然\(t=a_i\oplusx\)。设\(loc_i\)表示上一个\(t\)出......
  • 【集合】LeetCode 73. 矩阵置零
    题目链接73.矩阵置零思路1遍历矩阵,分别使用集合row和column记录值为0的行和列。最后将row和column所记录的行和列置为零。空间复杂度:\(O(m+n)\)代码1cla......
  • 『中级篇』docker之CI/CD持续集成—真实JAVA-Maven项目的CI演示(73)
    ICD。项目通过gitlab和gitlabCI进行CICD。源码地址:​​​https://github.com/limingios/gitlabci-maven​​​源码:​​https://github.com/limingios/docker/tree/master/......
  • MySQL 高可用性之Keepalived+Mysql(双主热备)
    MySQL高可用性之Keepalived+Mysql(双主热备)环境描述:OS:CentOS6.5_X64MASTER:192.168.0.202BACKUP:192.168.0.203VIP:192.168.0.2041.配置两台MySQL主主同步1.1安装......