MariaDB单机双实例主从复制(二)

2015-01-21 12:14:02 · 作者: · 浏览: 8
? ? Master_Server_Id: 0
? ? ? ? ? ? ? Master_SSL_Crl:
? ? ? ? ? Master_SSL_Crlpath:
? ? ? ? ? ? ? ? ? Using_Gtid: No
? ? ? ? ? ? ? ? ? Gtid_IO_Pos:
1 row in set (0.00 sec)
MariaDB [(none)]> start slave;? #好启动slave
Query OK, 0 rows affected (0.00 sec)
?
MariaDB [(none)]> show slave status\G
*************************** 1. row ***************************
? ? ? ? ? ? ? Slave_IO_State: Waiting for master to send event
? ? ? ? ? ? ? ? ? Master_Host: 192.168.0.244
? ? ? ? ? ? ? ? ? Master_User: repl
? ? ? ? ? ? ? ? ? Master_Port: 3307
? ? ? ? ? ? ? ? Connect_Retry: 60
? ? ? ? ? ? ? Master_Log_File: master3307-bin.000005
? ? ? ? ? Read_Master_Log_Pos: 632
? ? ? ? ? ? ? Relay_Log_File: relay-log.000003
? ? ? ? ? ? ? ? Relay_Log_Pos: 540
? ? ? ? Relay_Master_Log_File: master3307-bin.000005
? ? ? ? ? ? Slave_IO_Running: Yes? #表示从服务器正常工作了
? ? ? ? ? ? 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: 632
? ? ? ? ? ? ? Relay_Log_Space: 831
? ? ? ? ? ? ? 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: 0
Master_SSL_Verify_Server_Cert: No
? ? ? ? ? ? ? ? Last_IO_Errno: 0
? ? ? ? ? ? ? ? Last_IO_Error:
? ? ? ? ? ? ? Last_SQL_Errno: 0
? ? ? ? ? ? ? Last_SQL_Error:
? Replicate_Ignore_Server_Ids:
? ? ? ? ? ? Master_Server_Id: 244
? ? ? ? ? ? ? Master_SSL_Crl:
? ? ? ? ? Master_SSL_Crlpath:
? ? ? ? ? ? ? ? ? Using_Gtid: No
? ? ? ? ? ? ? ? ? Gtid_IO_Pos:


来测试!


在主的上面创建一个库看从的是否可以复制到


主上创建


MariaDB [(none)]> create database kcwtest;
Query OK, 1 row affected (0.00 sec)
?
MariaDB [(none)]> show databases;
+--------------------+
| Database? ? ? ? ? |
+--------------------+
| information_schema |
| kcwtest? ? ? ? ? ? |
| mysql? ? ? ? ? ? ? |
| performance_schema |
| test? ? ? ? ? ? ? |
| test1? ? ? ? ? ? ? |
+--------------------+
6 rows in set (0.00 sec)


从上查看


MariaDB [(none)]> show databases;
+--------------------+
| Database? ? ? ? ? |
+--------------------+
| information_schema |
| kcwtest? ? ? ? ? ? |
| mysql? ? ? ? ? ? ? |
| performance_schema |
| test? ? ? ? ? ? ? |
+--------------------+
5 rows in set (0.00 sec)


可以复制!这样就实现单机实例复制,我做的3个实例,3306端口给默认的用,3307,3308端口做主从复制。