howto_deploy_synapse_with_multiple_workers

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
howto_deploy_synapse_with_multiple_workers [2022/03/03 08:10] homerhowto_deploy_synapse_with_multiple_workers [2023/05/24 22:16] (aktuell) – [Log config] homer
Zeile 1: Zeile 1:
 <markdown> <markdown>
-# HowTo Deploy [Matrix-Synapse](https://matrix-org.github.io/synapse/latest/welcome_and_overview.html) with Multiple Workers using docker-compose+# HowTo Deploy Synapse with Multiple Workers using docker-compose 
 +## Status: Working Again (25th of May 2023) 
 +The update to v1.84.0 broke my setup today. The [Upgrade-Info](https://github.com/matrix-org/synapse/blob/release-v1.84/docs/upgrade.md#upgrading-to-v1840noticed me that there have been some changes in the configuration I missed and so I had to adapt some things in both the shared homeserver.yaml and the worker configs. So the example files beyond won't work with synapse versions before the v1.84.0 release. 
 ## Status: Finally working!!! (1st of March 2022) ## Status: Finally working!!! (1st of March 2022)
-I can finally announce a working docker-compose setup with 2 workers!+I can finally announce a working docker-compose setup with 2 workers for [Matrix-Synapse](https://matrix-org.github.io/synapse/latest/welcome_and_overview.html)!
 That is up to now one worker for client related requests and one for the federation requests. Of course the amount of workers is expandable and only depends on how you route the requests to the workers and the main process using your reverse proxy (here: nginx). That is up to now one worker for client related requests and one for the federation requests. Of course the amount of workers is expandable and only depends on how you route the requests to the workers and the main process using your reverse proxy (here: nginx).
 ## Scope ## Scope
 I document my relevant config files except my homeserver.yaml. For briefness I will only show the small parts of it that are relevant for having the workers to communicate successfully with the main process. It's assumed that you have an already working homeserver.yaml based on a monolithic synapse setup. I will try to comment some critical details so that you will know what to adapt and what to adopt. I document my relevant config files except my homeserver.yaml. For briefness I will only show the small parts of it that are relevant for having the workers to communicate successfully with the main process. It's assumed that you have an already working homeserver.yaml based on a monolithic synapse setup. I will try to comment some critical details so that you will know what to adapt and what to adopt.
 +
 +If you're looking for an example of synapse with workers _without_ docker you might want to visit https://git.envs.net/envs/matrix-conf/
 ### Thnx ### Thnx
 ... go out to Sloth (@sleuth:rexrobotics.org) for collaboration and mutual support while working on this. If you like to compare those files documented here to s.o. else' please have a look at [Sloth's gitlab repo](https://gitlab.com/Sleuth56/synapse-with-workers/-/tree/master/). ... go out to Sloth (@sleuth:rexrobotics.org) for collaboration and mutual support while working on this. If you like to compare those files documented here to s.o. else' please have a look at [Sloth's gitlab repo](https://gitlab.com/Sleuth56/synapse-with-workers/-/tree/master/).
Zeile 246: Zeile 251:
 ```  ``` 
 worker_app: synapse.app.generic_worker worker_app: synapse.app.generic_worker
-worker_name: worker1 +worker_name: generic_worker1 
-worker_replication_host: matrix-synapse       # Again: Also here it's important to use the container_name +
-worker_replication_http_port: 9093+
 worker_listeners: worker_listeners:
   - type: http   - type: http
     port: 8084     port: 8084
     resources:     resources:
-      - names: +      - names: [client] 
-        client+  type: http 
 +    port: 9094 
 +    resources: 
 +      - names: [replication] 
 + 
 +send_federation: true 
 worker_log_config: /data/workers/logs/Worker1_log_config.yaml     # if you like to have a seperate log for each worker you will need this config. But I understand that you can also use the already existing config of your main synapse process. worker_log_config: /data/workers/logs/Worker1_log_config.yaml     # if you like to have a seperate log for each worker you will need this config. But I understand that you can also use the already existing config of your main synapse process.
 ``` ```
Zeile 262: Zeile 272:
 ``` ```
 worker_app: synapse.app.generic_worker worker_app: synapse.app.generic_worker
-worker_name: worker2 +worker_name: generic_worker2 
-worker_replication_host: matrix-synapse +
-worker_replication_http_port: 9093+
 worker_listeners: worker_listeners:
   - type: http   - type: http
     port: 8083     port: 8083
     resources:     resources:
-      - names: +      - names: [federation] 
-        federation+  type: http 
 +    port: 9092 
 +    resources: 
 +      - names: [replication] 
 + 
 +send_federation: true
  
 worker_log_config: /data/workers/logs/Worker2_log_config.yaml worker_log_config: /data/workers/logs/Worker2_log_config.yaml
Zeile 281: Zeile 295:
 formatters: formatters:
   precise:   precise:
-   format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- $+   format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- $'
  
 filters: filters:
Zeile 362: Zeile 376:
 # Worker # Worker
 worker_replication_secret: "some long and super secret password you don't need to memorize or copy because main and workers share it already" worker_replication_secret: "some long and super secret password you don't need to memorize or copy because main and workers share it already"
 +
 +# The following block was added to be compatible with v1.84.0 which broke my former config on the 24th of May 2023. Check also the Worker configs above!
 +instance_map:
 +  main:
 +    host: matrix-synapse
 +    port: 9093
 +    tls: false
 +  generic_worker2:
 +    host: matrix-federation
 +    port: 9092
 +    tls: false
 +  generic_worker1:
 +    host: matrix-client
 +    port: 9094
 +    tls: false
 +
 +
 redis: redis:
   enabled: true   enabled: true
  • howto_deploy_synapse_with_multiple_workers.1646291458.txt.gz
  • Zuletzt geändert: 2022/03/03 08:10
  • von homer