Skip to content

Commit

Permalink
Expand a bit on the remote access instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-heyer committed Feb 18, 2022
1 parent 8cf8ea1 commit 22d0342
Showing 1 changed file with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,42 @@ host all all all md5
host replication streaming_barman all md5
```

### enable remote access to your PostgreSQL Server
### Enable remote access to your PostgreSQL Server

set `listen_addresses = '*'` in `postgresql.conf`
If the PostgreSQL server isn't already configured for remote access, or is restricted to connections from known machines, our database server won't be able to connect.

otherwise the barman-backup server will not be able to communicate with your PostgreSQL server at all.
We'll use psql to check this setting:

### Database settings for streaming
```shell
psql -d pagila
```

We'll also need to make sure there are replication slots available, and that PostgreSQL will allow another sender to connect. We'll use psql to check the current settings:
The relevant configuration parameter is [`listen_addresses`](https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-LISTEN-ADDRESSES):

```shell
psql -d pagila
show listen_addresses;
__OUTPUT__
listen_addresses
------------------
*
(1 row)
```

The value for this server is `*` - which allows connections from anything. This doesn't need to be changed. If the value were to be empty, `localhost`, or a list of hosts or addresses that don't include our database server, we'd need to add its hostname (`backup`) to the list, or change it to the wildcard.

```shell
pagila=# ALTER SYSTEM SET listen_addresses TO "*";
__OUTPUT__
ALTER SYSTEM
```

!!! Note
If you change this setting, you'll need to restart the database server for it to take effect. Since our setting was already allowing all remote connections, we don't need to do that.

### Database settings for streaming

We'll also need to make sure there are replication slots available, and that PostgreSQL will allow another sender to connect. We'll continue to use psql to check the current settings:

```sql
Show max_wal_senders;
Show max_replication_slots;
Expand Down

0 comments on commit 22d0342

Please sign in to comment.