Git Product home page Git Product logo

mysql-slave-deploy's Introduction

手工部署MySQL从库

使用说明

  1. 确认主实例开启binlog

  2. 按照现有的pod 创建新的slave pod , 注意参数一致

  3. 使用一致备份初始化slave 实例

    名字类似 XXX.consistent.dump.gz

  4. 在主实例创建同步用户

    set sql_log_bin=off; 
    create user user@'%' identified by 'password';
    grant replication slave on *.* to user@'%';		
  5. slave 初始化完成,执行change master

        CHANGE MASTER TO
        MASTER_HOST='XXXX',
        MASTER_USER='user',
        MASTER_PASSWORD='password',
        MASTER_PORT=port,
        MASTER_LOG_FILE='mysql-master-bin.000002', MASTER_LOG_POS=120,
        MASTER_CONNECT_RETRY=10;

脚本说明

myslave.sh : 生成主从的concifgmap文件,直接不带参数执行脚本获取帮助

doslave.sh : 生成deployment yaml文件,直接不带参数执行脚本获取帮助

my.secret : slave实例使用的密码文件,注意修改root密码

slave-error-restart目录下的文件是自动启动mysql失败的slave用的

mysql-slave-deploy's People

Contributors

nanjiyueguang avatar

Watchers

James Cloos avatar  avatar

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.