Install AlloyDB Omni

This page shows how to download and install AlloyDB Omni into your own Linux-based computing environment.

Before you begin

Before you install AlloyDB Omni, ensure you meet the following system requirements:

  • A virtual or physical machine running a Debian-based OS, such as Debian or Ubuntu, or Red Hat Enterprise Linux (RHEL) version 8 or higher.
  • A minimum of 2 CPUs, with x86/AMD64 architecture.
  • A minimum of 2 GB of RAM. For optimal performance, we recommend allocating 8 GB of RAM for each CPU.
  • At least 20 GB of available storage.
  • Unrestricted root access within the OS.
  • Docker version 20.10 or higher.
  • Linux kernel version 4.18 or higher. We recommend kernel version 5.3 or higher for best performance.
  • Linux cgroup v2 enabled.

    By default, cgroup v2 is enabled on most modern Linux systems. To check whether cgroup v2 is enabled, run stat -fc %T /sys/fs/cgroup/ in a shell. If cgroup v2 is enabled, the command output shows cgroup2fs.

    To enable cgroup v2 on RHEL 8, see Using cgroups-v2.

  • The Google Cloud CLI.

    If you do need to install the gcloud CLI, note that the step of running gcloud init is optional. Installing AlloyDB Omni does not require authentication with a Google Account.

  • TCP port 5432 not in use by any other service.

We recommend the use of a dedicated SSD storage device for storing your data. If you use a physical device for this purpose, we recommend attaching it directly to the host machine.

If you are installing AlloyDB Omni on a cloud platform, then we recommend using the following instance types:

  • On Google Cloud, we recommend n2-highmem instances.
  • On Amazon Web Services, we recommend R6i instances.
  • On Microsoft Azure, we recommend Ebsv5 instances.

Download and install AlloyDB Omni

  1. Install the AlloyDB Omni CLI.

  2. Use the AlloyDB Omni CLI to confirm that your Linux machine is ready to install AlloyDB Omni:

    sudo alloydb system-check
    
  3. If needed, modify your system until the output of the previous command shows a successful check.

  4. Optional: If you want to create a new disk partition for AlloyDB Omni to use for data storage, we recommend an ext4 file system for optimal performance.

    1. To create an ext4 file system, use the following command:
    mkfs.ext4 -m 1 -F "$disk_path"
    
    1. To mount your disk, use the following command:
    mount --make-shared -o noatime,discard,errors=panic "$disk_path" "$disk_mountpoint"
    
  5. Create an empty data directory on your local file system:

    mkdir DATA_DIR
    

    Replace DATA_DIR with the file system path you want AlloyDB Omni to use for its data directory.

  6. Install the server software.

    To configure the server as a primary instance, run the following command:

    sudo alloydb database-server install --data-dir=$(realpath DATA_DIR)
    

    To configure the server as a read replica, include the --replica-source-ip flag:

    sudo alloydb database-server install \
        --data-dir=$(realpath DATA_DIR) \
        --replica-source-ip=SOURCE_IP
    

    Replace SOURCE_IP with the IP address of the primary AlloyDB Omni instance to replicate from.

    For more information on AlloyDB Omni read replicas, see Create a read-only replica.

  7. Optional: If your machine runs RHEL, then ensure that the correct vm.swappiness value is retained across reboots of your machine. To do this, update /usr/lib/tuned/virtual-guest/tuned.conf with vm.swappiness=1.

Install AlloyDB Omni with ML integration

You can enable ML integration when you install AlloyDB Omni. The Preview edition of AlloyDB Omni lets you integrate with Vertex AI to query cloud-based ML models. The separate Technology Preview of AlloyDB Omni also includes two locally stored, Google-trained models that you can experiment with. Both editions of AlloyDB Omni let you work with online predictions and vector embeddings generated from ML models.

For more information about the ML functionality of AlloyDB, see Build generative AI applications.

Use AlloyDB Omni with cloud-based models

To install AlloyDB Omni with the ability to query cloud-based models using Vertex AI, follow these steps:

  1. Create a service account with Google Cloud.

  2. Create a service account key, in JSON format, and download it.

  3. Store the key in a permanent location on your file system. It resides at this location for the lifetime of your AlloyDB Omni server.

    Note its location on your file system; you need it for the next step.

  4. Add Vertex AI Identity and Access Management (IAM) permissions to the appropriate project and service account.

    gcloud projects add-iam-policy-binding PROJECT_ID \
        --member="serviceAccount:SERVICE_ACCOUNT_ID" \
        --role="roles/aiplatform.user"
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.

    • SERVICE_ACCOUNT_ID: the ID of the service account that you created in the previous step. This includes the full @PROJECT_ID.iam.gserviceaccount.com suffix. For example: my-service@my-project.iam-gserviceaccount.com.

  5. Follow all of the steps in Download and install AlloyDB Omni, substituting the following for the final sudo alloydb database-server install command:

    sudo alloydb database-server install \
        --data-dir=DATA_DIR \
        --enable-alloydb-ai=true \
        --private-key-file-path=KEY_PATH \
        --vertex-ai-region="us-central1"
    

    Replace the following:

    • DATA_DIR: the file system path that you want AlloyDB Omni to use for its data directory

    • KEY_PATH: the file system path to the service account key that you downloaded in the previous step

Preview AlloyDB Omni AI using local models

The AlloyDB Omni Technology Preview is a separate edition of AlloyDB Omni that lets you experiment with the product's AI functionality using two locally stored models:

Both have been pre-trained by Google, using a Google News data corpus. This makes them well suited for AI experiments where you run queries based on news stories.

The Technology Preview is intended only to let you experiment with AlloyDB Omni AI features using offline models. Google does not offer support for features specific to the Technology Preview, and might change or remove these features in future versions of AlloyDB Omni.

Use AlloyDB Omni with cloud-based and local models

To install the Technology Preview of AlloyDB Omni, with the ability to query either cloud-based or locally stored models, follow these steps:

  1. Create a service account with Google Cloud.

  2. Create a service account key, in JSON format, and download it.

  3. Store the key in a permanent location on your file system. It resides at this location for the lifetime of your AlloyDB Omni server.

    Note its location on your file system; you need it for the next step.

  4. Follow all of the steps in Download and install AlloyDB Omni, substituting the following for the final sudo alloydb database-server install command:

    sudo alloydb database-server install \
        --data-dir=DATA_DIR \
        --enable-alloydb-ai-tech-preview=true \
        --private-key-file-path=KEY_PATH \
        --vertex-ai-region="us-central1"
    

    Replace the following:

    • DATA_DIR: the file system path that you want AlloyDB Omni to use for its data directory

    • KEY_PATH: the file system path to the service account key that you downloaded in the previous step

Use AlloyDB Omni with local models only

If you intend to use only the local models that come bundled with AlloyDB Omni Technology Preview, without the need to integrate with Vertex AI, then you do not need to use a Google Cloud service account with AlloyDB Omni.

Follow all of the steps in the previous section, substituting the following for the final sudo alloydb database-server install command:

sudo alloydb database-server install \
    --data-dir=DATA_DIR \
    --enable-alloydb-ai-tech-preview=true \

What's next