database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 29778 게시물 읽기
No. 29778
replication설정이 안됩니다. 꼭 좀 봐주세요??
작성자
조근호(agendi)
작성일
2010-08-30 23:31ⓒ
2010-08-30 23:34ⓜ
조회수
7,589

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인지요?
어디가 잘못된 것일까요?


아시는 분 부탁드립니다.ㅠㅠㅠ

이 글에 대한 댓글이 총 4건 있습니다.

슬레이브쪽에서 에러로그가 어떻게 나왔지 적어주셨으면 더 좋았을텐데...

마스터쪽에서 슬레이브 DB가 접근할수 있는 권한을 주셨나요?

GRANT REPLICATION SLAVE ON *.*
 TO 'repl'@'IP주소' IDENTIFIED BY 'slavepass';

요런식으로 마스터에다가 슬레이브가 리플리케이션을 할수 있는 권한을 주셔야 해요.

그리고 슬레이브 환경설정 파일에

master-user = repl

master-password = slavepass

를 넣어주세요~

 

나방님이 2010-08-31 10:54에 작성한 댓글입니다. Edit

나방님! 우선 감사드립니다.

금일중 알려주신대로 시행해보겠습니다. 그리고 안될경우 master, slave log 내용을 같이 올리겠습니다.

내일중 한번 더 봐주세요! 부탁드립니다^^

조근호(agendi)님이 2010-08-31 17:52에 작성한 댓글입니다.

 

 

왜 리스토어를 mysql DB 에 하신건가여???

 

mysql DB 는 계정 정보가 있는곳인대..

 

마스터의 디비명도... mysql 로 되어있으신건가여??

리스토어 를 다시 해보시면 아마 동기화 될것 같은대요?

민족님이 2010-09-03 11:14에 작성한 댓글입니다. Edit

 

 

그리고 하나더... 계정은 root 가 아니고..

 

replication 되는 계정을 추가 해주세용

 

계정생성은 (master) 에서

 

mysql> GRANT REPLICATION SLAVE ON *.*
        -> TO 'repli'@'%' IDENTIFIED BY 'repli';

 

이런식으로 생성 해주시고.. 계정 추가

 

mysql> flush privileges; 를 실행해주시고.

 

다시 DB 스타트 해보시기 바랍니다.

민족님이 2010-09-03 11:20에 작성한 댓글입니다. Edit
[Top]
No.
제목
작성자
작성일
조회
29782mysql 에서 도스명령을 실행 할수있나요? [1]
박재헌
2010-09-02
9166
29781ndb 테이블 Lock 문제 [1]
이철수
2010-09-02
7729
29780jeus.jdbc.driver.blackbox.BlackboxConnection.setAutoCommit 에러..
질문이
2010-09-01
7853
29778replication설정이 안됩니다. 꼭 좀 봐주세요?? [4]
조근호
2010-08-30
7589
29777table_option의 auto_increment [2]
김지숙
2010-08-30
8362
29776MySQL Sleep이 너무 많은 현상 [2]
디비악마
2010-08-30
9268
29775테이블 값 참조 질문 드립니다. [1]
정현철
2010-08-30
7477
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.025초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다