Manage user roles
AlloyDB Omni uses the following roles:
AlloyDB Omni includes a superuser role named
alloydbadmin, and a non-superuser role namedalloydbmetadata.The default
postgresuser has a superuser role.All other predefined user roles have no privileges. They are reserved for potential uses in the future.
Set up an AlloyDB Omni database
We recommend following these steps when setting up an AlloyDB Omni database:
Define or import your databases using the
postgresuser role. In a new installation, this role has superuser privileges.Create new user roles that have the correct level of access to your application's tables, again using the
postgresuser role.Configure your application to connect to the database using these new, limited-access roles.
You can create and define as many new user roles as you need. Don't modify or delete any of the user roles that comes with AlloyDB Omni.
For more information, see Manage AlloyDB Omni users and roles.
Install and start the AlloyDB Omni monitor
The AlloyDB Omni monitor is an optional component that exposes metrics at an endpoint. You can configure monitoring servers to fetch metric samples from this endpoint and integrate them into your monitoring stack.
To install and start the monitor, take the following steps on each host running the AlloyDB Omni service:
Install the monitor package:
sudo dnf install alloydbomni_monitorEnable and start the monitor service:
sudo systemctl enable alloydbomni_monitor sudo systemctl start alloydbomni_monitor
Configure the AlloyDB Omni monitor
By default, the monitor is configured to work with the standard AlloyDB Omni service name and data directory. If your installation uses custom values, you must configure the monitor using a systemd override file.
Check the default configuration in
/usr/lib/systemd/system/alloydbomni_monitor.service:OMNI_SERVICE_NAME: The name of the AlloyDB Omni systemd service (for example,alloydbomni18).PG_DATA_DIR: The path to the database data directory.
If you need to override these values, create an
override.conffile in the/etc/systemd/system/alloydbomni_monitor.service.ddirectory.Add the following content to the
override.conffile, replacing the values with your custom configuration:[Service] Environment="OMNI_SERVICE_NAME=alloydbomni18" Environment="PG_DATA_DIR=/data/18/db"Reload the systemd daemon:
sudo systemctl daemon-reloadRestart the monitor service:
sudo systemctl restart alloydbomni_monitor
Verify the AlloyDB Omni monitor
Verify that the monitor service is running:
sudo systemctl status alloydbomni_monitorVerify that the monitor is exposing metrics by making an HTTP call to the metrics endpoint:
curl http://localhost:9187/metrics
Monitor limitations
Metrics related to CPU and memory limits of AlloyDB Omni are
visible only if your environment has set CPU and memory limits for the
alloydbomni18 systemd service. The following metrics
are affected:
alloydb_omni_memory_limit_bytealloydb_omni_memory_available_bytealloydb_omni_node_cpu_mcpu
If you want to set CPU and memory limits, configure a systemd unit file. The
following example configures CPUQuota to 90% and MemoryMax to 90%.
For more information about systemd unit files, see
Working with systemd unit files.
Create a systemd override configuration file.
Create an
override.conffile in the/etc/systemd/system/alloydbomni18.service.ddirectory.Add the following content to the
override.conffile:[Service] CPUQuota=90% MemoryMax=90%Reload the systemd daemon:
sudo systemctl daemon-reloadRestart the AlloyDB Omni service:
sudo systemctl restart alloydbomni18
Monitor AlloyDB Omni
Monitoring your AlloyDB Omni installation includes fetching and analyzing AlloyDB Omni metrics.
To retrieve AlloyDB Omni logs, run:
sudo journalctl -u alloydbomni18Uninstall AlloyDB Omni
To uninstall AlloyDB Omni, run:
sudo dnf remove alloydbomni_monitor