Environment:
OS: CentOS release 5.5 (Final) (64-bit)
2.6.18-194. el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
Mysql:
Mysql-5.5.3-m3.tar.gz
Master: 192.168.0.100
Slave: 192.168.0.200
Most configurations are similar to "MySQL master-slave synchronization, read/write splitting configuration steps, problem solving Notes [original]". However, when configuring from the server, the added replication conditions cannot start the database; however, according to the online message, Mysql versions do not support parameters similar to "master-host" since 5.1.7;
View the following error message in mysql_error.log;
110105 13:38:00 mysqld_safe mysqld from pid file/data0/mysql/3306/mysql. pid ended
110105 13:38:06 mysqld_safe Starting mysqld daemon with databases from/data0/mysql/3306/data
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
110105 13:38:06 InnoDB: highest supported file format is Barracuda.
110105 13:38:06 InnoDB Plugin 1.0.6 started; log sequence number 44309
110105 13:38:06 [ERROR]/usr/local/webserver/mysql/libexec/mysqld: unknown variable 'master-host = 192.168.7.202'
110105 13:38:06 [ERROR] Aborting
110105 13:38:06 InnoDB: Starting shutdown...
110105 13:38:08 InnoDB: Shutdown completed; log sequence number 44319
110105 13:38:08 [Note]/usr/local/webserver/mysql/libexec/mysqld: Shutdown complete
In desperation, change my. cnf from the database to the following configuration. (In the primary database, note that ID is 1 and add the database to be synchronized)
[Client]
Character-set-server = utf8
Port = 3306
Socket =/tmp/mysql. sock
[Mysqld]
Character-set-server = utf8
Replicate-ignore-db = mysql
Replicate-do-db = db
Replicate-ignore-db = test
Replicate-ignore-db = information_schema
User = mysql
Port = 3306
Socket =/tmp/mysql. sock
Basedir =/usr/local/mysql
Datadir =/home/mysql/data
Log-error =/home/mysql/mysql_error.log
Pid-file =/home/mysql. pid
Open_files_limit = 10240
Back_log = 600
Max_connections = 5000
Max_connect_errorrs = 6000
Table_cache = 614
External-locking = FALSE
Max_allowed_packet = 32 M
Sort_buffer_size = 1 M
Join_buffer_size = 1 M
Thread _ cache_size = 300
# Thread_concurrency = 8
Query_cache_size = 512 M
Query_cache_limit = 2 M
Query_cache_min_res_unit = 2 k
Default-storage-engine = MyISAM
Thread_stack = 192 K
Transaction_isolation = READ-COMMITTED
Tmp_table_size = 246 M
Max_heap_table_size = 246 M
Long_query_time = 3
Log-slave-updates
Log-bin =/home/mysql/binlog
Binlog_cache_size = 4 M
Binlog_format = MIXED
Max_binlog_cache_size = 8 M
Max_binlog_size = 1G
Relay-log-index =/home/mysql/relaylog
Relay-log-info-file =/home/mysql/relaylog
Relay-log =/home/mysql/relaylog
Expire_logs_days = 30
Key_buffer_size = 256 M
Read_buffer_size = 1 M
Read_rnd_buffer_size = 16 M
Bulk_insert_buffer_size = 64 M
Myisam_sort_buffer_size = 128 M
Myisam_max_sort_file_size = 10G
Myisam_repair_threads = 1
Myisam_recover
Interactive_timeout = 120
Wait_timeout = 120
Skip-name-resolve
# Master-connect-retry = 10
Slave-skip-errors = 1396
# Master-host = 192.168.1.2
# Master-user = username
# Master-password = password
# Master-ports = 3306
Server-id = 2
Innodb_additional_mem_pool_size = 16 M
Innodb_buffer_pool_size = 512 M
Innodb_data_file_path = ibdata1: 256 M: autoextend
Innodb_file_io_threads = 4
Innodb_thread_concurrency = 8
Innodb_flush_log_at_trx_commit = 2
Innodb_log_buffer_size = 16 M
Innodb_log_file_size = 128 M
Innodb_log_files_in_group = 3
Innodb_max_dirty_pages_pct = 90
Innodb_lock_wait_timeout = 120
Innodb_file_per_table = 0
# Log-slow-queries =/home/mysql/slow. log
# Long_query_time = 10
[Mysqldump]
Quick
Max_allowed_packet = 32 M