AlloyDB Omni in Google VMware Engine

Overview

Objective

Install AlloyDB Omni on a Ubuntu VM running in VMware Engine.

Prerequisites

Setup on Ubuntu

  1. Add alloydb key and update
1curl https://us-apt.pkg.dev/doc/repo-signing-key.gpg | sudo apt-key add -
2sudo apt update
  1. Add repo
1echo "deb https://us-apt.pkg.dev/projects/alloydb-omni alloydb-omni-apt main" | sudo tee -a /etc/apt/sources.list.d/artifact-registry.list
2sudo apt update
  1. Finally install alloydb-cli. We will use this to install alloydb in the next section.
1sudo apt-get install alloydb-cli

Install alloydb with alloydb-cli

  1. Verify you meet the prerequisites
1sudo alloydb system-check

Starting system check for AlloyDB Omni on local machine...
Checking for minimum of 2 vCPUs...SUCCESS
└─Detected 4 vCPUs. Checking for minimum of 2.00GB of RAM...SUCCESS
└─Detected total RAM: 15.61GB.
Checking for Linux kernel...SUCCESS
└─Linux kernel detected.
Checking Linux kernel version is 4.10+...SUCCESS
└─Linux kernel version: 6.2.0-35-generic
Checking Linux distribution is Debian-based or RHEL...SUCCESS
└─Compatible Debian-based distribution detected.
Checking cgroups v2 is enabled...SUCCESS
└─cgroups v2 is enabled.
Checking Docker is installed...SUCCESS
└─Docker installation found.
Checking Docker daemon is running...SUCCESS
└─Docker service is currently active.
Checking Docker server version is 20.10+...SUCCESS
└─Compatible Docker server version: 24.0.6
Checking for conflicting pre-existing users...SUCCESS
└─User postgres exists with expected ID 2345.
System check passed. Your machine meets the requirements to run AlloyDB Omni.

  1. Create a data directory
1mkdir alloydb
  1. Install AlloyDB Server
1sudo alloydb database-server install --data-dir=/home/gcveadmin/alloydb

Starting system check for AlloyDB Omni on local machine...

Checking for minimum of 2 vCPUs...SUCCESS
└─Detected 4 vCPUs.
Checking for minimum of 2.00GB of RAM...SUCCESS
└─Detected total RAM: 15.61GB.
Checking for Linux kernel...SUCCESS
└─Linux kernel detected.
Checking Linux kernel version is 4.10+...SUCCESS
└─Linux kernel version: 6.2.0-35-generic
Checking Linux distribution is Debian-based or RHEL...SUCCESS
└─Compatible Debian-based distribution detected.
Checking cgroups v2 is enabled...SUCCESS
└─cgroups v2 is enabled.
Checking Docker is installed...SUCCESS
└─Docker installation found.
Checking Docker daemon is running...SUCCESS
└─Docker service is currently active.
Checking Docker server version is 20.10+...SUCCESS
└─Compatible Docker server version: 24.0.6
Checking for conflicting pre-existing users...SUCCESS
└─User postgres exists with expected ID 2345.

System check passed.
Initializing AlloyDB Omni instance...
Creating postgres user...
Copying installation files...
Creating AlloyDB Omni directories...
Installing systemd services...
Updating data plane configuration file...

AlloyDB Omni has been successfully installed.
Use "alloydb database-server start" to create the data plane containers.

  1. Start AlloyDB
1sudo alloydb database-server start
  1. Verify the memory-agent and pg-services containers are up.
1docker ps -a
2
3CONTAINER ID   IMAGE                                     COMMAND                  CREATED          STATUS          PORTS     NAMES
4f4234a6ddfe6   gcr.io/alloydb-omni/memory-agent:15.2.1   "/cgmon --logtostder…"   28 minutes ago   Up 28 minutes             memory-agent
579ccdd6b18c9   gcr.io/alloydb-omni/pg-service:15.2.1     "/bin/bash /smurf-sc…"   28 minutes ago   Up 28 minutes             pg-service

Create a Database

In this example I will be creating a Horizon View Events database.

  1. Connect to psql inside of the pg-service container.
1docker exec -it pg-service psql -h localhost -U postgres
  1. Create a database user. We will use vdi in this example.
1postgres=# CREATE USER vdi WITH PASSWORD 'PASSWORD';
  1. Create a database and assign an owner. We create a DB named gcvevdi and assign vdi as the owner.
1postgres=# CREATE DATABASE gcvevdi WITH OWNER vdi;
  1. Verify the database was created with \list or \l