首先,一些版本: Centos 6,MySQL5.1是我目前一直在使用的版本。
因此-问题是,当我使用以下任何一种方法进行复制时:
答:从手册上看,甲骨文网站上无法找到,但纳米比亚的一些大学却对此进行了镜像:http://download.nust.na/pub6/mysql/doc/refman/5.1/en/replication.html
B:通过Percona的工具,首选的方法,因为它不会导致一秒钟的停机,这是不可能的代价:https://www.percona.com/doc/percona-xtrabackup/2.3/howtos/setting_向上_replication.html
在奴隶上,我得到一个错误,告诉我在主服务器上找不到binlog。检查存储绑定日志的路径时,文件名最终会与启动转储或innobackupex时不同。我的mysql配置在主服务器上如下所示:
# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
thread_cache_size = 60
symbolic-links=0
innodb_buffer_pool_size=6000M
#query_cache_size = 2500M
table_cache = 800M
open_files_limit = 20000
key_buffer_size=500M
log-slow-queries = /var/log/mysql_slow_query.log
long_query_time = 6
# general_log = 1
max_connections = 500
innodb_thread_concurrency = 18
join_buffer_size = 10M
#log = /var/log/mysql_queries.log
log_bin = /var/lib/mysql_dump/bin/bin
skip-name-resolve
# Replication
server-id = 1
innodb_flush_log_at_trx_commit= 1
sync_binlog= 1
max_allowed_packet=1024M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid在奴隶身上:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
server-id=2
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid这些查询的结果也是:
mysql> select @@expire_logs_days;
+--------------------+
| @@expire_logs_days |
+--------------------+
| 0 |
+--------------------+
1 row in set (0.00 sec)
mysql> select @@log_bin;
+-----------+
| @@log_bin |
+-----------+
| 1 |
+-----------+
1 row in set (0.00 sec)这就是大师的地位:
mysql> SHOW MASTER STATUS;
+------------+----------+--------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------+----------+--------------+------------------+
| bin.023469 | 44272212 | | |
+------------+----------+--------------+------------------+
1 row in set (0.00 sec)在奴隶身上:
mysql> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: [redacted for the public :) ]
Master_User: repl0
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: bin.023468
Read_Master_Log_Pos: 15943086
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 4
Relay_Master_Log_File: bin.023468
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 106
Relay_Log_Space: 106
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'
Last_SQL_Errno: 0
Last_SQL_Error: 然后这个:
$ cat /var/lib/mysql/xtrabackup_binlog_info
bin.023468 15943086这在很大程度上是同一个问题,当我这样做Oracle的方式-只是有一个不同的文件名比当我做转储。
那么
发布于 2017-01-30 06:03:36
这是一个错误的mysql完整备份,使用以下标志运行:
--flush-logs and --delete-master-logs 禁用此功能解决了问题。
发布于 2017-01-10 21:47:33
有几个问题,虽然可能没有解决你的问题:
sync_binlog的价值是什么?主人坠毁了吗?“关闭”和“是”通常导致“非法位置”。server-id值是否不同?https://dba.stackexchange.com/questions/160464
复制相似问题