Restart Mysql PXC restart after updating my.cnf

Hi,
With the sample given I’m able to bring up 3 nodes PXC. I’m having dew queries on the configuration.

  1. I need to change the configuration by updating my.cnf. After updating the my.cnf how can I restart the mysql to take up the new configuration ? They mentioned this is the way (Changing MySQL Options) but not mentioned how to restart the mysql in each node.
  2. Is there is a way I can login to the container and update the my.cnf and restart the mysql process inside the container ? If I try to use “systemctl start mysqld” i’m getting the error as “System has not been booted with systemd as init system (PID 1). Can’t operate.Failed to connect to bus: Host is down”
  3. Is there is a way I can bootstrap the pxc nodes. Usually when I run the pxc in the VMs, I bring the 1st node in the bootstrap mode by the command “systemctl start mysqld@bootstrap” and then start mysql on other 3 nodes so that those nodes are added to the cluster and that I’ll stop the bootstrap process in the 1st node and start the 1st node in normal mode". How to do the same in the pxc cluster on k8s.
  4. Actually I’m moving PXC on VMs to PXC on K8S, is there will be any known issue or performance degrade ?
  5. Is there is any document available mentioning about the various operations related to node bootstrap, restarting the cluster, etc in the percona k8s operator ?

Thanks in Advance.
Arun V

1 Like

Hello @Arun_Viswanath,

  1. Using Kubectl to Restart a Kubernetes Pod
  2. Don’t do this. If you log in to a pod and change my.cnf those changes will be lost if the pod restarts. Use K8S to manage the my.cnf
  3. The operator does this for you. The operator handles bootstrap process.
  4. You’ll probably get better performance on K8S since you won’t be using the VM layer anymore
  5. The operator handles all of these operations, including backups. Read all of the Operator documentation on our site for complete details.
1 Like

@matthewb Thanks a lot for your quick reply.
Following on your response here is few more questions.

  1. As per the document “Changing MySQL Options - Percona Operator for MySQL based on Percona XtraDB Cluster” we need to create a configmap with name “cluster1-pxc” and this config map will be attached to all the pods in the file system “/etc/mysql/node.cnf”. But we need different my.cnf entries for each pod since the value of admin-address, server_id, wsrep_cluster_address, etc is unique to the pod. Since we are deploying using the “cr.yaml” file how to create unique my.cnf for each pod.
  2. Also there is a note “Do not forget to restart Percona XtraDB Cluster to ensure the cluster has updated the configuration.”, but there is no doc says how to restart the PXC.
  3. Can you please point me the doc where can I get more details about the architecture and capabilities of this operator ?

Thanks In Advance,
Arun V

1 Like
  1. server_id and wsrep_cluster_address are handled by the operator. If you need to change other parameters, you would probably need to create another configMap for each node. However, this is extremely uncommon. The entire point of having a cluster in K8S is that each node has the same config as every other node.
  2. Restart PXC == Restart Pod. Same thing.
  3. Percona Operator for MySQL based on Percona XtraDB Cluster
1 Like