mysql互为主从复制详解----mysql-mm(7)
Id: 3
User: root
Host: localhost
db: NULL
Command: Query
Time: 0
State: NULL
Info: show processlist
*************************** 2. row ***************************
Id: 15
User: repl1
Host: 211.100.97.246:51840
db: NULL
Command: Binlog Dump
Time: 101
State: Has sent all binlog to slave; waiting for binlog to be updated
Info: NULL
*************************** 3. row ***************************
Id: 16
User: system user
Host:
db: NULL
Command: Connect
Time: 20
State: Waiting for master to send event
Info: NULL
*************************** 4. row ***************************
Id: 17
User: system user
Host:
db: NULL
Command: Connect
Time: 20
State: Has read all relay log; waiting for the slave I/O thread to update it
Info: NULL
4 rows in set (0.00 sec)
----------------
mysql> show slave status\G;
----------------
mysql> use test;
Database changed
mysql> unlock tables;
Query OK, 0 rows affected (0.00 sec)
----------------
重置日志
mysql> reset master;
mysql> show master status\G;
*************************** 1. row ***************************
File: mysql-bin.000001
Position: 106
Binlog_Do_DB: test
Binlog_Ignore_DB: mysql
1 row in set (0.00 sec)
[root@XKWB5510 ~]# ls -l /var/mysql/database/data/
total 0
查看data目录下是否有报错文件:
[root@XKWB5510 data]# ls /var/mysql/database/data/
重新执行change master to 命令以后,再启动slave,再看一下slave的状态,I/O进程起来了
进程都起来之后,就实施监控
-------------------------------------------------------------------------------------------------------------
报错:
1)
change master导致的:
Last_IO_Error: error connecting to master 'repl1@A_IP:3306' - retry-time: 60 retries
2)
在没有解锁的情况下停止slave进程:
mysql> stop slave;
ERROR 1192 (HY000): Can't execute the given command because you have active locked tables or an active transaction
3)
change master语法错误,落下逗号
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>