This page shows you how to download, install, and connect to AlloyDB Omni. To get started quickly with AlloyDB Omni using the default configuration, see Install AlloyDB Omni on Debian or Ubuntu.
In this document, you also learn how to do the following:
- Create a new disk partition to optimize data storage.
- Configure your server.
- Ensure compatibility with Debian, Ubuntu, and RHEL.
Before you begin
System requirements
Debian
- A virtual or physical machine running a Debian-based OS, such as Debian or Ubuntu.
- 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 showscgroup2fs
. If you want to integrate with Vertex AI, then you need the Google Cloud CLI available in your environment.
- To install AlloyDB Omni on a cloud
platform, 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.
- On Google Cloud, we recommend
- We recommend that you use 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.
RHEL
- A virtual or physical machine running a Red Hat Enterprise Linux (RHEL) version 8 or later. To let the automatic memory management features of AlloyDB Omni work, use RHEL version 9 or later.
- 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 showscgroup2fs
. If you want to integrate with Vertex AI, then you need the Google Cloud CLI available in your environment.
- To install AlloyDB Omni on a cloud
platform, 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.
- On Google Cloud, we recommend
- We recommend that you use 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.
Download and install AlloyDB Omni
Use the AlloyDB Omni CLI to confirm that your Linux machine is ready to install AlloyDB Omni:
sudo alloydb system-check
If needed, modify your system until the output of the
system-check
command returns a successful check.Optional: To create a new disk partition for AlloyDB Omni to use for data storage, we recommend that you use an
ext4
file system for optimal performance.To create an
ext4
file system, use the following command:mkfs.ext4 -m 1 -F "$disk_path"
To mount your disk, use the following command:
mount --make-shared -o noatime,discard,errors=panic "$disk_path" "$disk_mountpoint"
Install the server software using one of the following options:
To configure the server as a primary instance, run the following command:
sudo alloydb database-server install --data-dir=$(realpath DATA_DIR)
Replace
DATA_DIR
with the directory on your local file system where you want AlloyDB Omni to store its data, metadata, and configuration files. AlloyDB Omni tries to create this directory if it doesn't already exist. If you don't specify this value, then AlloyDB Omni defaults to/var/alloydb/main/
.To have AlloyDB Omni listen for connections on a TCP port other than the default
5432
, include the--pg-port
flag:sudo alloydb database-server install \ --data-dir=$(realpath DATA_DIR) \ --pg-port=PORT
Replace
PORT
with the TCP port that you want AlloyDB Omni to accept connections on.To configure the server as a read replica, include the
--replica-source-ip
and--replica-source-port
flags:sudo alloydb database-server install \ --data-dir=$(realpath DATA_DIR) \ --replica-source-ip=SOURCE_IP \ --replica-source-port=SOURCE_PORT
Replace the following:
DATA_DIR
: the directory on your local file system where you want AlloyDB Omni to store its data, metadata, and configuration files. AlloyDB Omni tries to create this directory if it doesn't already exist. If you don't specify this value, then AlloyDB Omni defaults to/var/alloydb/main/
.SOURCE_IP
: the IP address of the primary AlloyDB Omni instance to replicate from.SOURCE_PORT
: the TCP port of the primary AlloyDB Omni instance to replicate from. If you don't provide this value, then AlloyDB Omni applies a default value of5432
.
For more information on AlloyDB Omni read replicas, see Create a read-only replica.
If your system runs Red Hat Enterprise Linux, then update the
/usr/lib/tuned/virtual-guest/tuned.conf
file with the following:vm.swappiness=1
Connect to and use the database server
Connect to AlloyDB Omni using psql
:
sudo docker exec -it pg-service psql -h localhost -U postgres
The terminal window displays psql
login text that ends with a
postgres=#
prompt.