quinta-feira, 30 de abril de 2015

Mysql Configuration and Master Slave Replication

Mysql Configuration
key_buffer = 4048M
key-buffer-size = 32M
max_connect_errors = 1000000
max_connections = 50
table_cache = 500
thread_concurrency = 0
thread_cache_size = 50

innodb_flush_log_at_trx_commit=1
sync_binlog=1
innodb_thread_concurrency = 0
innodb_read_io_threads=64
innodb_write_io_threads=64
innodb_buffer_pool_size=26GB
innodb_additional_mem_pool_size=4GB

query_cache_type        = 1
query_cache_limit       = 56M

join_buffer_size        = 128M
read_buffer_size        = 128M

Master Slave Replication

Edit the file /etc/mysql/my.cnf:

bind-address = 0.0.0.0

server-id = 20
log_bin = /var/log/mysql/mysql-bin.log
binlog_do_db = yourDB_name # Change this to the Database you want to keep synchronized with the Master
replicate_do_db = yourDB_name # Change this to the Database you want to replicate to the Slave
slave-skip-errors = 1062 # Ignore errors on duplicate inserts.. You can change this to any type of error you want to skip (the replication / synchornization keeps going, no need to restart it)
log_slave_updates = 1

Sem comentários:

Enviar um comentário