Introduction/FAQQuestion: I need to run a production-grade open source MySQL DB.
Answer: Percona to the rescue! Percona XtraDB Cluster (PXC) is an open source enterprise MySQL solution that helps you to ensure data availability for your applications while improving security and simplifying the development of new applications in the most demanding public, private, and hybrid cloud environments
Question: I forgot to mention that I need to run it on Kubernetes.
Answer: Percona to the rescue again! Percona Distribution for MySQL Operator based on Percona XtraDB Cluster contains everything you need to quickly and consistently deploy and scale Percona XtraDB Cluster instances in a Kubernetes-based environment on-premises or in the cloud.
Question: I have a lot of MySQL configurations to manage.
Answer: PXC Operator makes it easy to manage MySQL Configurations. Let’s explore.
For the rest of the article, the name of the PXC cluster is assumed to be cluster1, and this can be modified based on the user preference.
If you have not done it already, the first thing to do is install the PXC operator. Our Quickstart guide gives detailed instructions on how to get started.
There are three possible ways to modify the MySQL configurations as described in the Documentation for MySQL options:
The choice of using the above options depends on the use case and the user’s preferences.
Following are some examples:
Using ConfigMap
Using Secrets
Any changes in MySQL configurations will generally recycle the pods in reverse order if the RollingUpdate strategy is used.
Example: If three replicas are used for the PXC cluster, cluster1-pxc-[0,1,2] pods would be created. When MySQL configuration is changed, cluster1-pxc-2 will be terminated first and the system will wait till the new pod cluster1-pxc-2 starts running and becomes healthy, then cluster1-pxc-1 will be terminated, and so on.
Following are the changes observed with the watch command.
|
1 |
# kubectl get po -l app.kubernetes.io/component=pxc --watch<br>NAME READY STATUS RESTARTS AGE<br>cluster1-pxc-0 3/3 Running 0 8m23s<br>cluster1-pxc-1 3/3 Running 0 10m<br>cluster1-pxc-2 3/3 Running 0 13m<br>cluster1-pxc-2 3/3 Terminating 0 13m<br>cluster1-pxc-2 0/3 Terminating 0 14m<br>cluster1-pxc-2 0/3 Pending 0 0s<br>cluster1-pxc-2 0/3 Init:0/1 0 1s<br>cluster1-pxc-2 0/3 PodInitializing 0 8s<br>cluster1-pxc-2 2/3 Running 0 10s<br>cluster1-pxc-2 3/3 Running 0 2m<br>cluster1-pxc-1 3/3 Terminating 0 14m<br>cluster1-pxc-1 0/3 Terminating 0 14m<br>cluster1-pxc-1 0/3 Pending 0 0s<br>cluster1-pxc-1 0/3 Init:0/1 0 1s<br>cluster1-pxc-1 0/3 PodInitializing 0 6s<br>cluster1-pxc-1 2/3 Running 0 8s<br>cluster1-pxc-1 3/3 Running 0 2m1s<br>cluster1-pxc-0 3/3 Terminating 0 13m<br>cluster1-pxc-0 0/3 Terminating 0 14m<br>cluster1-pxc-0 0/3 Pending 0 0s<br>cluster1-pxc-0 0/3 Init:0/1 0 0s<br>cluster1-pxc-0 0/3 PodInitializing 0 6s<br>cluster1-pxc-0 2/3 Running 0 8s<br>cluster1-pxc-0 3/3 Running 0 2m<br> |
In part two, we see the precedence and the changes happening while modifying MySQL configurations. Check it out!
Resources
RELATED POSTS