LoginSignup
3
1

More than 5 years have passed since last update.

Compose.ioのMySQLを使ってみた Part2

Posted at

前回↓のつづき。
http://qiita.com/azzeten/items/a1204d523f5548cff3e7

MySQLの構成は?

ComposeのUIやマニュアルからも確認できますが、3ノードでグループレプリケーションを組んでるようです。

mysql> SELECT * FROM performance_schema.replication_group_members;
+---------------------------+--------------------------------------+------------------------------------------+-------------+--------------+
| CHANNEL_NAME              | MEMBER_ID                            | MEMBER_HOST                              | MEMBER_PORT | MEMBER_STATE |
+---------------------------+--------------------------------------+------------------------------------------+-------------+--------------+
| group_replication_applier | 094f4172-2f30-11e7-8590-a637e8d5b754 | mysqlxxx.sl-us-dal-9-xxx.dblayer.com |        3306 | ONLINE       |
| group_replication_applier | 142ff6cf-2f30-11e7-8651-461cf9dd4049 | mysqlxxx.sl-us-dal-9-xxx.dblayer.com |        3306 | ONLINE       |
| group_replication_applier | dc384358-2f2f-11e7-8238-26b988664b80 | mysqlxxx.sl-us-dal-9-xxx.dblayer.com |        3306 | ONLINE       |
+---------------------------+--------------------------------------+------------------------------------------+-------------+--------------+
3 rows in set (0.23 sec)

テーブルを作ってInsertしてみる

グループレプリケーションなので、テーブルには必ずPrimary keyを指定します。

mysql> create table testtable1 (col1 int primary key);
Query OK, 0 rows affected (0.18 sec)

mysql> insert into testtable1(col1)  values (10);
Query OK, 1 row affected (0.23 sec)

mysql> select * from testtable1;
+------+
| col1 |
+------+
|   10 |
+------+
1 row in set (0.22 sec)

GUIツールからも接続してみた

Sequel Proで接続を試してみました。普通にできます。
スクリーンショット 2017-05-09 11.43.30.png

接続をクリックして、この通り!
スクリーンショット 2017-05-09 11.44.01.png

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1