Configuring PGD repositories
============================

On each host which you want to use as a PGD data node, you need to
install the database and the PGD software.

Configure the PGD repositories
------------------------------

Set the following environment variables:

EDB_SUBSCRIPTION_TOKEN
^^^^^^^^^^^^^^^^^^^^^^

This is the token you received when you registered for the EDB
subscription. It is used to authenticate your access to the EDB
repository.

.. code:: bash

   export EDB_SUBSCRIPTION_TOKEN=<your-token>

EDB_SUBSCRIPTION_PLAN
^^^^^^^^^^^^^^^^^^^^^

This is the type of subscription you have with EDB. It can be
``standard`` , ``enterprise`` , or ``community`` .

.. code:: bash

   export EDB_SUBSCRIPTION_PLAN=<your-subscription-plan>

EDB_REPO_TYPE
^^^^^^^^^^^^^

This is the type of package manager you use, which informs the installer
which type of package you need. This can be ``deb`` for Ubuntu/Debian or
``rpm`` for CentOS/RHEL.

.. code:: bash

   export EDB_REPO_TYPE=<your-repo-type>

Install the repositories
------------------------

There are two repositories you need to configure: one for the database
software and one for the PGD software.

The following command will download and run a script that configures
your package manager to use the EDB repository for databases.

.. code:: bash

   curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/$EDB_SUBSCRIPTION_PLAN/setup.$EDB_REPO_TYPE.sh" | sudo -E bash

The following command will download and run a script that configures
your package manager to use the EDB repository for PGD.

.. code:: bash

   curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/postgres_distributed/setup.$EDB_REPO_TYPE.sh" | sudo -E bash

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

In this example, we will configure the repositories on a CentOS/RHEL
system that will allow us to install EDB Postgres Advanced Server 17
with PGD using an enterprise subscription.

Set the environment variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash

   export EDB_SUBSCRIPTION_TOKEN=XXXXXXXXXXXXXX
   export EDB_SUBSCRIPTION_PLAN=enterprise
   export EDB_REPO_TYPE=rpm

.. _install-the-repositories-1:

Install the repositories
^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash


   #  There are two repositories to install.

   curl -1sSLf " https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/$EDB_SUBSCRIPTION_PLAN/setup.$EDB_REPO_TYPE.sh" | sudo -E bash
   curl -1sSLf " https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/postgres_distributed/setup.$EDB_REPO_TYPE.sh" | sudo -E bash

The next step is to :ref:`Installing the database and pgd <Installing the database and pgd>`  .
