1.버전
master server : mysql 5.1.37
slave server : mysql 5.1.34
2.
master server 의 db자료를 전부,
mysqldump -uroot -p --all-databases > alldb.sql 한 후,
slave server 로 옮겨
mysql -uroot -p mysql < alldb.sql
이렇게 동기화시켜 주었습니다. 물론 master server의 DB도 shutdown시켜 놓았습니다.
3.
master와 slave의 /etc/my.conf파일을 다음과 같이 설정하였습니다.
어디 설정이 잘못되었는지 몰라, 전체 파일을 여기에 올립니다.
master server의 /etc/my.cnf
=========================
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format - mixed recommended
binlog_format=mixed
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
slave server의 /etc/my.cnf
==========================
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format - mixed recommended
binlog_format=mixed
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
#server-id = 1
# Replication Slave (comment out master section to use this)
server-id = 2
#
# The replication master for this slave - required
master-host = 111.111.111.111
#
# The username the slave will use for authentication when connecting
# to the master - required
master-user = root
#
# The password the slave will authenticate with when connecting to
# the master - required
master-password = xxxxxxxx(db root passwd)
#
# The port the master is listening on.
# optional - defaults to 3306
master-port = 3306
=======================================
위와 같이 설정한 후, 양쪽 모두 db shutdown 한후 다시
/usr/local/mysql/bin/mysqld_safe --user=mysql &
살린 후 db 접속해봤지만 되지를 않습니다.
그리고 slave에서 master-password는 db root password인지, 아니면 처음서버접속시 root password인지요?
어디가 잘못된 것일까요?
아시는 분 부탁드립니다.ㅠㅠㅠ |