![Page 1: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/1.jpg)
Multi-master, Active/active ClusterUsing Synchronous Replication
![Page 2: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/2.jpg)
Galera Replication Plugin
Clients
WSREP APIWSREP APIWSREP API
MySQL MySQL MySQL
![Page 3: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/3.jpg)
Galera is MySQL
● Replicates the InnoDB storage engine– all accumulated knowledge about InnoDB is applicable
– query tuning, server parameters, buffer sizes, all apply
● Compatible with existing MySQL clients and tools– XtraBackup
![Page 4: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/4.jpg)
Galera Flavors
MySQL Community Edition + Galera →
Percona Server + Galera →
MariaDB + Galera →
● All use the same replication technology● All are fully open-source● All have excellent support
![Page 5: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/5.jpg)
Galera is Flexible
● Can be single-master or multi-master– no need to redesign single-master applications to take advantage
– yet all nodes are equal when processing transactions
● Scales from one to one dozen nodes– multiple data centers and multiple nodes per data center
● Works with legacy MySQL replication– can be a master or a replica in standard asynchronous replication
– data can be shipped out to warehouses, backup, etc.
![Page 6: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/6.jpg)
Galera in OpenStack
● Can be used as a back-end database for:– Keystone
– Glance
– Neutron
– Cinder
– Nova
● Keystone and Glance databases can be shared across regions
![Page 7: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/7.jpg)
Galera in OpenStack
● Used by major companies:– MercadoLibre
– Time Warner Cable
– and more
● Used by multiple OpenStack vendors:– Mirantis, RedHat, etc.
![Page 8: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/8.jpg)
What More Can Be Done?
● Additional benefits that Galera can provide to clouds– Geo-distribution
– Galera Cluster as a service to your user
![Page 9: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/9.jpg)
Geo-distribution
node2
node1
![Page 10: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/10.jpg)
Galera WAN Replication
● Galera works across and between continents– minimal latency penalty / number of messages exchanged
● No or minimal slave lag● Optimizations reduce cross-datacenter traffic
– updates are sent only once per datacenter
– new nodes get initial database from close neighbor
● Encryption with compression● Detection and automatic eviction of unreliable nodes
![Page 11: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/11.jpg)
Geo-distribution And Scaling
node1
node4
node2
node3
![Page 12: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/12.jpg)
Use Cases for Geo-distribution
● A global, single view for global data– Replicas are consistent, with minimal or no lag
● Increased data locality– Read queries can be answered by a local node
● Increased redundancy– break out from the availability zone silos
![Page 13: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/13.jpg)
Galera-As-A-Service
● Benefits for both administrators and users– provides clear path to scale-out for users
– replacing traditional MySQL replication
![Page 14: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/14.jpg)
Benefits to Administrators
● Simplified fail-over– no need to execute complex master promotion operations
● Easy cluster scale-out– new nodes are synchronized automatically
● Galera-aware monitoring tools are available– existing MySQL monitoring works too
● Various backup mechanisms– Xtrabackup
– A dedicated node for backup purposes
![Page 15: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/15.jpg)
Benefits to End Users and Applications
● No need for read-write splitting– Instead of attempting to separate reads and writes, applications can
concentrate on proper transactional behavior
● Redundancy and scalability are built in– you can even start with a 1-node cluster and build it up from there
– MariaDB 10.1 contains Galera in the box
![Page 16: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/16.jpg)
Benefits to End Users and Applications
● No need to think of in terms of masters, primaries, secondaries, etc.– the cluster can be viewed as one single entity
– a “symbolic” master can be designated, but not required
● Fail-over is trivial– no complicated procedure to promote a new master
![Page 17: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/17.jpg)
Deployment and Automation
● Juju Charm– https://jujucharms.com/u/codership/galera-cluster/
● ClusterControl by SeveralNines● Ansible, Chef, etc. scripts● Tesora is working on Trove support
![Page 18: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/18.jpg)
Juju Charmphilip@host-91-221-67-96:~/juju$ cat galera.yamlgalera-cluster: root-password: my-root-password sst-password: my-sst-password
philip@host-91-221-67-96:~/juju$ juju deploy --config galera.yaml \cs:~codership/galera-clusterAdded charm "cs:~codership/trusty/galera-cluster-4" to the environment.
![Page 19: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/19.jpg)
philip@host-91-221-67-96:~/juju$ juju statusenvironment: amazonmachines: "0": agent-state: started agent-version: 1.22.3 dns-name: 54.91.110.84 instance-id: i-73516e8e instance-state: running series: trusty hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M availability-zone=us-east-1a state-server-member-status: has-vote "1": agent-state: pending instance-id: i-f2db1d0d series: trusty hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M availability-zone=us-east-1bservices: galera-cluster: charm: cs:~codership/trusty/galera-cluster-4 exposed: false relations: cluster: - galera-cluster units: galera-cluster/0: agent-state: allocating machine: "1"
![Page 20: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/20.jpg)
philip@host-91-221-67-96:~$ juju status galera-clusterenvironment: amazonmachines: "1": agent-state: started agent-version: 1.22.3 dns-name: 54.162.183.83 instance-id: i-f2db1d0d instance-state: running series: trusty hardware: arch=amd64 cpu-cores=1 cpu-power=100 mem=1740M root-disk=8192M availability-zone=us-east-1bservices: galera-cluster: charm: cs:~codership/trusty/galera-cluster-4 exposed: false relations: cluster: - galera-cluster units: galera-cluster/0: agent-state: started agent-version: 1.22.3 machine: "1" public-address: 54.162.183.83
![Page 21: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/21.jpg)
$ juju add-unit galera-cluster
$ juju status --format short galera-cluster
- galera-cluster/0: 54.162.183.83 (started)- galera-cluster/1: 54.147.2.106 (started)
$ juju ssh galera-cluster/0 mysql -uroot -pmy-root-password
mysql> show status like '%wsrep_cluster_size%';+--------------------+-------+| Variable_name | Value |+--------------------+-------+| wsrep_cluster_size | 2 |+--------------------+-------+1 row in set (0.00 sec)
$ juju expose galera-cluster
![Page 22: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/22.jpg)
![Page 23: Do more with Galera Cluster in your OpenStack cloud](https://reader031.vdocuments.us/reader031/viewer/2022021923/5a6780ab7f8b9a0a2e8b4d51/html5/thumbnails/23.jpg)
What is new in Galera 4.x
● Streaming Replication– large transactions are no longer a bottleneck
– distributed locking of hot rows across the cluster
– SELECT FOR UPDATE support will be possible
● Non-blocking DDL– DDL will lock tables like it does on single-node MySQL
● Better handling of failures due to inconsistency– option to shut down the cluster or continue