Manage and monitor AlloyDB Omni

Select a documentation version:

This page describes how to manage AlloyDB Omni user roles, monitor the activity of your AlloyDB Omni server, and update or remove your AlloyDB Omni installation.

Manage user roles

AlloyDB Omni uses the following roles:

  • AlloyDB Omni includes a superuser role named alloydbadmin, and a non-superuser role named alloydbmetadata.

  • The default postgres user 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:

  1. Define or import your databases using the postgres user role. In a new installation, this role has superuser privileges.

  2. Create new user roles that have the correct level of access to your application's tables, again using the postgres user role.

  3. 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:

  1. Install the monitor package:

     sudo dnf install alloydbomni_monitor
  2. Enable 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.

  1. 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.
  2. If you need to override these values, create an override.conf file in the /etc/systemd/system/alloydbomni_monitor.service.d directory.

  3. Add the following content to the override.conf file, replacing the values with your custom configuration:

     [Service]
     Environment="OMNI_SERVICE_NAME=alloydbomni18"
     Environment="PG_DATA_DIR=/data/18/db"
    
  4. Reload the systemd daemon:

     sudo systemctl daemon-reload
  5. Restart the monitor service:

     sudo systemctl restart alloydbomni_monitor

Verify the AlloyDB Omni monitor

  1. Verify that the monitor service is running:

     sudo systemctl status alloydbomni_monitor
  2. Verify 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_byte
  • alloydb_omni_memory_available_byte
  • alloydb_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.

  1. Create a systemd override configuration file.

    Create an override.conf file in the /etc/systemd/system/alloydbomni18.service.d directory.

  2. Add the following content to the override.conf file:

     [Service]
     CPUQuota=90%
     MemoryMax=90%
    
  3. Reload the systemd daemon:

     sudo systemctl daemon-reload
  4. Restart 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 alloydbomni18

Uninstall AlloyDB Omni

To uninstall AlloyDB Omni, run:

  sudo dnf remove alloydbomni_monitor