1 月 222015
 

之前其实写过一篇文章的后来丢失了,算作补写,其实我在六间房也遇到过异地机房数据库同步的问题。本来打算做vlan处理,后来发现一个可以实现的方法就是通过ssl 去 同步数据库。

其实就是在主库配置下ssl。然后在备库同步的时候加个MASTER_SSL=1,,譬如

mysql> CHANGE MASTER TO
    -> MASTER_HOST=’172.16.21.1′,
    -> MASTER_USER=’repl’,
    -> MASTER_PASSWORD=’123456′,
    -> MASTER_SSL=1,
    -> MASTER_SSL_CA = ‘/etc/pki/CA/cacert.pem’,
    -> MASTER_SSL_CAPATH = ‘/etc/pki/CA’,
    -> MASTER_SSL_CERT = ‘/usr/local/mysql/ssl/master.crt’,
    -> MASTER_SSL_KEY = ‘/usr/local/mysql/ssl/master.key’;

即可。

还有我在维护的时候遇到了一个error 1032的问题。后来查明的主要原因是备库的数据库也有写的操作,所以造成了这种现象。主要是说查问题的思路。通过mysqlbinlog去查出错的问题。后续还会补上一个参考url的。

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny