mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-17 11:24:23 -05:00
Add some cross references to worker documentation (#13974)
Signed-off-by: Dirk Klimpel <dirk@klimpel.org>
This commit is contained in:
parent
3dfc4a08dc
commit
4490697b98
1
changelog.d/13974.doc
Normal file
1
changelog.d/13974.doc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Add some cross references to worker documentation.
|
14
docs/systemd-with-workers/workers/media_worker.yaml
Normal file
14
docs/systemd-with-workers/workers/media_worker.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
worker_app: synapse.app.media_repository
|
||||||
|
worker_name: media_worker
|
||||||
|
|
||||||
|
# The replication listener on the main synapse process.
|
||||||
|
worker_replication_host: 127.0.0.1
|
||||||
|
worker_replication_http_port: 9093
|
||||||
|
|
||||||
|
worker_listeners:
|
||||||
|
- type: http
|
||||||
|
port: 8085
|
||||||
|
resources:
|
||||||
|
- names: [media]
|
||||||
|
|
||||||
|
worker_log_config: /etc/matrix-synapse/media-worker-log.yaml
|
@ -93,7 +93,6 @@ listener" for the main process; and secondly, you need to enable redis-based
|
|||||||
replication. Optionally, a shared secret can be used to authenticate HTTP
|
replication. Optionally, a shared secret can be used to authenticate HTTP
|
||||||
traffic between workers. For example:
|
traffic between workers. For example:
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# extend the existing `listeners` section. This defines the ports that the
|
# extend the existing `listeners` section. This defines the ports that the
|
||||||
# main process will listen on.
|
# main process will listen on.
|
||||||
@ -129,7 +128,8 @@ In the config file for each worker, you must specify:
|
|||||||
* The HTTP replication endpoint that it should talk to on the main synapse process
|
* The HTTP replication endpoint that it should talk to on the main synapse process
|
||||||
(`worker_replication_host` and `worker_replication_http_port`)
|
(`worker_replication_host` and `worker_replication_http_port`)
|
||||||
* If handling HTTP requests, a `worker_listeners` option with an `http`
|
* If handling HTTP requests, a `worker_listeners` option with an `http`
|
||||||
listener, in the same way as the `listeners` option in the shared config.
|
listener, in the same way as the [`listeners`](usage/configuration/config_documentation.md#listeners)
|
||||||
|
option in the shared config.
|
||||||
* If handling the `^/_matrix/client/v3/keys/upload` endpoint, the HTTP URI for
|
* If handling the `^/_matrix/client/v3/keys/upload` endpoint, the HTTP URI for
|
||||||
the main process (`worker_main_http_uri`).
|
the main process (`worker_main_http_uri`).
|
||||||
|
|
||||||
@ -285,8 +285,9 @@ For multiple workers not handling the SSO endpoints properly, see
|
|||||||
[#7530](https://github.com/matrix-org/synapse/issues/7530) and
|
[#7530](https://github.com/matrix-org/synapse/issues/7530) and
|
||||||
[#9427](https://github.com/matrix-org/synapse/issues/9427).
|
[#9427](https://github.com/matrix-org/synapse/issues/9427).
|
||||||
|
|
||||||
Note that a HTTP listener with `client` and `federation` resources must be
|
Note that a [HTTP listener](usage/configuration/config_documentation.md#listeners)
|
||||||
configured in the `worker_listeners` option in the worker config.
|
with `client` and `federation` `resources` must be configured in the `worker_listeners`
|
||||||
|
option in the worker config.
|
||||||
|
|
||||||
#### Load balancing
|
#### Load balancing
|
||||||
|
|
||||||
@ -326,7 +327,8 @@ effects of bursts of events from that bridge on events sent by normal users.
|
|||||||
Additionally, the writing of specific streams (such as events) can be moved off
|
Additionally, the writing of specific streams (such as events) can be moved off
|
||||||
of the main process to a particular worker.
|
of the main process to a particular worker.
|
||||||
|
|
||||||
To enable this, the worker must have a HTTP replication listener configured,
|
To enable this, the worker must have a
|
||||||
|
[HTTP `replication` listener](usage/configuration/config_documentation.md#listeners) configured,
|
||||||
have a `worker_name` and be listed in the `instance_map` config. The same worker
|
have a `worker_name` and be listed in the `instance_map` config. The same worker
|
||||||
can handle multiple streams, but unless otherwise documented, each stream can only
|
can handle multiple streams, but unless otherwise documented, each stream can only
|
||||||
have a single writer.
|
have a single writer.
|
||||||
@ -410,7 +412,7 @@ the stream writer for the `presence` stream:
|
|||||||
There is also support for moving background tasks to a separate
|
There is also support for moving background tasks to a separate
|
||||||
worker. Background tasks are run periodically or started via replication. Exactly
|
worker. Background tasks are run periodically or started via replication. Exactly
|
||||||
which tasks are configured to run depends on your Synapse configuration (e.g. if
|
which tasks are configured to run depends on your Synapse configuration (e.g. if
|
||||||
stats is enabled).
|
stats is enabled). This worker doesn't handle any REST endpoints itself.
|
||||||
|
|
||||||
To enable this, the worker must have a `worker_name` and can be configured to run
|
To enable this, the worker must have a `worker_name` and can be configured to run
|
||||||
background tasks. For example, to move background tasks to a dedicated worker,
|
background tasks. For example, to move background tasks to a dedicated worker,
|
||||||
@ -457,8 +459,8 @@ worker application type.
|
|||||||
#### Notifying Application Services
|
#### Notifying Application Services
|
||||||
|
|
||||||
You can designate one generic worker to send output traffic to Application Services.
|
You can designate one generic worker to send output traffic to Application Services.
|
||||||
|
Doesn't handle any REST endpoints itself, but you should specify its name in the
|
||||||
Specify its name in the shared configuration as follows:
|
shared configuration as follows:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
notify_appservices_from_worker: worker_name
|
notify_appservices_from_worker: worker_name
|
||||||
@ -536,16 +538,12 @@ file to stop the main synapse running background jobs related to managing the
|
|||||||
media repository. Note that doing so will prevent the main process from being
|
media repository. Note that doing so will prevent the main process from being
|
||||||
able to handle the above endpoints.
|
able to handle the above endpoints.
|
||||||
|
|
||||||
In the `media_repository` worker configuration file, configure the http listener to
|
In the `media_repository` worker configuration file, configure the
|
||||||
|
[HTTP listener](usage/configuration/config_documentation.md#listeners) to
|
||||||
expose the `media` resource. For example:
|
expose the `media` resource. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
worker_listeners:
|
{{#include systemd-with-workers/workers/media_worker.yaml}}
|
||||||
- type: http
|
|
||||||
port: 8085
|
|
||||||
resources:
|
|
||||||
- names:
|
|
||||||
- media
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that if running multiple media repositories they must be on the same server
|
Note that if running multiple media repositories they must be on the same server
|
||||||
|
Loading…
Reference in New Issue
Block a user