From dcd605ebc898c72a5c64d9613cd30f7d9b253bd7 Mon Sep 17 00:00:00 2001 From: Kostiantyn Nemchenko Date: Tue, 11 Jun 2019 16:15:48 +0300 Subject: [PATCH] Update existing_data.rst (#1071) --- docs/existing_data.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/existing_data.rst b/docs/existing_data.rst index e875f8fe..f018dde8 100644 --- a/docs/existing_data.rst +++ b/docs/existing_data.rst @@ -12,24 +12,25 @@ Procedure A Patroni cluster can be started with a data directory from a single-node PostgreSQL database. This is achieved by following closely these steps: -#. Manually start PostgreSQL daemon -#. Create Patroni superuser and replication users as defined in the :ref:`authentication ` section of the Patroni configuration. If this user is created in SQL, the following queries achieve this: +1. Manually start PostgreSQL daemon +2. Create Patroni superuser and replication users as defined in the :ref:`authentication ` section of the Patroni configuration. If this user is created in SQL, the following queries achieve this: .. code-block:: sql - CREATE USER $PATRONI_SUPERUSER_USERNAME WITH SUPERUSER ENCRYPTED PASSWORD '$PATRONI_SUPERUSER_PASSWORD'; - CREATE USER $PATRONI_REPLICATION_USERNAME WITH REPLICATION ENCRYPTED PASSWORD '$PATRONI_REPLICATION_PASSWORD'; -#. Start Patroni (e.g. ``patroni /etc/patroni/patroni.yml``). It automatically detects that PostgreSQL daemon is already running but its configuration might be out-of-date. -#. Ask Patroni to restart the node with ``patronictl restart cluster-name node-name``. + CREATE USER $PATRONI_SUPERUSER_USERNAME WITH SUPERUSER ENCRYPTED PASSWORD '$PATRONI_SUPERUSER_PASSWORD'; + CREATE USER $PATRONI_REPLICATION_USERNAME WITH REPLICATION ENCRYPTED PASSWORD '$PATRONI_REPLICATION_PASSWORD'; + +3. Start Patroni (e.g. ``patroni /etc/patroni/patroni.yml``). It automatically detects that PostgreSQL daemon is already running but its configuration might be out-of-date. +4. Ask Patroni to restart the node with ``patronictl restart cluster-name node-name``. This step is only required if PostgreSQL configuration is out-of-date. FAQ --- -#. During Patroni startup, Patroni complains that it cannot bind to the PostgreSQL port. +- During Patroni startup, Patroni complains that it cannot bind to the PostgreSQL port. -You need to verify ``listen_addresses`` and ``port`` in ``postgresql.conf`` and ``postgresql.listen`` in ``patroni.yml``. Don't forget that ``pg_hba.conf`` should allow such access. + You need to verify ``listen_addresses`` and ``port`` in ``postgresql.conf`` and ``postgresql.listen`` in ``patroni.yml``. Don't forget that ``pg_hba.conf`` should allow such access. -#. After asking Patroni to restart the node, PostgreSQL displays the error message ``could not open configuration file "/etc/postgresql/10/main/pg_hba.conf": No such file or directory`` +- After asking Patroni to restart the node, PostgreSQL displays the error message ``could not open configuration file "/etc/postgresql/10/main/pg_hba.conf": No such file or directory`` -It can mean various things depending on how you manage PostgreSQL configuration. If you specified `postgresql.config_dir`, Patroni generates the ``pg_hba.conf`` based on the settings in the :ref:`bootstrap ` section only when it bootstraps a new cluster. In this scenario the ``PGDATA`` was not empty, therefore no bootstrap happened. This file must exist beforehand. + It can mean various things depending on how you manage PostgreSQL configuration. If you specified `postgresql.config_dir`, Patroni generates the ``pg_hba.conf`` based on the settings in the :ref:`bootstrap ` section only when it bootstraps a new cluster. In this scenario the ``PGDATA`` was not empty, therefore no bootstrap happened. This file must exist beforehand.