moiot / moha Goto Github PK
View Code? Open in Web Editor NEWMoHA(Mobike High Availability): A MySQL/Postgres high availability supervisor
License: Apache License 2.0
MoHA(Mobike High Availability): A MySQL/Postgres high availability supervisor
License: Apache License 2.0
When make docker-image
is run, gcc:8.0 is started, followed by golang1.11.0, and then mysql:5.7.22 is used to build the final image.
Can we use multi-stage build to simplify?
remove pmm-client and pmm-server dependencies to boost image build
switch.go has different logger lib. Unify the logger libs.
包括但不限于
最新版
N/A
N/A
N/A
N/A
咨询一下,我的理解,当mysql发生主从切换后,agent会把最新的MySQL主从角色与ip地址对应关系写入etcd。haproxy会将写流量转发到最新的mysql主库ip地址去。我的疑惑是,haproxy通过什么机制感知到etcd里的信息变化,并且将变化准确快速地同步到haproxy的配置里去的呢?
麻烦问一下作者,moha必须要在docker下运行吗?能否在物理机上运行,不需要docker依赖的环境
通过查阅相关模块文档,没有看到主从延迟比较大,比如延迟几分钟这样,如果主库发生故障,那么是否切换,如何控制高延迟的是否切换,是否会自动修复数据差异后切换?
意外切换时:增加binlog同步差异判断,如果从库差异binlog event大于阈值,将从库设置成only-flow,并打印日志;如果从库的binlog差异小于规定阈值,优先切换;走后续补偿
根据运维部署文档部署后
主备环境
本地mysql启动映射到docker 本地mysql模拟宕机后 supervise无法自动识别并通知agent转达etcd
mysql-agent.log 日志
2019/07/19 16:24:18.255 agent/server.go:360 [warning] has error when updateBinlogPos. err dial tcp 10.200.46.192:3360: connect: connection refused ignore.
启动docker-compose.yml如下
version: "3.3"
services:
3360_yzcrm:
image: moiot/moha:v2.6.1
network_mode: host
entrypoint: /agent/supervise
volumes:
- /data/mysql3360/3360_yzcrm:/var/lib/mysql:rw
- /etc/3360_config.toml:/agent/config.toml
- /data/mysql3360/3360_agentlog:/agent/log:rw
- /etc/my_3360.cnf:/etc/my_3360.cnf
- /tmp:/tmp
- /data/mysql3360/:/data/mysql3360/
- /etc/localtime:/etc/localtime:ro
container_name: 3360_yzcrm
environment:
MYSQL_DATABASE: yzcrm
MYSQL_PASSWORD: moma
MYSQL_REPLICATION_PASSWORD: repl
MYSQL_REPLICATION_USER: repl
MYSQL_ROOT_PASSWORD: "123456"
MYSQL_USER: moma
MYSQL_SOCKET: /data/log/mysql3360/mysql3360.sock
其余手动切换可以成功
Firstly list the pros and cons of changing package dependency management from Dep to Go Modules.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.