Step 1 - Provisioning hosts
===========================

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 <Compatibility changes>`  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,25,15
  :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:`Eager <Installing PGD CLI on Linux>` 
  Google,GCP,:ref:`Eager <Installing PGD CLI on Linux>` 

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. If you plan to
deploy PGD Proxy, its port must be open to any applications that will
connect to the cluster. Port 6432 is typically used for PGD Proxy.

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

For this example, three hosts with Red Hat Enterprise Linux 9 were
provisioned:

-  host-one

-  host-two

-  host-three

Each is configured with an admin user named admin.

These hosts were configured in the cloud. As such, each host has both a
public and private IP address.

.. csv-table::
  :header: Name,Public IP,Private IP
  :widths: 12,25,15
  :align: left
  :class: longtable

  host-one,172.24.117.204,192.168.254.166
  host-two,172.24.113.247,192.168.254.247
  host-three,172.24.117.23,192.168.254.135

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

::

   192. 168.254.166 host-one
   192. 168.254.247 host-two
   192. 168.254.135 host-three
