手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

MySQL复制和性能优化

[日期:2011-05-17] 来源:51cto  作者:lyp0909 [字体:大 中 小]

MySQL> change master to

    -> master_host='master.a.com',

    -> master_user='rep',

    -> master_password='RedHat',

    -> master_ssl=1,

    -> master_ssl_ca='/etc/mysql/certs/cacert.pem',

    -> master_ssl_cert='/etc/mysql/certs/slave_cert.pem',

    -> master_ssl_key='/etc/mysql/certs/slave_key.pem';

Query OK, 0 rows affected (0.02 sec)

mysql> start slave;

OK,此时主从服务器之间就可以使用SSL进行会话了。

层级复制:

MySQL

配置一个中继服务器过程:

1 Configure the slave to forward any events executed by the slave thread by writing them to the binlog of the relay slave.

2 Change the storage engine for all tables on the relay slave to use the BLACKHOLE storage engine to preserve space and improve performance

3 Ensure that any new tables added to the relay also use the BLACKHOLE engine

mysql> SET GLOBAL STORAGE_ENGINE = 'BLACKHOLE';

relay> SHOW TABLES FROM mydb;

relay> SET SQL_LOG_BIN = 0;

relay> ALTER TABLE user_data ENGINE = 'BLACKHOLE';

…

…

relay> ALTER TABLE profile ENGINE = 'BLACKHOLE';

relay> SET SQL_BIN_LOG = 1;

linux
相关资讯       MySQL教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款