Before you begin
Make sure that you have the deployment specification file,
deployment_spec.yaml, which contains all your node and cluster components
details.
Upgrade the orchestrator
The orchestrator manages your database clusters. You must upgrade the orchestrator on your control node before upgrading the other cluster components.
Ansible
If you manage your infrastructure by using Ansible playbooks, complete the following steps:
Check the installed version of the
google.alloydbomni_orchestratorcollection on your control node by running the following command:ansible-galaxy collection list | grep alloydbomni_orchestratorTo overwrite your existing version, download the latest stable release of the collection tar file and perform a forced installation:
ansible-galaxy collection install --force google-alloydbomni_orchestrator-NEW_VERSION.tar.gzReplace
NEW_VERSIONwith the version of the new collection.
alloydbctl
If you use the alloydbctl command-line tool, complete the following
steps:
To check the installed package version of the RPM orchestrator
alloydbomni_orchestratoron your control node, run the following command:rpm -q alloydbomni_orchestratorUpgrade the software package on your control node by using the package manager:
sudo dnf upgrade alloydbomni_orchestrator
Update cluster components using Ansible
Google recommends that you update by using the provided Ansible role.
Create a playbook named
update.yamlthat references theupdaterole from the orchestrator collection. You must set theupdate_actionparameter value toupdate_rpm.By default, the
updaterole updates both control plane and data plane. To update only control or data plane components, set the parameter for the other plane tofalse.--- - hosts: all become: true vars: update_action: "update_rpm" ansible_user: SSH_USER ansible_ssh_private_key_file: PRIVATE_KEY_PATH update_control_plane: true # Optional argument if you want to only update data plane components update_data_plane: true # Optional argument if you want to only update control plane components roles: - role: google.alloydbomni_orchestrator.updateReplace the following:
SSH_USER: the SSH username that has access to your cluster nodes.PRIVATE_KEY_PATH: the path to your private SSH key file.update_action: the scope of the update. Set this value toupdate_rpm.update_control_plane: optional. Set tofalseto update only data plane components. The default istrue.update_data_plane: optional. Set tofalseto update only control plane components. The default istrue.
To perform an update across all specified nodes, run the playbook with your inventory file:
ansible-playbook -i DEPLOYMENT_SPEC update.yamlReplace
DEPLOYMENT_SPECwith the path to your deployment specification file.Make sure that your deployment specification file defines the installed version for each component in your cluster. The update role updates components based on how you configure their versions in the inventory file:
- If a component's version matches the installed version, the update role makes no changes to that component.
- If you change a component's version to a specific target version, it updates the component to that version.
- If you leave a component's version field empty, it updates the component to the latest available version in the configured repository.
Update cluster components manually
If you are not using the Ansible orchestrator or if you want granular control over the update process, you can update RPM components manually for each node in your cluster. It is recommended to perform software updates during the scheduled maintenance window.
The manual update process involves updating the following two planes:
Control plane (RPM orchestrator components): The control plane is the layer that controls and manages your database clusters. In an RPM deployment, the control plane includes the
cluster_manager,node_manager, andetcd.Data plane (Database cluster): The data plane contains the database cluster components, including the AlloyDB Omni database engine itself,
monitor, as well as services such aspgBackRest,PgBouncer,keepalived, andHAProxy. Upgrading the data plane applies database version updates, security patches, and performance improvements directly to your database clusters.
Regardless of your reference architecture, the steps to update the control plane remain the same. You must update the control plane components before you update the data plane. The steps to update your data plane differ based on your database deployment architecture.
To update a service or package, perform the following steps:
Stop the service:
sudo systemctl stop SERVICEUpgrade the package by using one of the following commands:
To update to the latest available version:
sudo dnf upgrade PACKAGETo update to a specific version:
sudo dnf upgrade PACKAGE-VERSION
Start the service:
sudo systemctl start SERVICE
Replace the following:
SERVICE: the name of the service to stop and start, for examplepgbouncerorkeepalived.PACKAGE: the name of the package to update, for examplepgbounceroralloydbomni18.VERSION: the target package version to install, for example18.3.0or18.3.0-2.rhel9.
Update the control plane manually
To update the control plane, perform the following steps on the designated nodes:
To stop the cluster manager on all cluster manager nodes, run the following command:
sudo systemctl stop alloydbomni_cluster_managerTo update
etcdon all DCS nodes, run the following commands in sequence:sudo systemctl stop etcdsudo dnf upgrade etcdsudo systemctl start etcdTo update the node manager on all nodes, run the following commands in sequence:
sudo systemctl stop alloydbomni_node_managersudo dnf upgrade alloydbomni_node_managersudo systemctl start alloydbomni_node_managerAfter updating the control plane components, you can update the cluster manager on all cluster manager nodes, and restart it if necessary.
sudo dnf upgrade alloydbomni_cluster_managersudo systemctl start alloydbomni_cluster_manager
Update the data plane manually
To update the data plane, update the database and helper services in the order specified for your deployment architecture. For each service, you must follow a strict sequence of stopping the service, upgrading the package, and starting the service.
Follow the instructions for your deployment depending on the reference architecture.
Retrieve your cluster status using the
alloydbctl getcommand and set the output format to YAML:alloydbctl get -d DEPLOYMENT_SPEC -t RESOURCE_TYPE -n CLUSTER_NAME -o yamlReplace the following:
RESOURCE_TYPE: the resource type to inspect, for exampleDBCluster.CLUSTER_NAME: the name of your database cluster.DEPLOYMENT_SPEC: the path to your deployment specification file.
In the YAML output, note the
instanceListunder thestatussection.Find the node that has its role set to
Primary. All other database nodes are your standby nodes.Update all data plane components running on standby nodes first and then update those components on the primary node. Use the following steps to update the data plane components on each node.
To update AlloyDB Omni, run the following commands in sequence:
sudo systemctl stop alloydbomni18sudo dnf upgrade alloydbomni18sudo systemctl start alloydbomni18To update the monitor, run the following commands in sequence:
sudo systemctl stop alloydbomni_monitorsudo dnf upgrade alloydbomni_monitorsudo systemctl start alloydbomni_monitorTo update pgBackRest, run the following commands in sequence:
sudo dnf upgrade pgbackrestTo update PgBouncer, run the following commands in sequence:
sudo systemctl stop pgbouncersudo dnf upgrade pgbouncersudo systemctl start pgbouncerTo update keepalived, run the following commands in sequence:
sudo systemctl stop keepalivedsudo dnf upgrade keepalivedsudo systemctl start keepalivedTo update HAProxy, run the following commands in sequence:
sudo systemctl stop haproxysudo dnf upgrade haproxysudo systemctl start haproxy