Browse Source

Add a sample bash script to docs for creating multiple worker files (#13032)

Signed-off-by: Ville Petteri Huh.
tags/v1.63.0rc1
villepeh 1 year ago
committed by GitHub
parent
commit
bc8eefc1e1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 0 deletions
  1. +1
    -0
      changelog.d/13032.doc
  2. +31
    -0
      contrib/workers-bash-scripts/create-multiple-workers.md

+ 1
- 0
changelog.d/13032.doc View File

@@ -0,0 +1 @@
Add a helpful example bash script to the contrib directory for creating multiple worker configuration files of the same type. Contributed by @villepeh.

+ 31
- 0
contrib/workers-bash-scripts/create-multiple-workers.md View File

@@ -0,0 +1,31 @@
# Creating multiple workers with a bash script

Setting up multiple worker configuration files manually can be time-consuming.
You can alternatively create multiple worker configuration files with a simple `bash` script. For example:

```sh
#!/bin/bash
for i in {1..5}
do
cat << EOF >> generic_worker$i.yaml
worker_app: synapse.app.generic_worker
worker_name: generic_worker$i

# 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: 808$i
resources:
- names: [client, federation]

worker_log_config: /etc/matrix-synapse/generic-worker-log.yaml
EOF
done
```

This would create five generic workers with a unique `worker_name` field in each file and listening on ports 8081-8085.

Customise the script to your needs.

Loading…
Cancel
Save