Switch postgres/postgres-backup Ansible role sources and adjust variable names (devture_postgres_ -> postgres_)
This commit is contained in:
@ -10,7 +10,7 @@ If you'd like to use an external PostgreSQL server that you manage, you can edit
|
||||
If you'd like to use an external Postgres server, use a custom `vars.yml` configuration like this:
|
||||
|
||||
```yaml
|
||||
devture_postgres_enabled: false
|
||||
postgres_enabled: false
|
||||
|
||||
# Rewire Synapse to use your external Postgres server
|
||||
matrix_synapse_database_host: "your-postgres-server-hostname"
|
||||
|
@ -123,7 +123,7 @@ To import the Synapse media store, you're supposed to invoke the `import_synapse
|
||||
|
||||
This guide here is adapted from the [upstream documentation about the import_synapse script](https://github.com/turt2live/matrix-media-repo#importing-media-from-synapse).
|
||||
|
||||
Run the following command on the server (after replacing `devture_postgres_connection_password` in it with the value found in your `vars.yml` file):
|
||||
Run the following command on the server (after replacing `postgres_connection_password` in it with the value found in your `vars.yml` file):
|
||||
|
||||
```sh
|
||||
docker exec -it matrix-media-repo \
|
||||
@ -132,7 +132,7 @@ docker exec -it matrix-media-repo \
|
||||
-dbHost matrix-postgres \
|
||||
-dbPort 5432 \
|
||||
-dbUsername matrix \
|
||||
-dbPassword devture_postgres_connection_password
|
||||
-dbPassword postgres_connection_password
|
||||
```
|
||||
|
||||
Enter `1` for the Machine ID when prompted (you are not doing any horizontal scaling) unless you know what you're doing.
|
||||
@ -145,7 +145,7 @@ If you're using the [Dendrite](configuring-playbook-dendrite.md) homeserver inst
|
||||
|
||||
To import the Dendrite media store, you're supposed to invoke the `import_dendrite` tool which is part of the matrix-media-repo container image. Your Dendrite database is called `dendrite_mediaapi` by default, unless you've changed it by modifying `matrix_dendrite_media_api_database`.
|
||||
|
||||
Run the following command on the server (after replacing `devture_postgres_connection_password` in it with the value found in your `vars.yml` file):
|
||||
Run the following command on the server (after replacing `postgres_connection_password` in it with the value found in your `vars.yml` file):
|
||||
|
||||
```sh
|
||||
docker exec -it matrix-media-repo \
|
||||
@ -154,7 +154,7 @@ docker exec -it matrix-media-repo \
|
||||
-dbHost matrix-postgres \
|
||||
-dbPort 5432 \
|
||||
-dbUsername matrix \
|
||||
-dbPassword devture_postgres_connection_password
|
||||
-dbPassword postgres_connection_password
|
||||
```
|
||||
|
||||
Enter `1` for the Machine ID when prompted (you are not doing any horizontal scaling) unless you know what you're doing.
|
||||
|
@ -10,7 +10,7 @@ For a more complete backup solution (one that includes not only Postgres, but al
|
||||
Minimal working configuration (`inventory/host_vars/matrix.DOMAIN/vars.yml`) to enable Postgres backup:
|
||||
|
||||
```yaml
|
||||
devture_postgres_backup_enabled: true
|
||||
postgres_backup_enabled: true
|
||||
```
|
||||
|
||||
Refer to the table below for additional configuration variables and their default values.
|
||||
@ -18,13 +18,13 @@ Refer to the table below for additional configuration variables and their defaul
|
||||
|
||||
| Name | Default value | Description |
|
||||
| :-------------------------------- | :--------------------------- | :--------------------------------------------------------------- |
|
||||
|`devture_postgres_backup_enabled`|`false`|Set to true to use [docker-postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local) to create automatic database backups|
|
||||
|`devture_postgres_backup_schedule`| `'@daily'` |Cron-schedule specifying the interval between postgres backups.|
|
||||
|`devture_postgres_backup_keep_days`|`7`|Number of daily backups to keep|
|
||||
|`devture_postgres_backup_keep_weeks`|`4`|Number of weekly backups to keep|
|
||||
|`devture_postgres_backup_keep_months`|`12`|Number of monthly backups to keep|
|
||||
|`devture_postgres_backup_base_path` | `"{{ matrix_base_data_path }}/postgres-backup"` | Base path for postgres-backup. Also see `devture_postgres_backup_data_path` |
|
||||
|`devture_postgres_backup_data_path` | `"{{ devture_postgres_backup_base_path }}/data"` | Storage path for postgres-backup database backups |
|
||||
|`postgres_backup_enabled`|`false`|Set to true to use [docker-postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local) to create automatic database backups|
|
||||
|`postgres_backup_schedule`| `'@daily'` |Cron-schedule specifying the interval between postgres backups.|
|
||||
|`postgres_backup_keep_days`|`7`|Number of daily backups to keep|
|
||||
|`postgres_backup_keep_weeks`|`4`|Number of weekly backups to keep|
|
||||
|`postgres_backup_keep_months`|`12`|Number of monthly backups to keep|
|
||||
|`postgres_backup_base_path` | `"{{ matrix_base_data_path }}/postgres-backup"` | Base path for postgres-backup. Also see `postgres_backup_data_path` |
|
||||
|`postgres_backup_data_path` | `"{{ postgres_backup_base_path }}/data"` | Storage path for postgres-backup database backups |
|
||||
|
||||
|
||||
## Installing
|
||||
|
@ -75,7 +75,7 @@ The only thing you **cannot** do is mix [generic workers](#generic-workers) and
|
||||
|
||||
#### Effect of enabling workers on the rest of your server
|
||||
|
||||
When Synapse workers are enabled, the integrated [Postgres database is tuned](maintenance-postgres.md#tuning-postgresql), so that the maximum number of Postgres connections are increased from `200` to `500`. If you need to decrease or increase the number of maximum Postgres connections further, use the `devture_postgres_max_connections` variable.
|
||||
When Synapse workers are enabled, the integrated [Postgres database is tuned](maintenance-postgres.md#tuning-postgresql), so that the maximum number of Postgres connections are increased from `200` to `500`. If you need to decrease or increase the number of maximum Postgres connections further, use the `postgres_max_connections` variable.
|
||||
|
||||
A separate Ansible role (`matrix-synapse-reverse-proxy-companion`) and component handles load-balancing for workers. This role/component is automatically enabled when you enable workers. Make sure to use the `setup-all` tag (not `install-all`!) during the playbook's [installation](./installing.md) process, especially if you're disabling workers, so that components may be installed/uninstalled correctly.
|
||||
|
||||
|
@ -107,12 +107,12 @@ Example: `--extra-vars="postgres_dump_name=matrix-postgres-dump.sql"`
|
||||
PostgreSQL can be [tuned](https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server) to make it run faster. This is done by passing extra arguments to the Postgres process.
|
||||
|
||||
The [Postgres Ansible role](https://github.com/devture/com.devture.ansible.role.postgres) **already does some tuning by default**, which matches the [tuning logic](https://github.com/le0pard/pgtune/blob/master/src/features/configuration/configurationSlice.js) done by websites like https://pgtune.leopard.in.ua/.
|
||||
You can manually influence some of the tuning variables . These parameters (variables) are injected via the `devture_postgres_postgres_process_extra_arguments_auto` variable.
|
||||
You can manually influence some of the tuning variables . These parameters (variables) are injected via the `postgres_postgres_process_extra_arguments_auto` variable.
|
||||
|
||||
Most users should be fine with the automatically-done tuning. However, you may wish to:
|
||||
|
||||
- **adjust the automatically-determined tuning parameters manually**: change the values for the tuning variables defined in the Postgres role's [default configuration file](https://github.com/devture/com.devture.ansible.role.postgres/blob/main/defaults/main.yml) (see `devture_postgres_max_connections`, `devture_postgres_data_storage` etc). These variables are ultimately passed to Postgres via a `devture_postgres_postgres_process_extra_arguments_auto` variable
|
||||
- **adjust the automatically-determined tuning parameters manually**: change the values for the tuning variables defined in the Postgres role's [default configuration file](https://github.com/devture/com.devture.ansible.role.postgres/blob/main/defaults/main.yml) (see `postgres_max_connections`, `postgres_data_storage` etc). These variables are ultimately passed to Postgres via a `postgres_postgres_process_extra_arguments_auto` variable
|
||||
|
||||
- **turn automatically-performed tuning off**: override it like this: `devture_postgres_postgres_process_extra_arguments_auto: []`
|
||||
- **turn automatically-performed tuning off**: override it like this: `postgres_postgres_process_extra_arguments_auto: []`
|
||||
|
||||
- **add additional tuning parameters**: define your additional Postgres configuration parameters in `devture_postgres_postgres_process_extra_arguments_custom`. See `devture_postgres_postgres_process_extra_arguments_auto` defined in the Postgres role's [default configuration file](https://github.com/devture/com.devture.ansible.role.postgres/blob/main/defaults/main.yml) for inspiration
|
||||
- **add additional tuning parameters**: define your additional Postgres configuration parameters in `postgres_postgres_process_extra_arguments_custom`. See `postgres_postgres_process_extra_arguments_auto` defined in the Postgres role's [default configuration file](https://github.com/devture/com.devture.ansible.role.postgres/blob/main/defaults/main.yml) for inspiration
|
||||
|
Reference in New Issue
Block a user