Docker에서 signal18/replication-manager를 움직여보세요
Amazon Linux2
Docker, docker-compose 설치됨
signal18/replication-manager:2.1
MariaDB 10.4.10
Maxscale 2.2.5
준비
$ git clone https://github.com/aleks-v-k/mariadb-ha.git
변경할 파일
docker-compose.yml, maxscale.cnf, config.toml
/mariadb-ha-test
|--docker-compose.yml
|--maxscale
| |--maxscale.cnf
|--replication-manager
| |--config.toml
파일 내용을 다음 내용으로 변경
docker-compose.ymlversion: "2.4"
services:
replicationmanager:
image: signal18/replication-manager:2.1
command: ["replication-manager", "monitor", "--config", "/etc/replication-manager/config/config.toml", "--verbose"]
volumes:
- ./replication-manager:/etc/replication-manager/config
ports:
- "10001:10001"
- "10005:10005"
depends_on:
- setup_a
maxscale:
image: asosso/maxscale:2.2.5
volumes:
- ./maxscale:/etc/maxscale.d
ports:
- "4006:4006"
- "6603:6603"
depends_on:
- replicationmanager
setup_a:
image: mariadb:10.4.10
restart: "no"
entrypoint: ""
command: "/setup/setup.sh cluster_a foo.bar mariadb_a1 mariadb_a2 mariadb_a3"
volumes:
- ./setup:/setup
depends_on:
# Docker stack deploy healthcheck in V3 docker-compose.yml not working in CoreOS Alpha 1339.0.0 #1848
# https://github.com/coreos/bugs/issues/1848
# Can this work with v3 of docker compose? #3
# https://github.com/peter-evans/docker-compose-healthcheck/issues/3
mariadb_a1: { condition: service_healthy }
mariadb_a2: { condition: service_healthy }
mariadb_a3: { condition: service_healthy }
mariadb_a1:
image: mariadb:10.4.10
command: ["mysqld", "--server-id=11", "--gtid-domain-id=10"]
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- ./mariadb:/etc/mysql/conf.d
healthcheck:
test: "mysqladmin -h 127.0.0.1 status || exit 1"
interval: "5s"
timeout: "1s"
retries: 10
mariadb_a2:
image: mariadb:10.4.10
command: ["mysqld", "--server-id=12", "--gtid-domain-id=10"]
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- ./mariadb:/etc/mysql/conf.d
healthcheck:
test: "mysqladmin -h 127.0.0.1 status || exit 1"
interval: "5s"
timeout: "1s"
retries: 10
mariadb_a3:
image: mariadb:10.4.10
command: ["mysqld", "--server-id=13", "--gtid-domain-id=10"]
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- ./mariadb:/etc/mysql/conf.d
healthcheck:
test: "mysqladmin -h 127.0.0.1 status || exit 1"
interval: "5s"
timeout: "1s"
retries: 10
maxscale/maxscale.cnf[MaxScale]
log_warning = 1
log_info = 1
log_notice = 1
log_debug = 1
admin_host=0.0.0.0
[MaxAdmin]
type=service
router=cli
[MaxAdmin-Unix-Listener]
type=listener
service=MaxAdmin
protocol=maxscaled
socket=default
[MaxAdmin-Inet-Listener]
type=listener
service=MaxAdmin
protocol=maxscaled
address=0.0.0.0
port=6603
[Cluster-A-Router]
type=service
router=readwritesplit
servers=mariadb_a1,mariadb_a2,mariadb_a3
weightby=serv_weight
master_failure_mode=fail_on_write
max_slave_replication_lag=2
user=maxscale
password=maxscale
enable_root_user=true
[Cluster-A-Listener]
type=listener
service=Cluster-A-Router
protocol=mariadbclient
address=0.0.0.0
port=4006
[Cluster-A-Monitor]
type=monitor
module=mariadbmon
servers=mariadb_a1,mariadb_a2,mariadb_a3
user=replmon
passwd=replmon
monitor_interval=500
backend_write_timeout=1
detect_stale_master=true
[mariadb_a1]
type=server
protocol=mariadbbackend
address=mariadb_a1
port=3306
serv_weight=1
[mariadb_a2]
type=server
protocol=mariadbbackend
address=mariadb_a2
port=3306
serv_weight=1
[mariadb_a3]
type=server
protocol=mariadbbackend
address=mariadb_a3
port=3306
serv_weight=1
replication-manager/config.toml[Default]
http-server = true
http-bind-address = "0.0.0.0"
http-auth = false
api-credential = "admin:admin"
log-level = 2
verbose = 1
[cluster_a]
title = "Cluster-A"
db-servers-hosts = "mariadb_a1,mariadb_a2,mariadb_a3"
db-servers-credential = "replmon:replmon"
replication-credential = "replicator:replicator"
replication-source-name = "cluster_a"
failover-mode = "automatic"
failover-limit = 3
failover-time-limit = 10
failover-at-sync = false
failover-max-slave-delay = 1
failover-falsepositive-heartbeat = false
failover-falsepositive-heartbeat-timeout = 1
failover-falsepositive-ping-counter = 1
failover-falsepositive-maxscale = true
failover-falsepositive-maxscale-timeout = 2
maxscale = true
maxscale-servers = "maxscale"
maxscale-port = "6603"
maxscale-user = "admin"
maxscale-pass = "mariadb"
maxscale-read-port = "4006"
maxscale-write-port = "4006"
maxscale-read-write-port = "4006"
시작
$ docker-compose up -d
동작 확인
브라우저 시작
http://localhost:10001 방문
admin/admin으로 로그인
DASHBOARD
ALERTS
PROXIES
SETTINGS
SHARDS
도전
Maxscale 2.3.x 및 2.4.x의 경우 다음 화면의 표시가 다음과 같습니다.
아직 대응하지 않았을 가능성이 있습니다.
ALERTS
PROXIES
참고 URL
signal18/replication-manager
DockerHub의 공개 이미지
MariaDB HA Test
Reference
이 문제에 관하여(Docker에서 signal18/replication-manager를 움직여보세요), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/rururu_kenken/items/21ef04ec0c655fc9bfcb
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
$ git clone https://github.com/aleks-v-k/mariadb-ha.git
docker-compose.yml, maxscale.cnf, config.toml
/mariadb-ha-test
|--docker-compose.yml
|--maxscale
| |--maxscale.cnf
|--replication-manager
| |--config.toml
파일 내용을 다음 내용으로 변경
docker-compose.yml
version: "2.4"
services:
replicationmanager:
image: signal18/replication-manager:2.1
command: ["replication-manager", "monitor", "--config", "/etc/replication-manager/config/config.toml", "--verbose"]
volumes:
- ./replication-manager:/etc/replication-manager/config
ports:
- "10001:10001"
- "10005:10005"
depends_on:
- setup_a
maxscale:
image: asosso/maxscale:2.2.5
volumes:
- ./maxscale:/etc/maxscale.d
ports:
- "4006:4006"
- "6603:6603"
depends_on:
- replicationmanager
setup_a:
image: mariadb:10.4.10
restart: "no"
entrypoint: ""
command: "/setup/setup.sh cluster_a foo.bar mariadb_a1 mariadb_a2 mariadb_a3"
volumes:
- ./setup:/setup
depends_on:
# Docker stack deploy healthcheck in V3 docker-compose.yml not working in CoreOS Alpha 1339.0.0 #1848
# https://github.com/coreos/bugs/issues/1848
# Can this work with v3 of docker compose? #3
# https://github.com/peter-evans/docker-compose-healthcheck/issues/3
mariadb_a1: { condition: service_healthy }
mariadb_a2: { condition: service_healthy }
mariadb_a3: { condition: service_healthy }
mariadb_a1:
image: mariadb:10.4.10
command: ["mysqld", "--server-id=11", "--gtid-domain-id=10"]
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- ./mariadb:/etc/mysql/conf.d
healthcheck:
test: "mysqladmin -h 127.0.0.1 status || exit 1"
interval: "5s"
timeout: "1s"
retries: 10
mariadb_a2:
image: mariadb:10.4.10
command: ["mysqld", "--server-id=12", "--gtid-domain-id=10"]
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- ./mariadb:/etc/mysql/conf.d
healthcheck:
test: "mysqladmin -h 127.0.0.1 status || exit 1"
interval: "5s"
timeout: "1s"
retries: 10
mariadb_a3:
image: mariadb:10.4.10
command: ["mysqld", "--server-id=13", "--gtid-domain-id=10"]
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
volumes:
- ./mariadb:/etc/mysql/conf.d
healthcheck:
test: "mysqladmin -h 127.0.0.1 status || exit 1"
interval: "5s"
timeout: "1s"
retries: 10
maxscale/maxscale.cnf
[MaxScale]
log_warning = 1
log_info = 1
log_notice = 1
log_debug = 1
admin_host=0.0.0.0
[MaxAdmin]
type=service
router=cli
[MaxAdmin-Unix-Listener]
type=listener
service=MaxAdmin
protocol=maxscaled
socket=default
[MaxAdmin-Inet-Listener]
type=listener
service=MaxAdmin
protocol=maxscaled
address=0.0.0.0
port=6603
[Cluster-A-Router]
type=service
router=readwritesplit
servers=mariadb_a1,mariadb_a2,mariadb_a3
weightby=serv_weight
master_failure_mode=fail_on_write
max_slave_replication_lag=2
user=maxscale
password=maxscale
enable_root_user=true
[Cluster-A-Listener]
type=listener
service=Cluster-A-Router
protocol=mariadbclient
address=0.0.0.0
port=4006
[Cluster-A-Monitor]
type=monitor
module=mariadbmon
servers=mariadb_a1,mariadb_a2,mariadb_a3
user=replmon
passwd=replmon
monitor_interval=500
backend_write_timeout=1
detect_stale_master=true
[mariadb_a1]
type=server
protocol=mariadbbackend
address=mariadb_a1
port=3306
serv_weight=1
[mariadb_a2]
type=server
protocol=mariadbbackend
address=mariadb_a2
port=3306
serv_weight=1
[mariadb_a3]
type=server
protocol=mariadbbackend
address=mariadb_a3
port=3306
serv_weight=1
replication-manager/config.toml
[Default]
http-server = true
http-bind-address = "0.0.0.0"
http-auth = false
api-credential = "admin:admin"
log-level = 2
verbose = 1
[cluster_a]
title = "Cluster-A"
db-servers-hosts = "mariadb_a1,mariadb_a2,mariadb_a3"
db-servers-credential = "replmon:replmon"
replication-credential = "replicator:replicator"
replication-source-name = "cluster_a"
failover-mode = "automatic"
failover-limit = 3
failover-time-limit = 10
failover-at-sync = false
failover-max-slave-delay = 1
failover-falsepositive-heartbeat = false
failover-falsepositive-heartbeat-timeout = 1
failover-falsepositive-ping-counter = 1
failover-falsepositive-maxscale = true
failover-falsepositive-maxscale-timeout = 2
maxscale = true
maxscale-servers = "maxscale"
maxscale-port = "6603"
maxscale-user = "admin"
maxscale-pass = "mariadb"
maxscale-read-port = "4006"
maxscale-write-port = "4006"
maxscale-read-write-port = "4006"
시작
$ docker-compose up -d
동작 확인
브라우저 시작
http://localhost:10001 방문
admin/admin으로 로그인
DASHBOARD
ALERTS
PROXIES
SETTINGS
SHARDS
도전
Maxscale 2.3.x 및 2.4.x의 경우 다음 화면의 표시가 다음과 같습니다.
아직 대응하지 않았을 가능성이 있습니다.
ALERTS
PROXIES
참고 URL
signal18/replication-manager
DockerHub의 공개 이미지
MariaDB HA Test
Reference
이 문제에 관하여(Docker에서 signal18/replication-manager를 움직여보세요), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/rururu_kenken/items/21ef04ec0c655fc9bfcb텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)