Skip to content

Commit

Permalink
Add compose file for multi-cluster setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaddoll committed Mar 3, 2021
1 parent 174ca09 commit fd8d3c1
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ We also provide several other compose files for different features/modes:
* docker-compose-mysql.yml uses MySQL as persistence storage
* docker-compose-postgres.yml uses PosstgreSQL as persistence storage
* docker-compose-prometheus.yaml runs with Prometheus
* docker-compose-multiclusters.yaml runs with 2 cadence clusters

Also feel free to make your own to combine the above features.

Expand Down
14 changes: 13 additions & 1 deletion docker/config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,25 @@ clusterMetadata:
enableGlobalDomain: {{ default .Env.ENABLE_GLOBAL_DOMAIN "false" }}
failoverVersionIncrement: 10
masterClusterName: "master"
{{- if .Env.IS_NOT_MASTER }}
currentClusterName: "alternative"
{{- else }}
currentClusterName: "master"
{{- end }}
clusterInformation:
master:
enabled: true
initialFailoverVersion: 0
rpcName: "cadence-frontend"
rpcAddress: {{ default .Env.BIND_ON_IP "127.0.0.1" }}:7933
rpcAddress: {{ default .Env.MASTER_SEEDS "cadence" }}:7933
{{- if .Env.ENABLE_GLOBAL_DOMAIN }}
alternative:
enabled: true
initialFailoverVersion: 2
rpcName: "cadence-frontend"
rpcAddress: {{ default .Env.ALTERNATIVE_SEEDS "cadence-alternative" }}:7933
{{- end }}


dcRedirectionPolicy:
policy: {{ default .Env.DC_REDIRECT_POLICY "selected-apis-forwarding" }}
Expand Down
62 changes: 62 additions & 0 deletions docker/docker-compose-multiclusters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: '3'
services:
cassandra:
image: cassandra:3.11
ports:
- "9042:9042"
statsd:
image: graphiteapp/graphite-statsd
ports:
- "8080:80"
- "2003:2003"
- "8125:8125"
- "8126:8126"
cadence:
image: ubercadence/server:master-auto-setup
ports:
- "7933:7933"
- "7934:7934"
- "7935:7935"
- "7939:7939"
environment:
- "CASSANDRA_SEEDS=cassandra"
- "STATSD_ENDPOINT=statsd:8125"
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
- "ENABLE_GLOBAL_DOMAIN=true"
depends_on:
- cassandra
- statsd
cadence-alternative:
image: ubercadence/server:master-auto-setup
ports:
- "7943:7933"
- "7944:7934"
- "7945:7935"
- "7949:7939"
environment:
- "CASSANDRA_SEEDS=cassandra"
- "STATSD_ENDPOINT=statsd:8125"
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
- "IS_NOT_MASTER=true"
- "ENABLE_GLOBAL_DOMAIN=true"
- "KEYSPACE=cadence_alternative"
- "VISIBILITY_KEYSPACE=cadence_visibility_alternative"
depends_on:
- cassandra
- statsd
cadence-web:
image: ubercadence/web:latest
environment:
- "CADENCE_TCHANNEL_PEERS=cadence:7933"
ports:
- "8088:8088"
depends_on:
- cadence
cadence-web-alternative:
image: ubercadence/web:latest
environment:
- "CADENCE_TCHANNEL_PEERS=cadence-alternative:7933"
ports:
- "8089:8088"
depends_on:
- cadence-alternative

0 comments on commit fd8d3c1

Please sign in to comment.