mysql5.5.20複製配置
#從庫
grant all on *.* to'root'@'172.28.14.114'identified by '123456';
#修改my.cnf
[client]
#password = your_password
port = 3306
socket = /data/mysql/data/mysql.sock
[mysqld]
server_id=2
federated
binlog_ignore_db=mysql,information_schema,performance_schema
datadir=/data/mysql/data
tmpdir=/data/mysql/tmp
skip-external-locking
key_buffer_size = 256M
myisam_sort_buffer_size = 64M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 24
back_log = 1024
max_connections = 1200
table_definition_cache=120000
table_open_cache =120000
max_connect_errors = 300
max_allowed_packet = 24M
read_rnd_buffer_size = 4M
read_buffer_size = 4M
join_buffer_size = 4M
sort_buffer_size = 2M
query_cache_limit = 2M
query_cache_size = 1024M
query_cache_min_res_unit=2k
thread_cache_size = 1200
thread_stack = 128K
tmp_table_size = 256M
max_tmp_tables = 256
bulk_insert_buffer_size = 4M
binlog_cache_size = 2M
max_binlog_size = 128M
max_binlog_cache_size= 512M
# log
log-error=/data/mysql/log/log
log-bin=/data/mysql/log/mysql-bin
slow-query-log
slow-query-log-file=/data/mysql/log/slow.log
long_query_time=1
log-queries-not-using-indexes
# innodb
innodb_buffer_pool_size = 18432M
innodb_data_home_dir = /data/mysql/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table= 1
innodb_log_group_home_dir = /data/mysql/log
innodb_log_files_in_group=3
innodb_log_file_size = 512M
innodb_log_buffer_size = 16M
#innodb_file_io_threads = 4
innodb_thread_concurrency = 24
innodb_lock_wait_timeout = 100
innodb_flush_method = 'O_DIRECT'
innodb_max_dirty_pages_pct = 75
# innodb_flush_log_at_trx_commit=2
# replication
replicate_wild_ignore_table=mysql.%,information_schema.%,performance_schema.%
relay_log=/data/mysql/log/relay-bin
log_slave_updates
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
#主庫
mysql>grant replication slave on *.* torep_user@172.28.14.115identified by 'repl_user';
###### INNODB
$ mysqldump -uroot -p123456 --quick --single-transaction --master-data=1 --default-character-set=utf8 zwf > zwf.sql
###### MyISAM
mysql>flush tables with read lock;
mysal>show master status;
$ mysqldump -uroot -p123456 --opt zwf | mysql zwf -uroot -p123456 -h 172.28.14.115
mysql>unlock tables;
# 從庫 INNODB拷貝zwf.sql並找到change master對應的bin log和pos
# 從庫 MyISAM根據show master status結果找到change master對應的bin log和pos
mysql>change master to master_host='172.28.14.114',master_user='rep_user',master_password='repl_user',master_log_file='mysql-bin.000001',master_log_pos=694;
mysql>start slave;
mysql>show slave status\G;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-715454/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql複製--主從複製配置MySql
- MySQL 8 複製(五)——配置GTID複製MySql
- Postgres 流複製配置
- MySQL 8 複製(九)——組複製聯機配置MySql
- GoldenGate單向複製配置(支援DDL複製)Go
- 配置mysql5.5主從複製、半同步複製、主主複製MySql
- mysql主主複製(雙主複製)配置步驟MySql
- MySql 主從複製配置MySql
- 為Oracle配置DDL複製Oracle
- goldengate配置DDL複製Go
- MySQL主從複製配置MySql
- MYSQL主從複製製作配置方案MySql
- GoldenGate配置(三)之DDL複製配置Go
- MySQL主主複製(雙主複製)配置過程介紹MySql
- MYSQL主從複製配置(整理)MySql
- MySQL複製3--配置MasterMySqlAST
- Redis 4.0主從複製配置Redis
- MySQL 5.7 延遲複製配置MySql
- goldengate 單向複製配置Go
- redhat 5.5 配置 mysql AB複製RedhatMySql
- GoldenGate配置(二)之雙向複製配置Go
- GoldenGate配置(一)之單向複製配置Go
- 5-5配置Mysql複製 基於日誌點的複製MySql
- MySQL8.0.11 組複製配置MySql
- MySQL 5.5級聯複製配置流程MySql
- postgresql 9.4 流複製簡單配置SQL
- mysql for linux 配置主從複製MySqlLinux
- mysql主從複製原理及配置MySql
- oracle goldengate 雙向複製配置OracleGo
- goldengate單向複製的配置Go
- 淺複製和深複製的概念與值複製和指標複製(引用複製)有關 淺複製 “指標複製 深複製 值複製指標
- Java引用複製、淺複製、深複製Java
- MySQL 主從複製安裝部署配置MySql
- Redis replication主從複製原理及配置Redis
- Docker 教程十五配置MySQL 主從複製DockerMySql
- Keepalived+Mysql配置主主複製MySql
- 簡單配置mysql的主從複製MySql
- Linux下配置MySQL主從複製LinuxMySql