zoukankan      html  css  js  c++  java
  • mysql du-master配置

    db-server1 my.cnf

    log_bin = mysql-bin
    binlog_format = mixed
    server_id = 1

    read-only = 0
    #binlog-do-db = db_name
    #binlog-ignore-db = mysql
    auto_increment_increment=2
    auto_increment offset=1

    #replicate-do-db = db_name
    #replicate-ignore-db = mysql
    relay_log = mysqld-relay-bin
    log-slave-updates = ON

    db-server2 my.cnf

    log_bin = mysql-bin
    binlog_format = mixed
    server_id = 2

    read-only = 0
    auto_increment_increment=2
    auto_increment offset=1

    relay_log = mysqld-relay-bin
    log-slave-updates = ON

    新配置的话,开启复制步骤:
    1) server1上执行,show master statusG,记下binlog名字和位置
    2) server2上执行:
    change master to
    master_host='x.x.x.x',
    master_port=3306,
    master_user='xxx',
    master_password='xxx',
    master_log_file='log.xxxxxx',
    master_log_pos=xxx;
    代入步骤1记下的内容
    3) server2上执行 start slave;
    4)反过来再做一遍,从server2上show master statusG 。。。直到在server1上执行 start slave;
    5)检查,两边都执行show slave statusG 看看有没有错误信息,没就成功了

  • 相关阅读:
    第七章
    第五章
    第六章
    Git使用入门
    源代码的下载和编译
    向中国最牛的前端群-鬼群致敬
    Normalize.css做了哪些事情--看代码
    谷歌浏览器:书签被误删了怎么办
    2013/8月读书计划
    Limu:JavaScript的那些书
  • 原文地址:https://www.cnblogs.com/zxpo/p/3780165.html
Copyright © 2011-2022 走看看