DB가 날아갔어 ...
#/etc/mysql/mysqld.conf.d/mysqld.conf
[mysqld]
server-id = 1
log-bin=mysql-bin
repl 사용자 등록 및 권한 등록
mysql > CREATE USER 'repl_user'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'repl_user'@'%';
flush privileges;
mysql> SHOW MASTER STATUS;
#/etc/mysql/mysqld.conf.d/mysqld.cnf
[mysqld]
server-id = 2
restore 진행
mysql -u root -p < dump.sql
위의 형식으로 할수 있지만 나는 그냥 mysql 워크벤치로 했다...
mysql 서버 정보 설정
mysql > change master to
master_host='master server ip',
master_user='repl_user',
master_password='password',
master_log_file='mysql-bin.000004',
master_log_pos=154;
slave 시작
mysql > start slave;![](https://velog.velcdn.com/images%2Fsonaky47%2Fpost%2F48c15af5-c78b-427a-8c87-619716c86181%2Fimage.png)
mysql > show slave status;