MySQL용 복제 토폴로지 관리자로써 고가용성 및 복제 관리 툴입니다. 체인을 위아래로 훑으면서 마스터와 슬레이브를 찾아 MySQL 환경의 복제 토폴로지를 검색하는 기능을 제공합니다. 또한 GUI를 통해 복제 토폴로지를 리팩터링하는 데도 사용할 수 있는데, 드래그 앤 드롭 인터페이스를 사용해서 슬레이브를 마스터로 승격할 수 있습니다.
상태 개념을 사용해서 올바른 복구 방법을 지능적으로 선택하고 사용할 적당한 마스터 승격 프로세스를 결정하므로 노드에 장애가 발생할 경우 복구를 지원합니다.
Orchestrator 기능
복제 트리의 토폴로지 및 상태를 자동으로 감지하고 모니터링합니다.
GUI, CLI 또는 API를 사용하여 상태를 확인하고 작업을 수행할 수 있습니다.
마스터의 자동 장애 조치를 지원하고 트리의 서버가 실패할 경우 수동 또는 자동으로 복제 트리를 수정할 수 있습니다.
MySQL의 특정 버전이나 특징(MySQL, Percona Server, MariaDB 또는 MaxScale binlog 서버)에 의존하지 않습니다.
Orchestrator는 단일 마스터 -> 슬레이브에서 수백 대의 서버로 구성된 복잡한 다중 계층 복제 트리에 이르기까지 다양한 유형의 토폴로지를 지원합니다.
Orchestrator는 토폴로지를 변경할 수 있으며 해당 시점의 상태에 따라 변경합니다. 데이터베이스 토폴로지에 해당하는 것으로 구성을 정의할 필요가 없습니다.
GUI는 상태를 보고할 뿐만 아니라 웹 인터페이스에서 드래그 앤 드롭을 수행하여 복제를 변경할 수 있는 더 멋진 기능 중 하나입니다(물론 CLI 및 API를 통해 이 외에도 훨씬 더 많은 작업을 수행할 수 있음).
데이터베이스 서버 설치 요구 사항
Orchestrator 는 데이터베이스 서버에 연결하기 위해 제한된 권한( SUPER , PROCESS , REPLICATION SLAVE , RELOAD )을 가진 MySQL 사용자만 필요 합니다. 이러한 권한으로 노드의 복제 상태를 확인하고 필요한 경우 복제 변경을 수행할 수 있습니다.
binlog 파일 위치, MySQL&MariaDB GTID, Pseudo GTID 및 Binlog 서버와 같은 다양한 복제 방법을 지원합니다.
데이터베이스 서버에 추가 소프트웨어를 설치할 필요가 없습니다.
테스트 환경
Hostname
IP
OS Version
DB Version
master
192.168.100.35
CentOS 7.3
MySQL 8.0.28
slave
192.168.100.36
CentOS 7.3
MySQL 8.0.28
orchestrator
192.168.100.37
CentOS 7.3
MySQL 8.0.28
사용 포트 : 3306(DB통신) (Orchestrator), 3000(Orchestrator 웹 기본 포트)
■ MySQL 서버 설치 (master, slave) 및 replication
-Orchestrator 구성 에서 GTID 사용을 권장 되나 Binlog Position 사용하여 replication 구성
## my.cnf
[mysqld]
datadir=/data
socket=/tmp/mysql.sock
server_id=1
expire_logs_days=7
log_bin=mysql.bin
relay_log=mysql-relay-bin
log_slave_updates=1
relay_log_purge=1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
log-error=/log/mariadb.log
pid-file=/log/mariadb.pid
[mysqld_safe]
log-error=/log/mariadb.log
pid-file=/log/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.28 |
+-----------+
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for source to send event
Master_Host: 192.168.100.35
Master_User: repl
Master_Port: 3306
Connect_Retry: 10
Master_Log_File: mysql.000002
Read_Master_Log_Pos: 1949
Relay_Log_File: mysql-relay-bin.000002
Relay_Log_Pos: 322
Relay_Master_Log_File: mysql.000002
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 1949
Relay_Log_Space: 532
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: 532b1949-9d3e-11ed-ba82-f220cde25fa4
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Replica has read all relay log; waiting for more updates
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
Master_public_key_path:
Get_master_public_key: 0
Network_Namespace:
1 row in set, 1 warning (0.00 sec)
※ 사전에 Orchestrator서버에도 데이터 저장을 위해 DB가 설치되어 있어야합니다.
mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 8.0.28 |
+-----------+
1 row in set (0.00 sec
mysql> CREATE USER 'orchestrator'@'%' IDENTIFIED BY 'orchestrator';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO 'orchestrator'@'%';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> GRANT SELECT ON mysql.slave_master_info TO 'orchestrator'@'%';
Query OK, 0 rows affected (0.00 sec)
■ Repository 접속을 위한 Topology 계정 생성 (Orchestrator)
Orchestrator 에서 토폴로지 정보 등을 저장하고 조회하는데 사용하는 Repository 용 DB가 필요하기 때문에 MySQL에 논리 database와 유저 생성
mysql> CREATE DATABASE IF NOT EXISTS orchestrator;
mysql> CREATE USER 'orchestrator'@'127.0.0.1' IDENTIFIED BY 'orchestrator';
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT ALL PRIVILEGES ON `orchestrator`.* TO 'orchestrator'127.0.0.1';
Query OK, 0 rows affected (0.00 sec)