링크 조회 : 429
master mysql > GRANT REPLICATION SLAVE ON *.*
-> TO 'user_name'@'user_host' IDENTIFIED BY 'user_password';
master mysql > GRANT FILE ON *.*
-> TO 'user_name'@'user_host' IDENTIFIED BY 'user_password';
master mysql > FLUSH TABLES WITH READ LOCK; master shell > tar -cvf /tmp/mysql-snapshot.tar . slave shell > tar -xvf /tmp/mysql-snapshot.tar master mysql > UNLOCK TABLES;
master Shell > mysqldump -u root -p ‘password’ -B db_name > dump_file.sql
master shell> vi /etc/my.cnf
[mysqld] log-bin server-id = 1
slave shell> vi /etc/my.cnf
[mysqld] server-id = 2 master-host = xxx.xxx.xxx.xxx(user_host) master-port = 3306 master-user = user_name master-password = user_password
slave shell > mysql -u root -p < dump_file.sql
slave mysql > CHANGE MASTER TO
-> MASTER_HOST='master_host_name',
-> MASTER_USER='replication_user_name',
-> MASTER_PASSWORD='replication_password',
-> MASTER_LOG_FILE='recorded_log_file_name',
-> MASTER_LOG_POS=recorded_log_position;
MASTER_HOST 60 MASTER_USER 16 MASTER_PASSWORD 32 MASTER_LOG_FILE 255
Slave I/O thread: connected to master 'user_name@user_host:3306', replication started in log 'FIRST' at position 4
mysql2 mysql > GRANT REPLICATION SLAVE ON *.*
-> TO 'users_name'@'users_host' IDENTIFIED BY 'users_password';
mysql1 shell > /etc/init.d/mysqld stop
[mysqld] server-id = 1 <= 그대로 두고, 아래 내용을 추가한다. master-host = users_host master-port = 3306 master-user = users_name master-password = users_password
Slave I/O thread: connected to master 'ccotti@222.112.137.172:3306', replication started in log 'FIRST' at position 4
mysql1 shell > /etc/init.d/mysqld start
mysql2 mysql > slave stop; mysql2 mysql > slave reset; mysql2 mysql > slave start;
| 제목 |
|---|
| [기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js) |
| 유용한 리눅스(LINUX) 명령어 |
| [공지] 기술 게시판 |
일 |
월 |
화 |
수 |
목 |
금 |
토 |
|---|---|---|---|---|---|---|
|
11.30
|
12.1
|
12.2
|
12.3
|
12.4
|
12.5
|
12.6
|
|
12.7
|
12.8
|
12.9
|
12.10
|
12.11
|
12.12
|
12.13
|
|
12.14
|
12.15
|
12.16
|
12.17
|
12.18
|
12.19
|
12.20
|
|
12.21
|
12.22
|
12.23
|
12.24
|
12.25
|
12.26
|
12.27
|
|
12.28
|
12.29
|
12.30
|
12.31
|
1.1
|
1.2
|
1.3
|