merge upstream
This commit is contained in:
@ -4,8 +4,6 @@ The playbook can install and configure the [Mjolnir](https://github.com/matrix-o
|
||||
|
||||
See the project's [documentation](https://github.com/matrix-org/mjolnir) to learn what it does and why it might be useful to you.
|
||||
|
||||
Note: the playbook does not currently support the Mjolnir Synapse module. The playbook does support another antispam module, see [Setting up Synapse Simple Antispam](configuring-playbook-synapse-simple-antispam.md).
|
||||
|
||||
|
||||
## 1. Register the bot account
|
||||
|
||||
@ -90,8 +88,21 @@ matrix_bot_mjolnir_access_token: "ACCESS_TOKEN_FROM_STEP_2_GOES_HERE"
|
||||
matrix_bot_mjolnir_management_room: "ROOM_ID_FROM_STEP_4_GOES_HERE"
|
||||
```
|
||||
|
||||
## 6. Adding mjolnir synapse antispam module (optional)
|
||||
|
||||
## 6. Installing
|
||||
Add the following configuration to your `inventory/host_vars/matrix.DOMAIN/vars.yml` file (adapt to your needs):
|
||||
|
||||
|
||||
```yaml
|
||||
matrix_synapse_ext_spam_checker_mjolnir_antispam_enabled: true
|
||||
matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_invites: true
|
||||
matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_messages: false
|
||||
matrix_synapse_ext_spam_checker_mjolnir_antispam_config_block_usernames: false
|
||||
matrix_synapse_ext_spam_checker_mjolnir_antispam_config_ban_lists: []
|
||||
```
|
||||
|
||||
|
||||
## 7. Installing
|
||||
|
||||
After configuring the playbook, run the [installation](installing.md) command:
|
||||
|
||||
|
29
docs/configuring-playbook-prometheus-postgres.md
Normal file
29
docs/configuring-playbook-prometheus-postgres.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Enabling metrics and graphs for Postgres (optional)
|
||||
|
||||
Expanding on the metrics exposed by the [synapse exporter and the node exporter](configuring-playbook-prometheus-grafana.md), the playbook enables the [postgres exporter](https://github.com/prometheus-community/postgres_exporter) that exposes more detailed information about what's happening on your postgres database.
|
||||
|
||||
You can enable this with the following settings in your configuration file (`inventory/host_vars/matrix.<your-domain>/vars.yml`):
|
||||
|
||||
|
||||
```yaml
|
||||
matrix_prometheus_postgres_exporter_enabled: true
|
||||
|
||||
# the role creates a postgres user as credential. You can configure these if required:
|
||||
matrix_prometheus_postgres_exporter_database_username: 'matrix_prometheus_postgres_exporter'
|
||||
matrix_prometheus_postgres_exporter_database_password: 'some-password'
|
||||
|
||||
```
|
||||
|
||||
## What does it do?
|
||||
|
||||
Name | Description
|
||||
-----|----------
|
||||
`matrix_prometheus_postgres_exporter_enabled`|Enable the postgres prometheus exporter. This sets up the docker container, connects it to the database and adds a 'job' to the prometheus config which tells prometheus about this new exporter. The default is 'false'
|
||||
`matrix_prometheus_postgres_exporter_database_username`| The 'username' for the user that the exporter uses to connect to the database. The default is 'matrix_prometheus_postgres_exporter'
|
||||
`matrix_prometheus_postgres_exporter_database_password`| The 'password' for the user that the exporter uses to connect to the database.
|
||||
|
||||
|
||||
## More information
|
||||
|
||||
- [The PostgresSQL dashboard](https://grafana.com/grafana/dashboards/9628) (generic postgres dashboard)
|
||||
|
@ -1,3 +1,7 @@
|
||||
> **Note**: This migration guide is applicable if you migrate from one server to another server having the same CPU architecture (e.g. both servers being `amd64`).
|
||||
>
|
||||
> If you're trying to migrate between different architectures (e.g. `amd64` --> `arm64`), simply copying the complete `/matrix` directory is not possible as it would move the raw PostgreSQL data between different architectures. In this specific case, you can use the guide below as a reference, but you would also need to dump the database on your current server and import it properly on the new server. See our [Backing up PostgreSQL](maintenance-postgres.md#backing-up-postgresql) docs for help with PostgreSQL backup/restore.
|
||||
|
||||
# Migrating to new server
|
||||
|
||||
1. Prepare by lowering DNS TTL for your domains (`matrix.DOMAIN`, etc.), so that DNS record changes (step 4 below) would happen faster, leading to less downtime
|
||||
|
@ -99,6 +99,8 @@ Example: `--extra-vars="postgres_dump_name=matrix-postgres-dump.sql"`
|
||||
|
||||
PostgreSQL can be tuned to make it run faster. This is done by passing extra arguments to Postgres with the `matrix_postgres_process_extra_arguments` variable. You should use a website like https://pgtune.leopard.in.ua/ or information from https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server to determine what Postgres settings you should change.
|
||||
|
||||
**Note**: the configuration generator at https://pgtune.leopard.in.ua/ adds spaces around the `=` sign, which is invalid. You'll need to remove it manually (`max_connections = 300` -> `max_connections=300`)
|
||||
|
||||
### Here are some examples:
|
||||
|
||||
These are not recommended values and they may not work well for you. This is just to give you an idea of some of the options that can be set. If you are an experienced PostgreSQL admin feel free to update this documentation with better examples.
|
||||
@ -106,11 +108,33 @@ These are not recommended values and they may not work well for you. This is jus
|
||||
Here is an example config for a small 2 core server with 4GB of RAM and SSD storage:
|
||||
```
|
||||
matrix_postgres_process_extra_arguments: [
|
||||
"-c 'shared_buffers=128MB'",
|
||||
"-c 'effective_cache_size=2304MB'",
|
||||
"-c 'effective_io_concurrency=100'",
|
||||
"-c 'random_page_cost=2.0'",
|
||||
"-c 'min_wal_size=500MB'",
|
||||
"-c shared_buffers=128MB",
|
||||
"-c effective_cache_size=2304MB",
|
||||
"-c effective_io_concurrency=100",
|
||||
"-c random_page_cost=2.0",
|
||||
"-c min_wal_size=500MB",
|
||||
]
|
||||
```
|
||||
|
||||
Here is an example config for a 4 core server with 8GB of RAM on a Virtual Private Server (VPS); the paramters have been configured using https://pgtune.leopard.in.ua with the following setup: PostgreSQL version 12, OS Type: Linux, DB Type: Mixed type of application, Data Storage: SSD storage:
|
||||
```
|
||||
matrix_postgres_process_extra_arguments: [
|
||||
"-c max_connections=100",
|
||||
"-c shared_buffers=2GB",
|
||||
"-c effective_cache_size=6GB",
|
||||
"-c maintenance_work_mem=512MB",
|
||||
"-c checkpoint_completion_target=0.9",
|
||||
"-c wal_buffers=16MB",
|
||||
"-c default_statistics_target=100",
|
||||
"-c random_page_cost=1.1",
|
||||
"-c effective_io_concurrency=200",
|
||||
"-c work_mem=5242kB",
|
||||
"-c min_wal_size=1GB",
|
||||
"-c max_wal_size=4GB",
|
||||
"-c max_worker_processes=4",
|
||||
"-c max_parallel_workers_per_gather=2",
|
||||
"-c max_parallel_workers=4",
|
||||
"-c max_parallel_maintenance_workers=2",
|
||||
]
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user