两台虚拟机都差不多添加上面的内容 只是ip什么的变了一下
都弄好了以后 在一台虚拟机(A)上
mysql > show master status;
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+-------------------+----------+--------------+------------------+
| mysqld-bin.000002 | 98 | test | mysql |
+-------------------+----------+--------------+------------------+
在另一台虚拟机(B)上
mysql > start slave;
mysql > show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Connecting to master
Master_Host: 192.168.96.133
Master_User: backup
Master_Port: 3306
Connect_Retry: 60
Master_Log_File:
Read_Master_Log_Pos: 4
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 98
Relay_Master_Log_File:
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB: test
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: 0
Relay_Log_Space: 98
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
mysql日志error为
120706 1:06:16 [ERROR] Slave I/O thread: error connecting to master 'backup@192.168.96.133:3306': Error: 'Lost connection to MySQL server at 'reading initial communication packet', system error: 113' errno: 2013 retry-time: 60 retries: 86400
作者: horizonhyg 时间: 2012-07-06 17:52
system error: 113 的意思是no route to host,就是主机不通。也就是Bping不通,查看网络吧。作者: RogerZhuo 时间: 2012-07-06 17:52
perror 113
OS error code 113: No route to host
说明slave不能到达master,作者: shuimuyq 时间: 2012-07-07 08:30
我的两台虚拟机 用NAT跟主机连接 虚拟机a的 ip:192.168.96.130 虚拟机b的 ip:192.168.96.133
在虚拟机a 终端
#ping 192.168.96.133
PING 192.168.96.133 (192.168.96.133) 56(84) bytes of data.
64 bytes from 192.168.96.133: icmp_seq=1 ttl=64 time=0.575 ms
64 bytes from 192.168.96.133: icmp_seq=2 ttl=64 time=0.231 ms
64 bytes from 192.168.96.133: icmp_seq=3 ttl=64 time=0.235 ms
64 bytes from 192.168.96.133: icmp_seq=4 ttl=64 time=0.459 ms
64 bytes from 192.168.96.133: icmp_seq=5 ttl=64 time=0.238 ms
在虚拟机b 终端
#ping 192.168.96.130
PING 192.168.96.130 (192.168.96.130) 56(84) bytes of data.
64 bytes from 192.168.96.130: icmp_seq=1 ttl=64 time=0.614 ms
64 bytes from 192.168.96.130: icmp_seq=2 ttl=64 time=0.226 ms
64 bytes from 192.168.96.130: icmp_seq=3 ttl=64 time=0.331 ms
64 bytes from 192.168.96.130: icmp_seq=4 ttl=64 time=0.240 ms
64 bytes from 192.168.96.130: icmp_seq=5 ttl=64 time=0.248 ms
这样算两台虚拟机可以联通吗作者: shuimuyq 时间: 2012-07-07 08:46
说明一下
我两台虚拟机是克隆体
所有东西都一模一样
这样可以吗
是否要改动什么数据才行
我在虚拟机b 的终端上输入
#mysql -h192.168.96.130 -ubackup -p123456
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.96.130' (113)