For master
[mysqld]
#set-variable = max_connections=500
safe-show-database
skip-locking
key_buffer = 100M
max_allowed_packet = 64M
log-error=/var/log/mysql/mysql-error.log
long_query_time = 3
log-slow-queries=/var/log/mysql/mysql-slow.log
table_cache = 512
sort_buffer_size = 10240K
read_buffer_size = 10240K
read_rnd_buffer_size = 10240K
net_buffer_length = 10240k
myisam_sort_buffer_size = 100M
max_connections=2048
set-variable = max_user_connections=2048
set-variable = max_connect_errors=999999
set-variable = query_cache_size=512M
query_cache_limit = 512M
set-variable = join_buffer=512M
thread_cache_size = 1024
log-bin=/var/lib/mysql/binlog
#binlog-do-db=systemWcell
#binlog-ignore-db=mysql
#binlog-ignore-db=test
server-id=4
create mysql user for replication
GRANT ALL PRIVILEGES ON *.* TO repl@replication server ip ;
SET PASSWORD FOR repl@replication server ip =PASSWORD('QHeqJ3TH');
FLUSH PRIVILEGES;
mysql> show master status\G
*************************** 1. row ***************************
File: binlog.000013
Position: 453
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)
For slave
[mysqld]
set-variable = max_connections=500
safe-show-database
skip-locking
key_buffer = 100M
max_allowed_packet = 64M
log-error=/var/log/mysql/mysql-error.log
long_query_time = 3
log-slow-queries=/var/log/mysql/mysql-slow.log
table_cache = 512
sort_buffer_size = 10240K
read_buffer_size = 10240K
read_rnd_buffer_size = 10240K
net_buffer_length = 10240k
myisam_sort_buffer_size = 100M
max_connections=2048
set-variable = max_user_connections=2048
set-variable = max_connect_errors=999999
set-variable = query_cache_size=512M
query_cache_limit = 512M
set-variable = join_buffer=512M
thread_cache_size = 1024
server-id=7
#binlog-do-db=systemWcell
replicate-do-db=systemWcell ---------------------------- DB Name
slave_skip_errors=all
#relay-log=/var/lib/mysql/relaylog
" CHANGE MASTER TO
" MASTER_HOST='Master IP,
" MASTER_USER='repl',
" MASTER_PASSWORD='QHeqJ3TH',
" MASTER_PORT=3306,
" MASTER_LOG_FILE='bin-log.000013',------------------------------ bin log possition
" MASTER_LOG_POS= 453;
+---------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+---------------+----------+--------------+------------------+
| binlog.000002 | 2397878 | | |
+---------------+----------+--------------+------------------+
1 row in set (0.00 sec)
Mysql > Start slave;
Mysql> show slave status;
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment