Prerequisites
=============

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 
`supported Linux operating system <https://www.enterprisedb.com/resources/platform-compatibility#bdr>`_  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:

.. csv-table::
  :header: Vendor,Platform,Guide
  :widths: 12,15,20
  :align: left
  :class: longtable

  Amazon,AWS, `Tutorial: Get started with Amazon EC2 Linux instances <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html>`__ 
  Microsoft,Azure,:ref:`pg_upgrade <pgd commit-scope create>` 
  Google,GCP,:ref:`pg_upgrade <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 series 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
