#################### # keystone node #################### cream-11:~$ netstat -ant Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:35357 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:4567 0.0.0.0:* LISTEN tcp 0 0 193.206.210.164:41943 90.147.102.131:4567 ESTABLISHED tcp 0 0 193.206.210.164:52147 193.206.210.164:3306 ESTABLISHED tcp 0 0 193.206.210.164:5000 90.147.112.4:55482 CLOSE_WAIT tcp 0 0 193.206.210.164:35357 90.147.112.4:53776 CLOSE_WAIT tcp 0 176 193.206.210.164:22 90.147.41.138:50585 ESTABLISHED tcp 0 0 193.206.210.164:3306 193.206.210.164:52147 ESTABLISHED tcp 0 0 193.206.210.164:4567 90.147.112.3:56956 ESTABLISHED tcp6 0 0 :::22 :::* LISTEN cream-11:~$ sudo aptitude update cream-11:~$ sudo aptitude dist-upgrade ####### http://www.percona.com/doc/percona-xtradb-cluster/5.5/installation/apt_repo.html#apt-repo ####### cream-11:~$ sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.oX3ulz48qy --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A gpg: requesting key CD2EFD2A from hkp server keys.gnupg.net gpg: key CD2EFD2A: public key "Percona MySQL Development Team " imported gpg: Total number processed: 1 gpg: imported: 1 cream-11:~$ cat /etc/apt/sources.list.d/percona.list deb http://repo.percona.com/apt precise main deb-src http://repo.percona.com/apt precise main cream-11:~$ apt-get update cream-11:~$ cat /etc/mysql/my.cnf [mysqld] datadir=/var/lib/mysql user=mysql # Path to Galera library wsrep_provider=/usr/lib/libgalera_smm.so # Empty gcomm address is being used when cluster is getting bootstrapped wsrep_cluster_address=gcomm:// # Cluster connection URL contains the IPs of node#1, node#2 and node#3 #wsrep_cluster_address=gcomm://192.168.70.61,192.168.70.62,192.168.70.63 wsrep_cluster_address=gcomm://193.206.210.164,90.147.112.3,90.147.102.131 # In order for Galera to work correctly binlog format should be ROW binlog_format=ROW # MyISAM storage engine has only experimental support default_storage_engine=InnoDB # This is a recommended tuning variable for performance innodb_locks_unsafe_for_binlog=1 # This changes how InnoDB autoincrement locks are managed and is a requirement for Galera innodb_autoinc_lock_mode=2 # Node #1 address wsrep_node_address=193.206.210.164 # SST method wsrep_sst_method=xtrabackup # Cluster name wsrep_cluster_name=my_ubuntu_cluster # Authentication for SST method wsrep_sst_auth="XXXXX" # PASSWORD is the same on all nodes, when changed ALL should be informed. cream-11:~$ /etc/init.d/mysql start * Starting MySQL (Percona XtraDB Cluster) database server mysqld [ OK ] cream-11:~$ sudo mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.5.34-31.1 Percona XtraDB Cluster (GPL), Release 31.1, wsrep_25.9.r3928 Copyright (c) 2009-2013 Percona LLC and/or its affiliates Copyright (c) 2000, 2013, 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 status like 'wsrep%'; +--------------------------+----------------------+ | Variable_name | Value | +--------------------------+----------------------+ | wsrep_cluster_conf_id | 18446744073709551615 | | wsrep_cluster_size | 0 | | wsrep_cluster_state_uuid | | | wsrep_cluster_status | Disconnected | | wsrep_connected | OFF | | wsrep_local_bf_aborts | 0 | | wsrep_local_index | 18446744073709551615 | | wsrep_provider_name | | | wsrep_provider_vendor | | | wsrep_provider_version | | | wsrep_ready | ON | +--------------------------+----------------------+ 11 rows in set (0.01 sec) mysql> mysql> quit; Bye cream-11:~$ cat /etc/apt/sources.list.d/grizzly.list deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/grizzly main cream-11:~$ apt-get install ubuntu-cloud-keyring cream-11:~$ apt-get install python-mysqldb cream-11:~$ apt-get install keystone python-keystone python-keystoneclient cream-11:~$ sudo mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.5.34-31.1 Percona XtraDB Cluster (GPL), Release 31.1, wsrep_25.9.r3928 Copyright (c) 2009-2013 Percona LLC and/or its affiliates Copyright (c) 2000, 2013, 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 status like 'wsrep%'; +----------------------------+--------------------------------------+ | Variable_name | Value | +----------------------------+--------------------------------------+ | wsrep_local_state_uuid | 6e12b786-6316-11e3-be17-57dea5f4d77d | | wsrep_protocol_version | 4 | | wsrep_last_committed | 0 | | wsrep_replicated | 0 | | wsrep_replicated_bytes | 0 | | wsrep_received | 2 | | wsrep_received_bytes | 139 | | wsrep_local_commits | 0 | | 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.500000 | | wsrep_flow_control_paused | 0.000000 | | wsrep_flow_control_sent | 0 | | wsrep_flow_control_recv | 0 | | wsrep_cert_deps_distance | 0.000000 | | wsrep_apply_oooe | 0.000000 | | wsrep_apply_oool | 0.000000 | | wsrep_apply_window | 0.000000 | | wsrep_commit_oooe | 0.000000 | | wsrep_commit_oool | 0.000000 | | wsrep_commit_window | 0.000000 | | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | | wsrep_cert_index_size | 0 | | wsrep_causal_reads | 0 | | wsrep_incoming_addresses | 193.206.210.164:3306 | | wsrep_cluster_conf_id | 1 | | wsrep_cluster_size | 1 | | wsrep_cluster_state_uuid | 6e12b786-6316-11e3-be17-57dea5f4d77d | | 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 | | wsrep_provider_version | 2.8(r165) | | wsrep_ready | ON | +----------------------------+--------------------------------------+ 40 rows in set (0.00 sec) mysql> CREATE USER 'dbreplica'@'localhost' IDENTIFIED BY 'XXXXXXXXXX'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'dbreplica'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> show status like 'wsrep%'; +----------------------------+------------------------------------------+ | Variable_name | Value | +----------------------------+------------------------------------------+ | wsrep_local_state_uuid | 6e12b786-6316-11e3-be17-57dea5f4d77d | | wsrep_protocol_version | 4 | | wsrep_last_committed | 2 | | wsrep_replicated | 2 | | wsrep_replicated_bytes | 414 | | wsrep_received | 31 | | wsrep_received_bytes | 2456 | | wsrep_local_commits | 0 | | 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 | 0.000000 | | wsrep_apply_oooe | 0.000000 | | wsrep_apply_oool | 0.000000 | | wsrep_apply_window | 0.000000 | | wsrep_commit_oooe | 0.000000 | | wsrep_commit_oool | 0.000000 | | wsrep_commit_window | 0.000000 | | wsrep_local_state | 4 | | wsrep_local_state_comment | Synced | | wsrep_cert_index_size | 0 | | wsrep_causal_reads | 0 | | wsrep_incoming_addresses | 193.206.210.164:3306,90.147.102.131:3306 | | wsrep_cluster_conf_id | 12 | | wsrep_cluster_size | 2 | | wsrep_cluster_state_uuid | 6e12b786-6316-11e3-be17-57dea5f4d77d | | 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 | | wsrep_provider_version | 2.8(r165) | | wsrep_ready | ON | +----------------------------+------------------------------------------+ 40 rows in set (0.01 sec) mysql> mysql> quit; Bye ################## # haproxy node ################## cert-15:~$ aptitude update cert-15:~$ aptitude install haproxy cert-15:~# cat /etc/default/haproxy # Set ENABLED to 1 if you want the init script to start haproxy. ENABLED=1 # Add extra flags here. #EXTRAOPTS="-de -m 16" cert-15:~# haproxy -f /etc/haproxy/haproxy.cfg cert-15:~# ps -ef |grep hap haproxy 4429 1 0 17:33 ? 00:00:00 haproxy -f /etc/haproxy/haproxy.cfg