mysql 8.0 replication 구성
아래처럼 1에서 6순으로 진행하면 됩니다.
1. replication user 생성 ( on master )
create user repl@'%' identified by 'test';
2. 권한 부여 (on master)
grant replication slave on *.* on repl@'%';
3. master binlog 정보 확인 (gtid 사용을 권장, on master)
show master status\G ( or show source status # beyond 8.0.23+)
show global variables like '%GTID%' : gtid 확인
4. configure slave(replica) 서버 (on slave)
change master to
master_host = '10.10.10.10',
master_port = 3306,
master_user = 'repl',
master_password = 'test',
master_auto_position = 1;
verion이 8.0.23+ 이상일 경우는 아래와 같이 수행해도 됨
change replication source to
source_host = '10.10.10.10',
source_port = 3306,
source_user = 'repl',
source_password = 'test',
source_auto_position = 1;
5. slave(replica) 상태 확인 (on slave)
show slave status\G ( or show replica status\G )
6. start slave (on slave)
start slave; ( or start replica )