Skip to content

Instantly share code, notes, and snippets.

@cp16net
Last active August 29, 2015 14:26
Show Gist options
  • Save cp16net/8d99d4e57c142a4be3b6 to your computer and use it in GitHub Desktop.
Save cp16net/8d99d4e57c142a4be3b6 to your computer and use it in GitHub Desktop.
ubuntu@devstack1:~$ trove cluster-create pxc55-working percona 5.5 --instance flavor_id=7,volume=1 --instance flavor_id=7,volume=1
+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------+
| Property | Value
|
+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------+
| created | 2015-07-29T17:27:12
|
| datastore | {u'version': u'5.5', u'type': u'percona'}
|
| datastore_version | 5.5
|
| id | 323c2809-b111-4dcc-85e2-816ca896c39f
|
| instances | [{u'status': u'BUILD', u'name': u'pxc55-working-member-2', u'links': [{u'href': u'https://10.2.0.16:8779/v1.0/f52eda5160fa4751ae8eb85928d13445/instances/36c38861-0f2c-43ac-96c3-ee87fe5c6be1', u'rel': u'self'}, {u'hre
f': u'https://10.2.0.16:8779/instances/36c38861-0f2c-43ac-96c3-ee87fe5c6be1', u'rel': u'bookmark'}], u'volume': {u'size': 1}, u'flavor': {u'id': u'7', u'links': [{u'href': u'https://10.2.0.16:8779/v1.0/f52eda5160fa4751ae8eb85928d13445/fla
vors/7', u'rel': u'self'}, {u'href': u'https://10.2.0.16:8779/flavors/7', u'rel': u'bookmark'}]}, u'type': u'member', u'id': u'36c38861-0f2c-43ac-96c3-ee87fe5c6be1'}, {u'status': u'BUILD', u'name': u'pxc55-working-member-1', u'links': [{u
'href': u'https://10.2.0.16:8779/v1.0/f52eda5160fa4751ae8eb85928d13445/instances/6f060eea-9eb1-4911-8b35-899978912627', u'rel': u'self'}, {u'href': u'https://10.2.0.16:8779/instances/6f060eea-9eb1-4911-8b35-899978912627', u'rel': u'bookma
rk'}], u'volume': {u'size': 1}, u'flavor': {u'id': u'7', u'links': [{u'href': u'https://10.2.0.16:8779/v1.0/f52eda5160fa4751ae8eb85928d13445/flavors/7', u'rel': u'self'}, {u'href': u'https://10.2.0.16:8779/flavors/7', u'rel': u'bookmark'}
]}, u'type': u'member', u'id': u'6f060eea-9eb1-4911-8b35-899978912627'}] |
| links | [{u'href': u'https://10.2.0.16:8779/v1.0/f52eda5160fa4751ae8eb85928d13445/clusters/323c2809-b111-4dcc-85e2-816ca896c39f', u'rel': u'self'}, {u'href': u'https://10.2.0.16:8779/clusters/323c2809-b111-4dcc-85e2-816ca896
c39f', u'rel': u'bookmark'}]
|
| name | pxc55-working
|
| task | {u'id': 2, u'description': u'Building the initial cluster.', u'name': u'BUILDING'}
|
| task_description | Building the initial cluster.
|
| task_name | BUILDING
|
| updated | 2015-07-29T17:27:12
|
+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------+
ubuntu@devstack1:~$ trove cluster-list
+--------------------------------------+---------------+-----------+-------------------+-----------+
| ID | Name | Datastore | Datastore Version | Task Name |
+--------------------------------------+---------------+-----------+-------------------+-----------+
| 323c2809-b111-4dcc-85e2-816ca896c39f | pxc55-working | percona | 5.5 | BUILDING |
| 70cffa62-961f-4d2e-bf86-43658b4cb170 | pxc55-working | percona | 5.5 | NONE |
+--------------------------------------+---------------+-----------+-------------------+-----------+
ubuntu@devstack1:~$ trove cluster-delete 70cffa62-961f-4d2e-bf86-43658b4cb170
ubuntu@devstack1:~$ trove cluster-list
+--------------------------------------+---------------+-----------+-------------------+-----------+
| ID | Name | Datastore | Datastore Version | Task Name |
+--------------------------------------+---------------+-----------+-------------------+-----------+
| 323c2809-b111-4dcc-85e2-816ca896c39f | pxc55-working | percona | 5.5 | BUILDING |
| 70cffa62-961f-4d2e-bf86-43658b4cb170 | pxc55-working | percona | 5.5 | DELETING |
+--------------------------------------+---------------+-----------+-------------------+-----------+
ubuntu@devstack1:~$ trove cluster-list
+--------------------------------------+---------------+-----------+-------------------+-----------+
| ID | Name | Datastore | Datastore Version | Task Name |
+--------------------------------------+---------------+-----------+-------------------+-----------+
| 323c2809-b111-4dcc-85e2-816ca896c39f | pxc55-working | percona | 5.5 | NONE |
+--------------------------------------+---------------+-----------+-------------------+-----------+
ubuntu@devstack1:~$ trove cluster-show 323c2809-b111-4dcc-85e2-816ca896c39f
+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| created | 2015-07-29T17:27:12 |
| datastore | percona |
| datastore_version | 5.5 |
| id | 323c2809-b111-4dcc-85e2-816ca896c39f |
| ip | 10.0.0.4, 10.0.0.5 |
| name | pxc55-working |
| task_description | No tasks for the cluster. |
| task_name | NONE |
| updated | 2015-07-29T17:41:02 |
+-------------------+--------------------------------------+
ubuntu@devstack1:~$ trove cluster-instances 323c2809-b111-4dcc-85e2-816ca896c39f
+--------------------------------------+------------------------+-----------+------+--------+
| ID | Name | Flavor ID | Size | Status |
+--------------------------------------+------------------------+-----------+------+--------+
| 36c38861-0f2c-43ac-96c3-ee87fe5c6be1 | pxc55-working-member-2 | 7 | 1 | ACTIVE |
| 6f060eea-9eb1-4911-8b35-899978912627 | pxc55-working-member-1 | 7 | 1 | ACTIVE |
+--------------------------------------+------------------------+-----------+------+--------+
ubuntu@devstack1:~$ trove list
+----+------+-----------+-------------------+--------+-----------+------+
| ID | Name | Datastore | Datastore Version | Status | Flavor ID | Size |
+----+------+-----------+-------------------+--------+-----------+------+
+----+------+-----------+-------------------+--------+-----------+------+
ubuntu@devstack1:~$ trove list --include-clustered
+--------------------------------------+------------------------+-----------+-------------------+--------+-----------+------+
| ID | Name | Datastore | Datastore Version | Status | Flavor ID | Size |
+--------------------------------------+------------------------+-----------+-------------------+--------+-----------+------+
| 36c38861-0f2c-43ac-96c3-ee87fe5c6be1 | pxc55-working-member-2 | percona | 5.5 | ACTIVE | 7 | 1 |
| 6f060eea-9eb1-4911-8b35-899978912627 | pxc55-working-member-1 | percona | 5.5 | ACTIVE | 7 | 1 |
+--------------------------------------+------------------------+-----------+-------------------+--------+-----------+------+
ubuntu@devstack1:~$ trove show 36c38861-0f2c-43ac-96c3-ee87fe5c6be1
+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| cluster_id | 323c2809-b111-4dcc-85e2-816ca896c39f |
| created | 2015-07-29T17:27:12 |
| datastore | percona |
| datastore_version | 5.5 |
| flavor | 7 |
| id | 36c38861-0f2c-43ac-96c3-ee87fe5c6be1 |
| ip | 10.0.0.5 |
| name | pxc55-working-member-2 |
| status | ACTIVE |
| updated | 2015-07-29T17:27:16 |
| volume | 1 |
| volume_used | 0.23 |
+-------------------+--------------------------------------+
ubuntu@devstack1:~$ trove show 6f060eea-9eb1-4911-8b35-899978912627
+-------------------+--------------------------------------+
| Property | Value |
+-------------------+--------------------------------------+
| cluster_id | 323c2809-b111-4dcc-85e2-816ca896c39f |
| created | 2015-07-29T17:27:12 |
| datastore | percona |
| datastore_version | 5.5 |
| flavor | 7 |
| id | 6f060eea-9eb1-4911-8b35-899978912627 |
| ip | 10.0.0.4 |
| name | pxc55-working-member-1 |
| status | ACTIVE |
| updated | 2015-07-29T17:27:16 |
| volume | 1 |
| volume_used | 0.24 |
+-------------------+--------------------------------------+
ubuntu@devstack1:~$ trove database-list 6f060eea-9eb1-4911-8b35-899978912627
+--------------------+
| Name |
+--------------------+
| performance_schema |
+--------------------+
ubuntu@devstack1:~$ trove database-list 36c38861-0f2c-43ac-96c3-ee87fe5c6be1
+--------------------+
| Name |
+--------------------+
| performance_schema |
+--------------------+
ubuntu@devstack1:~$ trove database-create 36c38861-0f2c-43ac-96c3-ee87fe5c6be1 mynewdb
ubuntu@devstack1:~$ trove database-list 36c38861-0f2c-43ac-96c3-ee87fe5c6be1
+--------------------+
| Name |
+--------------------+
| mynewdb |
| performance_schema |
+--------------------+
ubuntu@devstack1:~$ trove database-list 6f060eea-9eb1-4911-8b35-899978912627
+--------------------+
| Name |
+--------------------+
| mynewdb |
| performance_schema |
+--------------------+
ubuntu@devstack1:~$ trove user-list 6f060eea-9eb1-4911-8b35-899978912627
+----------------+------+-----------+
| Name | Host | Databases |
+----------------+------+-----------+
| clusterrepuser | % | |
+----------------+------+-----------+
ubuntu@devstack1:~$ trove user-create 6f060eea-9eb1-4911-8b35-899978912627 cp16net mypassword --databases mynewdb
ubuntu@devstack1:~$ trove user-list 6f060eea-9eb1-4911-8b35-899978912627
+----------------+------+-----------+
| Name | Host | Databases |
+----------------+------+-----------+
| clusterrepuser | % | |
| cp16net | % | mynewdb |
+----------------+------+-----------+
ubuntu@devstack1:~$ trove user-list 36c38861-0f2c-43ac-96c3-ee87fe5c6be1
+----------------+------+-----------+
| Name | Host | Databases |
+----------------+------+-----------+
| clusterrepuser | % | |
| cp16net | % | mynewdb |
+----------------+------+-----------+
ubuntu@devstack1:~$
ubuntu@devstack1:~$ mysql -h 10.0.0.5 -u cp16net -pmypassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27
Server version: 5.5.37-35.0 Percona XtraDB Cluster (GPL), Release 35.0 (Ubuntu), wsrep_25.10.rXXXX
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mynewdb |
+--------------------+
2 rows in set (0.00 sec)
mysql> use mynewdb
Database changed
mysql> show tables;
Empty set (0.00 sec)
mysql> create table users (id int not null auto_increment primary key, name varchar(20));
Query OK, 0 rows affected (0.29 sec)
mysql> show tables;
+-------------------+
| Tables_in_mynewdb |
+-------------------+
| users |
+-------------------+
1 row in set (0.03 sec)
mysql> describe users;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+----------------+
2 rows in set (0.05 sec)
mysql> select * from users;
+----+---------+
| id | name |
+----+---------+
| 2 | cp16net |
| 4 | food |
+----+---------+
2 rows in set (0.05 sec)
mysql> insert into users set name='foo';
Query OK, 1 row affected (0.05 sec)
mysql> select * from users;
+----+---------+
| id | name |
+----+---------+
| 2 | cp16net |
| 4 | food |
| 5 | foo |
+----+---------+
3 rows in set (0.00 sec)
mysql> show status like 'wsrep%';
+----------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------+--------------------------------------+
| wsrep_local_state_uuid | 8e8c6dab-3618-11e5-ad69-c248ddd74c99 |
| wsrep_protocol_version | 4 |
| wsrep_last_committed | 7 |
| wsrep_replicated | 3 |
| wsrep_replicated_bytes | 615 |
| wsrep_received | 10 |
| wsrep_received_bytes | 1212 |
| wsrep_local_commits | 1 |
| wsrep_local_cert_failures | 0 |
| wsrep_local_replays | 0 |
| wsrep_local_send_queue | 0 |
| wsrep_local_send_queue_avg | 0.000000 |
| wsrep_local_recv_queue | 0 |
| wsrep_local_recv_queue_avg | 0.000000 |
| wsrep_flow_control_paused | 0.000000 |
| wsrep_flow_control_sent | 0 |
| wsrep_flow_control_recv | 0 |
| wsrep_cert_deps_distance | 1.428571 |
| wsrep_apply_oooe | 0.000000 |
| wsrep_apply_oool | 0.000000 |
| wsrep_apply_window | 1.000000 |
| wsrep_commit_oooe | 0.000000 |
| wsrep_commit_oool | 0.000000 |
| wsrep_commit_window | 1.000000 |
| wsrep_local_state | 4 |
| wsrep_local_state_comment | Synced |
| wsrep_cert_index_size | 7 |
| wsrep_causal_reads | 0 |
| wsrep_incoming_addresses | 10.0.0.5:3306,10.0.0.4:3306 |
| wsrep_cluster_conf_id | 2 |
| wsrep_cluster_size | 2 |
| wsrep_cluster_state_uuid | 8e8c6dab-3618-11e5-ad69-c248ddd74c99 |
| wsrep_cluster_status | Primary |
| wsrep_connected | ON |
| wsrep_local_bf_aborts | 0 |
| wsrep_local_index | 0 |
| wsrep_provider_name | Galera |
| wsrep_provider_vendor | Codership Oy <info@codership.com> |
| wsrep_provider_version | 2.8(r165) |
| wsrep_ready | ON |
+----------------------------+--------------------------------------+
40 rows in set (0.05 sec)
mysql>
ubuntu@devstack1:~$ mysql -h 10.0.0.4 -u cp16net -pmypassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28
Server version: 5.5.37-35.0 Percona XtraDB Cluster (GPL), Release 35.0 (Ubuntu), wsrep_25.10.rXXXX
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mynewdb |
+--------------------+
2 rows in set (0.01 sec)
mysql> use mynewdb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-------------------+
| Tables_in_mynewdb |
+-------------------+
| users |
+-------------------+
1 row in set (0.02 sec)
mysql> describe users;
+-------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+----------------+
2 rows in set (0.02 sec)
mysql> insert into users set name='cp16net';
Query OK, 1 row affected (0.13 sec)
mysql> insert into users set name='food';
Query OK, 1 row affected (0.02 sec)
mysql> select * from users;
+----+---------+
| id | name |
+----+---------+
| 2 | cp16net |
| 4 | food |
| 5 | foo |
+----+---------+
3 rows in set (0.05 sec)
mysql>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment