Coder Social home page Coder Social logo

docker-mysql-master-slave's Introduction

docker-mysql-master-slave

docker-mysql-master-slave

首先,连接 master ,查找 binlog 文件名称和 pos
master command
show binary logs;
show master status;

第二步,连接 slave ,设置要连接的 master 参数
slave command
CHANGE MASTER TO MASTER_HOST='10.0.75.1',
MASTER_LOG_FILE='mysql-bin.000003',
MASTER_USER='root',
MASTER_PASSWORD='a.123456',
MASTER_LOG_POS=154;

第三步,启动 slave,查看 slave 状态
start slave;
show slave status;

调试命令
debug command
slave command; stop slave;
reset slave;

note:
连接命令只有第一次启动需要输入
mysql 5.7 版本 8.0版本都可用
relay_log 有文章说需要这个参数我就加上了 mysql-origin 作为多级别主从,log_slave_updates=1 配置已经加上 数据流向 origin -> master -> slave, master->slave

log:
master 关闭重启后,slave 连接一直等待中,4次自动连接后,再次连接上 master

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.