1 - Prerequisites for Essential installation
============================================

This guide takes you through the steps to install EDB Postgres
Distributed (PGD) Essential on your systems.

If you want to install a learning/test environment, we recommend using
the :ref:`PGD First Cluster <Creating your first cluster (PGD Essential)>`  .

..  Note::
   If you want to install EDB Postgres Distributed (PGD) Expanded, consult the  :ref:`Expanded installation guide <1 - Prerequisites for Essential installation>`  .

Provisioning hosts
------------------

The first step in the process of deploying PGD is to provision and
configure hosts.

You can deploy to virtual machine instances in the cloud with Linux
installed, on-premises virtual machines with Linux installed, or
on-premises physical hardware, also with Linux installed.

Whichever :ref:`supported Linux operating system <PGD compatibility>`  and whichever deployment platform you select,
the result of provisioning a machine must be a Linux system that you can
access using SSH with a user that has superuser, administrator, or sudo
privileges.

Each machine provisioned must be able to make connections to any other
machine you’re provisioning for your cluster.

On cloud deployments, you can do this over the public network or over a
VPC.

On-premises deployments must be able to connect over the local network.

..  Note Cloud provisioning guides::
   If you're new to cloud provisioning, these guides may provide assistance:

Vendor \| Platform \| Guide —— \| ——– \| —— Amazon \| AWS \|
`Tutorial: Get started with Amazon EC2 Linux instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html>`_ 

Microsoft \| Azure \| :ref:`Quickstart: Create a Linux virtual machine in the Azure portal <pgd commit-scope create>` 

Google \| GCP \| :ref:`Create a Linux VM instance in Compute Engine <pgd commit-scope create>` 

.. ::
   ### Configuring hosts

Create an admin user
^^^^^^^^^^^^^^^^^^^^

We recommend that you configure an admin user for each provisioned
instance. The admin user must have superuser or sudo (to superuser)
privileges. We also recommend that the admin user be configured for
passwordless SSH access using certificates.

Ensure networking connectivity
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

With the admin user created, ensure that each machine can communicate
with the other machines you’re provisioning.

In particular, the PostgreSQL TCP/IP port (5444 for EDB Postgres
Advanced Server, 5432 for EDB Postgres Extended and community
PostgreSQL) must be open to all machines in the cluster. The PGD
Connection Manager must also be accessible to all nodes in the cluster.
By default, the Connection Manager uses port 6432 (or 6444 for EDB
Postgres Advanced Server).

Worked example
--------------

For this serie of worked examples, three hosts with Red Hat Enterprise
Linux 9 were provisioned:

- host-1

- host-2

- host-3

These hosts were configured in the cloud. As such, each host has both a
public and private IP address. We will use the private IP addresses for
the cluster.

The private IP addresses are:

- host-1: 192.168.254.166

- host-2: 192.168.254.247

- host-3: 192.168.254.135

For the example cluster, ``/etc/hosts`` was also edited to use those
private IP addresses:

.. code:: text

   192. 168.254.166 host-1
   192. 168.254.247 host-2
   192. 168.254.135 host-3

In production environments, you should use DNS to resolve hostnames to
IP addresses.
