失效链接处理 |
MySQL5.6主从复制搭建文档 PDF 下载
本站整理下载:
相关截图:
主要内容:
1. slave库安装
参考原安装文档,注意my.cnf中server_id与主库设置为不同的值。如:
[client]
port=3306
socket=/u01/my3306/mysql.sock
[mysql]
pid_file=/u01/my3306/run/mysqld.pid
[mysqld]
autocommit=1
general_log=off
explicit_defaults_for_timestamp=true
# system
basedir=/u01/my3306
datadir=/data/my3306
max_allowed_packet=1g
max_connections=3000
max_user_connections=2000
open_files_limit=65535
pid_file=/u01/my3306/run/mysqld.pid
port=3306
server_id=102
skip_name_resolve=ON
socket=/u01/my3306/run/mysql.sock
tmpdir=/u01/my3306/tmp
#binlog
log_bin=/data/my3306/log/binlog/binlog
binlog_cache_size=32768
binlog_format=row
expire_logs_days=7
log_slave_updates=ON
max_binlog_cache_size=2147483648
max_binlog_size=524288000
sync_binlog=100
#logging
log_error=/data/my3306/log/error.log
slow_query_log_file=/data/my3306/log/slow.log
log_queries_not_using_indexes=0
slow_query_log=1
log_slave_updates=ON
log_slow_admin_statements=1
long_query_time=1
#relay
relay_log=/data/my3306/log/relaylog
relay_log_index=/data/my3306/log/relay.index
relay_log_info_file=/data/my3306/log/relay-log.info
#slave
slave_load_tmpdir=/u01/my3306/tmp
slave_skip_errors=OFF
#innodb
innodb_data_home_dir=/data/my3306/log/ibdata
innodb_log_group_home_dir=/data/my3306/log/iblog
innodb_adaptive_flushing=ON
innodb_adaptive_hash_index=ON
innodb_autoinc_lock_mode=1
innodb_buffer_pool_instances=8
#default
innodb_change_buffering=inserts
innodb_checksums=ON
innodb_buffer_pool_size= 1G
innodb_data_file_path=ibdata1:1G;ibdata2:16M:autoextend
innodb_doublewrite=ON
innodb_file_format=Barracuda
innodb_file_per_table=ON
innodb_flush_log_at_trx_commit=1
innodb_flush_method=O_DIRECT
innodb_io_capacity=1000
innodb_lock_wait_timeout=10
innodb_log_buffer_size=128m
innodb_log_file_size=1G
innodb_log_files_in_group=4
innodb_max_dirty_pages_pct=60
innodb_open_files=60000
innodb_purge_threads=1
innodb_read_io_threads=4
innodb_stats_on_metadata=OFF
innodb_support_xa=ON
innodb_use_native_aio=OFF
innodb_write_io_threads=10
[mysqld_safe]
|