use indentation instead of backticks - driveby formatting and minor fixes

Change-Id: I3a548d7941084f862d40ccdbb59f5d4706557432
This commit is contained in:
Peter Matulis 2019-08-02 11:09:44 -04:00
parent 475b889020
commit bd12b35b80
1 changed files with 70 additions and 86 deletions

156
README.md
View File

@ -71,7 +71,6 @@ requirements and resources available.
[1] http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-6.html#mysqld-5-6-6-performance-schema [1] http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-6.html#mysqld-5-6-6-performance-schema
[2] http://www.mysqlcalculator.com/ [2] http://www.mysqlcalculator.com/
## HA/Clustering ## HA/Clustering
When more than one unit of the charm is deployed with the hacluster charm When more than one unit of the charm is deployed with the hacluster charm
@ -119,10 +118,11 @@ At a minimum, the config option 'dns-ha' must be set to true, the
defined in order to use DNS HA. defined in order to use DNS HA.
The charm will throw an exception in the following circumstances: The charm will throw an exception in the following circumstances:
If neither 'vip' nor 'dns-ha' is set and the charm is related to hacluster
If both 'vip' and 'dns-ha' are set, as they are mutually exclusive - If neither 'vip' nor 'dns-ha' is set and the charm is related to hacluster
If 'dns-ha' is set and 'os-access-hostname' is not set - If both 'vip' and 'dns-ha' are set, as they are mutually exclusive
If the 'access' binding is not set and 'dns-ha' is set, consumers of the db may not be allowed to connect - If 'dns-ha' is set and 'os-access-hostname' is not set
- If the 'access' binding is not set and 'dns-ha' is set, consumers of the db may not be allowed to connect
## MySQL asynchronous replication ## MySQL asynchronous replication
@ -166,14 +166,17 @@ alternatively these can also be provided as part of a juju native bundle configu
shared-db: internal-space shared-db: internal-space
cluster: internal-space cluster: internal-space
The 'cluster' endpoint binding is used to determine which network space units within the The 'cluster' endpoint binding is used to determine which network space units
percona-cluster deployment should use for communication with each other; the 'shared-db' within the percona-cluster deployment should use for communication with each
endpoint binding is used to determine which network space should be used for access to other; the 'shared-db' endpoint binding is used to determine which network
MySQL databases services from other charms. space should be used for access to MySQL databases services from other charms.
**NOTE:** Spaces must be configured in the underlying provider prior to attempting to use them. **NOTE:** Spaces must be configured in the underlying provider prior to
attempting to use them.
**NOTE:** Existing deployments using the access-network configuration option will continue to function; this option is preferred over any network space binding provided for the 'shared-db' relation if set. **NOTE:** Existing deployments using the access-network configuration option
will continue to function; this option is preferred over any network space
binding provided for the 'shared-db' relation if set.
# Limitations # Limitations
@ -188,25 +191,23 @@ slowest node you have in your deployment.
1. Take a backup of all the databases 1. Take a backup of all the databases
```sh juju run-action mysql/N backup
juju run-action mysql/N backup
``` * Get that backup off the mysql/N unit and somewhere safe.
* Get that backup off the mysql/N unit and somehwere safe.
```sh juju scp -- -r mysql/N:/opt/backups/mysql /path/to/local/backup/dir
juju scp -- -r mysql/N:/opt/backups/mysql /path/to/local/backup/dir
```
2. Pause all non-leader units and corresponding hacluster units. 2. Pause all non-leader units and corresponding hacluster units.
The leader node will remain up for the time being. This is to ensure the leader has the latest sequence number and will be considered the most up to date by the cluster. The leader node will remain up for the time being. This is to ensure the leader
```sh has the latest sequence number and will be considered the most up to date by
juju run-action hacluster/N pause the cluster.
juju run-action percona-cluster/N pause
``` juju run-action hacluster/N pause
juju run-action percona-cluster/N pause
3. Prepare the leader node 3. Prepare the leader node
```sh
juju upgrade-series prepare $MACHINE_NUMBER $SERIES juju upgrade-series prepare $MACHINE_NUMBER $SERIES
```
4. Administratively perform the upgrade. 4. Administratively perform the upgrade.
* do-release-upgrade plus any further steps administratively required steps for an upgrade. * do-release-upgrade plus any further steps administratively required steps for an upgrade.
@ -214,15 +215,13 @@ juju upgrade-series prepare $MACHINE_NUMBER $SERIES
5. Reboot 5. Reboot
6. Complete the series upgrade on the leader: 6. Complete the series upgrade on the leader:
```sh
juju upgrade-series complete $MACHINE_NUMBER juju upgrade-series complete $MACHINE_NUMBER
```
7. Administratively validate the leader node database is up and running 7. Administratively validate the leader node database is up and running
* Connect to the database and check for expected data * Connect to the database and check for expected data
* Review "SHOW GLOBAL STATUS;" * Review "SHOW GLOBAL STATUS;"
8. Upgrade the non-leader nodes one at a time following the same pattern summarized bellow: 8. Upgrade the non-leader nodes one at a time following the same pattern summarized bellow:
* juju upgrade-series prepare $MACHINE_NUMBER $SERIES * juju upgrade-series prepare $MACHINE_NUMBER $SERIES
@ -235,17 +234,16 @@ juju upgrade-series complete $MACHINE_NUMBER
Run action on leader node. Run action on leader node.
This action informs each node of the cluster the upgrade process is complete cluster wide. This action informs each node of the cluster the upgrade process is complete cluster wide.
This also updates mysql configuration with all peers in the cluster. This also updates mysql configuration with all peers in the cluster.
```sh
juju run-action mysql/N complete-cluster-series-upgrade juju run-action mysql/N complete-cluster-series-upgrade
```
10. Set future instance to the new series and set the source origin 10. Set future instance to the new series and set the source origin
```sh
juju set-series percona-cluster xenial juju set-series percona-cluster xenial
juju config mysql source=distro juju config mysql source=distro
```
## Documentation ## Documentation
* https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/upgrade_guide.html * https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/upgrade_guide.html
* https://www.percona.com/doc/percona-xtradb-cluster/5.6/upgrading_guide_55_56.html * https://www.percona.com/doc/percona-xtradb-cluster/5.6/upgrading_guide_55_56.html
* https://www.percona.com/blog/2014/09/01/galera-replication-how-to-recover-a-pxc-cluster/ * https://www.percona.com/blog/2014/09/01/galera-replication-how-to-recover-a-pxc-cluster/
@ -270,16 +268,14 @@ this information in the juju status.
Example `juju status` after a cold boot of `percona-cluster` Example `juju status` after a cold boot of `percona-cluster`
```sh Unit Workload Agent Machine Public address Ports Message
Unit Workload Agent Machine Public address Ports Message keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready
keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready percona-cluster/0 blocked idle 1 10.5.0.20 3306/tcp MySQL is down. Sequence Number: 355. Safe To Bootstrap: 0
percona-cluster/0 blocked idle 1 10.5.0.20 3306/tcp MySQL is down. Sequence Number: 355. Safe To Bootstrap: 0 hacluster/0 active idle 10.5.0.20 Unit is ready and clustered
hacluster/0 active idle 10.5.0.20 Unit is ready and clustered percona-cluster/1 blocked idle 2 10.5.0.17 3306/tcp MySQL is down. Sequence Number: 355. Safe To Bootstrap: 0
percona-cluster/1 blocked idle 2 10.5.0.17 3306/tcp MySQL is down. Sequence Number: 355. Safe To Bootstrap: 0 hacluster/1 active idle 10.5.0.17 Unit is ready and clustered
hacluster/1 active idle 10.5.0.17 Unit is ready and clustered percona-cluster/2* blocked idle 3 10.5.0.27 3306/tcp MySQL is down. Sequence Number: 355. Safe To Bootstrap: 0
percona-cluster/2* blocked idle 3 10.5.0.27 3306/tcp MySQL is down. Sequence Number: 355. Safe To Bootstrap: 0 hacluster/2* active idle 10.5.0.27 Unit is ready and clustered
hacluster/2* active idle 10.5.0.27 Unit is ready and clustered
```
*Note*: An application leader is denoted by any asterisk in the Unit column. *Note*: An application leader is denoted by any asterisk in the Unit column.
@ -289,25 +285,21 @@ bootstrap from any unit we choose.
In the next example the percona-cluster/2 node has the highest sequence number In the next example the percona-cluster/2 node has the highest sequence number
so we must choose that node to avoid data loss. so we must choose that node to avoid data loss.
```sh Unit Workload Agent Machine Public address Ports Message
Unit Workload Agent Machine Public address Ports Message keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready
keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready percona-cluster/0* blocked idle 1 10.5.0.20 3306/tcp MySQL is down. Sequence Number: 1318. Safe To Bootstrap: 0
percona-cluster/0* blocked idle 1 10.5.0.20 3306/tcp MySQL is down. Sequence Number: 1318. Safe To Bootstrap: 0 hacluster/0* active idle 10.5.0.20 Unit is ready and clustered
hacluster/0* active idle 10.5.0.20 Unit is ready and clustered percona-cluster/1 blocked idle 2 10.5.0.17 3306/tcp MySQL is down. Sequence Number: 1318. Safe To Bootstrap: 0
percona-cluster/1 blocked idle 2 10.5.0.17 3306/tcp MySQL is down. Sequence Number: 1318. Safe To Bootstrap: 0 hacluster/1 active idle 10.5.0.17 Unit is ready and clustered
hacluster/1 active idle 10.5.0.17 Unit is ready and clustered percona-cluster/2 blocked idle 3 10.5.0.27 3306/tcp MySQL is down. Sequence Number: 1325. Safe To Bootstrap: 0
percona-cluster/2 blocked idle 3 10.5.0.27 3306/tcp MySQL is down. Sequence Number: 1325. Safe To Bootstrap: 0 hacluster/2 active idle 10.5.0.27 Unit is ready and clustered
hacluster/2 active idle 10.5.0.27 Unit is ready and clustered
```
## Bootstrap the node with the highest sequence number ## Bootstrap the node with the highest sequence number
Run the `bootstrap-pxc` action on the node with the highest sequence number. In Run the `bootstrap-pxc` action on the node with the highest sequence number. In
this example, it is unit percona-cluster/2, which happens to be a non-leader. this example, it is unit percona-cluster/2, which happens to be a non-leader.
```sh juju run-action --wait percona-cluster/2 bootstrap-pxc
juju run-action --wait percona-cluster/2 bootstrap-pxc
```
## Notify the cluster of the new bootstrap UUID ## Notify the cluster of the new bootstrap UUID
@ -315,16 +307,14 @@ In the vast majority of cases, once the `bootstrap-pxc` action has been run and
the model has settled the output to the `juju status` command will now look the model has settled the output to the `juju status` command will now look
like this: like this:
```sh Unit Workload Agent Machine Public address Ports Message
Unit Workload Agent Machine Public address Ports Message keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready
keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready percona-cluster/0* waiting idle 1 10.5.0.20 3306/tcp Unit waiting for cluster bootstrap
percona-cluster/0* waiting idle 1 10.5.0.20 3306/tcp Unit waiting for cluster bootstrap hacluster/0* active idle 10.5.0.20 Unit is ready and clustered
hacluster/0* active idle 10.5.0.20 Unit is ready and clustered percona-cluster/1 waiting idle 2 10.5.0.17 3306/tcp Unit waiting for cluster bootstrap
percona-cluster/1 waiting idle 2 10.5.0.17 3306/tcp Unit waiting for cluster bootstrap hacluster/1 active idle 10.5.0.17 Unit is ready and clustered
hacluster/1 active idle 10.5.0.17 Unit is ready and clustered percona-cluster/2 waiting idle 3 10.5.0.27 3306/tcp Unit waiting for cluster bootstrap
percona-cluster/2 waiting idle 3 10.5.0.27 3306/tcp Unit waiting for cluster bootstrap hacluster/2 active idle 10.5.0.27 Unit is ready and clustered
hacluster/2 active idle 10.5.0.27 Unit is ready and clustered
```
If you observe the above output ("Unit waiting for cluster bootstrap") then the If you observe the above output ("Unit waiting for cluster bootstrap") then the
`notify-bootstrapped` action needs to be run on a unit. There are two `notify-bootstrapped` action needs to be run on a unit. There are two
@ -338,24 +328,18 @@ possibilities:
In the current example, the first action was run on a non-leader so we'll run In the current example, the first action was run on a non-leader so we'll run
the second action on the leader, percona-cluster/0: the second action on the leader, percona-cluster/0:
```sh juju run-action percona-cluster/0 notify-bootstrapped --wait
juju run-action percona-cluster/0 notify-bootstrapped --wait
```
After the model settles, the ouput should show all nodes in active and ready After the model settles, the output should show all nodes in active and ready
state: state:
```sh Unit Workload Agent Machine Public address Ports Message
Unit Workload Agent Machine Public address Ports Message keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready
keystone/0* active idle 0 10.5.0.32 5000/tcp Unit is ready percona-cluster/0* active idle 1 10.5.0.20 3306/tcp Unit is ready
percona-cluster/0* active idle 1 10.5.0.20 3306/tcp Unit is ready hacluster/0* active idle 10.5.0.20 Unit is ready and clustered
hacluster/0* active idle 10.5.0.20 Unit is ready and clustered percona-cluster/1 active idle 2 10.5.0.17 3306/tcp Unit is ready
percona-cluster/1 active idle 2 10.5.0.17 3306/tcp Unit is ready hacluster/1 active idle 10.5.0.17 Unit is ready and clustered
hacluster/1 active idle 10.5.0.17 Unit is ready and clustered percona-cluster/2 active idle 3 10.5.0.27 3306/tcp Unit is ready
percona-cluster/2 active idle 3 10.5.0.27 3306/tcp Unit is ready hacluster/2 active idle 10.5.0.27 Unit is ready and clustered
hacluster/2 active idle 10.5.0.27 Unit is ready and clustered
```
The percona-cluster is now back to a clustered and healthy state. The percona-cluster is now back to a clustered and healthy state.
### Documentation