mysql5.6半同步主从的安装步骤-创新互联
这篇文章主要讲解了“mysql5.6半同步主从的安装步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“mysql5.6半同步主从的安装步骤”吧!
创新互联:于2013年成立为各行业开拓出企业自己的“网站建设”服务,为上1000家公司企业提供了专业的成都网站建设、网站制作、网页设计和网站推广服务, 按需网站开发由设计师亲自精心设计,设计的效果完全按照客户的要求,并适当的提出合理的建议,拥有的视觉效果,策划师分析客户的同行竞争对手,根据客户的实际情况给出合理的网站构架,制作客户同行业具有领先地位的。一 配置完成主从
二 安装和配置插件
1 master:
命令帮助:
mysql> help install
Name: 'INSTALL PLUGIN'
Description:
Syntax:
INSTALL PLUGIN plugin_name SONAME 'shared_library_name'
1) 插件安装:
mysql> install plugin rpl_semi_sync_master SONAME 'semisync_master.so';
Query OK, 0 rows affected (0.88 sec)
mysql> show variables like '%semi%';
+------------------------------------+-------+
| Variable_name | Value |
+------------------------------------+-------+
| rpl_semi_sync_master_enabled | OFF |
| rpl_semi_sync_master_timeout | 10000 | 单位:毫秒,默认为10秒
| rpl_semi_sync_master_trace_level | 32 |
| rpl_semi_sync_master_wait_no_slave | ON |
+------------------------------------+-------+
4 rows in set (0.01 sec)
2) 启动插件和设置参数
mysql> set global rpl_semi_sync_master_enabled=1;
Query OK, 0 rows affected (0.00 sec)
mysql> set global rpl_semi_sync_master_timeout=2000;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%semi%';
+------------------------------------+-------+
| Variable_name | Value |
+------------------------------------+-------+
| rpl_semi_sync_master_enabled | ON |
| rpl_semi_sync_master_timeout | 2000 |
| rpl_semi_sync_master_trace_level | 32 |
| rpl_semi_sync_master_wait_no_slave | ON |
+------------------------------------+-------+
4 rows in set (0.00 sec)
2 slave:
1) 安装插件
mysql> install plugin rpl_semi_sync_slave soname 'semisync_slave.so';
Query OK, 0 rows affected (0.30 sec)
mysql> show variables like '%semi%';
+---------------------------------+-------+
| Variable_name | Value |
+---------------------------------+-------+
| rpl_semi_sync_slave_enabled | OFF |
| rpl_semi_sync_slave_trace_level | 32 |
+---------------------------------+-------+
2 rows in set (0.00 sec)
2) 启动插件
mysql> set global rpl_semi_sync_slave_enabled=1;
Query OK, 0 rows affected (0.00 sec)
mysql> stop slave IO_thread;
Query OK, 0 rows affected (0.82 sec)
mysql> start slave IO_thread;
Query OK, 0 rows affected (0.00 sec)
三 检查配置和验证
mysql> show global status like '%semi%';
+--------------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------------+-------+
| Rpl_semi_sync_master_clients | 1 | 显示半同步的slave的数量
| Rpl_semi_sync_master_net_avg_wait_time | 0 |
| Rpl_semi_sync_master_net_wait_time | 0 |
| Rpl_semi_sync_master_net_waits | 0 |
| Rpl_semi_sync_master_no_times | 0 |
| Rpl_semi_sync_master_no_tx | 0 |
| Rpl_semi_sync_master_status | ON |
| Rpl_semi_sync_master_timefunc_failures | 0 |
| Rpl_semi_sync_master_tx_avg_wait_time | 0 |
| Rpl_semi_sync_master_tx_wait_time | 0 |
| Rpl_semi_sync_master_tx_waits | 0 |
| Rpl_semi_sync_master_wait_pos_backtraverse | 0 |
| Rpl_semi_sync_master_wait_sessions | 0 |
| Rpl_semi_sync_master_yes_tx | 0 |
+--------------------------------------------+-------+
14 rows in set (0.01 sec)
四 卸载插件
mysql> help uninstall
Name: 'UNINSTALL PLUGIN'
Description:
Syntax:
UNINSTALL PLUGIN plugin_name
注意:
一旦某次等待超时,会自动降级为异步;
感谢各位的阅读,以上就是“mysql5.6半同步主从的安装步骤”的内容了,经过本文的学习后,相信大家对mysql5.6半同步主从的安装步骤这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!
网站名称:mysql5.6半同步主从的安装步骤-创新互联
本文网址:http://azwzsj.com/article/ijejg.html