summary refs log tree commit diff
diff options
context:
space:
mode:
authorvillepeh <100730729+villepeh@users.noreply.github.com>2022-07-11 20:33:53 +0300
committerGitHub <noreply@github.com>2022-07-11 18:33:53 +0100
commitbc8eefc1e144eaeda4cb3f8171135ba03b94f2b4 (patch)
treee0e371ca2add542b402d0556bb37f363514769f3
parentReduce event lookups during room creation by passing known event IDs (#13210) (diff)
downloadsynapse-bc8eefc1e144eaeda4cb3f8171135ba03b94f2b4.tar.xz
Add a sample bash script to docs for creating multiple worker files (#13032)
Signed-off-by: Ville Petteri Huh.
-rw-r--r--changelog.d/13032.doc1
-rw-r--r--contrib/workers-bash-scripts/create-multiple-workers.md31
2 files changed, 32 insertions, 0 deletions
diff --git a/changelog.d/13032.doc b/changelog.d/13032.doc
new file mode 100644
index 0000000000..54d45ecd0d
--- /dev/null
+++ b/changelog.d/13032.doc
@@ -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.
diff --git a/contrib/workers-bash-scripts/create-multiple-workers.md b/contrib/workers-bash-scripts/create-multiple-workers.md
new file mode 100644
index 0000000000..ad5142fe15
--- /dev/null
+++ b/contrib/workers-bash-scripts/create-multiple-workers.md
@@ -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.