GithubHelp home page GithubHelp logo

mysql-ha's Introduction

mysql 主从配置方案,使用 docker swarm 集群部署#####

   docker stack deploy -c docker-compose.yml mysqls

其他配置

当集群启动过后, 使用此配置slave 链接master

# 重新设置连接master节点
reset slave;

# 设置连接master
change master to 
    master_host='master',  # 主库的IP,因为使用了docker隔离机制,所以将其放入同一个网络内,使用服务名来当主机名
	master_user='root',    # 主库同步的用户
	master_password='123456', # 密码
	master_port=3306, # 主库的端口
	master_log_file='mysql-bin.000003', # 同步的文件 通过show master status来获取
	master_log_pos=321; # 开始从第几行同步 通过show master status来获取
	
# 启动同步
start slave;

# 查看master状态
show slave status;
————————————————

mysql-ha's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bruce20091128

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.