DB서버 두대를 replication 할려고 하는데요.
master 서버에서
mysql>grant select, reload, lock tables, replication slave, replication client on *.* to id@"%" identified by 'password';
mysql>flush privileges;
계정생성한뒤,
master 서버 my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
log-bin=mysql-bin
server-id=1
#long_query_time=1
#log-slow-queries = /var/log/mysql/mysql-slow.log
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
slave 서버 my.cnf
[client]
default-character-set=latin1
[mysqld]
default-character-set=latin1
init_connect=SET collation_connection=latin1_swedish_ci
init_connect=SET NAMES latin1
character-set-server=latin1
collation-server=latin1_swedish_ci
set-variable = wait_timeout=360
set-variable = interactive_timeout=1200
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /var/lib/mysql
set-variable = table_cache=1024
set-variable = max_connections=500
set-variable = max_user_connections=100
set-variable = max_connect_errors=10000
log-slow-queries
set-variable = long_query_time=3
skip-name-resolve
master-host=xxx.xxx.xxx.xxx
master-user=id
master-password=password
master-port=3306
server-id=2
# InnoDB 사용 안할시 아래 내용추가
#skip-innodb
#sync_binlog = 1
[mysql.server]
wait_timeout=9600
user=mysql
[mysqldump]
default-character-set=latin1
[mysql]
default-character-set=latin1
이렇게 설정되어있구요
master 쪽에 데이터 모두 slave로 복사 해왔구요..
master, slave 서버 둘다 mysql 재실행을 시켰는데
slave 에서 show slave status\G 로 보니
Slave_IO_Running: No
로 나오네요..
그래서 로그 확인해 보니
[ERROR] Slave I/O thread: error connecting to master 'id@xxx.xxx.xxx.xxx:3306': Error: 'Access denied for user 'id'@'xxx.xxx.xxx.xxx' (using password: YES)' errno: 1045 retry-time: 60 retries: 86400
접근 권한 에러 뜨던데.. master 쪽에서 분명히 계정을 생성해 줬고
slave 서버에서
#]mysql -u id -p -hxxx.xxx.xxx.xxx 로 master 서버에 mysql 접속해보면 접속됩니다.
뭐가 문제 일까요....ㅠ
혹시나 old_passwords=1 설정때문에 그런가 싶어 삭제하고 해봐도 안되네요..
|