Before you begin
Before you scale CPU and memory resources, make sure that you have:
Scale CPU and memory resources
To scale the CPU and memory resources for your AlloyDB Omni
database cluster, update your DBCluster resource specification:
Open your
DBClusterdatabase cluster manifest file.Under the
primarySpecsection, modify thecpuandmemoryvalues in theresourcesblock:DBCluster: metadata: name: CLUSTER_NAME spec: # ... existing cluster configuration ... primarySpec: # ... existing primary configuration ... resources: cpu: CPU_COUNT memory: MEMORY_MIN limits: memory: MEMORY_MAX disks: # ...Replace the following:
CLUSTER_NAME: the name of your database cluster.CPU_COUNT: the number of CPUs available to the database instance.MEMORY_MIN: the minimum amount of memory allocated to the database instance, for example16Gi.MEMORY_MAX: the maximum amount of memory allocated to the database instance.
Apply the updated
DBClusterdatabase cluster manifest using your preferred orchestrator interface. The AlloyDB Omni orchestrator automatically restarts the database to apply the resource changes.Ansible
If you're managing your AlloyDB Omni RPM orchestrator infrastructure directly using Ansible, it triggers updates by running the appropriate playbook and passing the selected
update_actionas an extra variable.Sample file for
update.yml:--- - hosts: localhost vars: update_action: "update_resource_spec" ansible_user: your_ssh_user ansible_ssh_private_key_file: ~/path/to/private-key roles: - role: google.alloydbomni_orchestrator.updateRun the Ansible command:
ansible-playbook -i "DEPLOYMENT_SPECIFICATION" update.yml -e resource_spec="DBCLUSTER_SPECIFICATION"Replace the following variables:
DEPLOYMENT_SPECIFICATION: path to the deployment specification you created in Install AlloyDB Omni components.DBCLUSTER_SPECIFICATION: path to your cluster specification.
alloydbctlalloydbctl apply -d DEPLOYMENT_SPECIFICATION -r DBCLUSTER_SPECIFICATIONReplace the following variables:
DEPLOYMENT_SPECIFICATION: path to the deployment specification you created in Install AlloyDB Omni components.DBCLUSTER_SPECIFICATION: path to your cluster specification.