forked from cadence-workflow/cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Easier support for multiple instances locally (cadence-workflow#6289)
* Make ports configurable, so we can start several instances of the same service. We keep the old defaults, so if nothing is specified everything works as before * Added script that starts several instances of the services, mainly for illustrative purposes, but could be useful to quickly start. * The services are now killed on ctrl-c
- Loading branch information
Showing
2 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# This script can be used to run several instances of the different cadence services (matching, history, frontend, etc) | ||
# | ||
|
||
set -eo pipefail | ||
|
||
ctrl_c() { | ||
echo "Killing all the services" | ||
pkill -9 -P $$ | ||
} | ||
|
||
trap ctrl_c SIGINT | ||
|
||
# Start the services used in ringpop discovery on the default ports | ||
./cadence-server start & | ||
|
||
# Start two more instances of the frontend service on different ports | ||
FRONTEND_PORT=10001 FRONTEND_PORT_GRPC=10101 FRONTEND_PORT_PPROF=10201 \ | ||
./cadence-server --env development start --services frontend & | ||
FRONTEND_PORT=10002 FRONTEND_PORT_GRPC=10102 FRONTEND_PORT_PPROF=10202 \ | ||
./cadence-server --env development start --services frontend & | ||
|
||
# Start two more instances of the matching service on different ports | ||
MATCHING_PORT=11001 MATCHING_PORT_GRPC=11101 MATCHING_PORT_PPROF=11201 \ | ||
./cadence-server --env development start --services matching & | ||
MATCHING_PORT=11002 MATCHING_PORT_GRPC=11102 MATCHING_PORT_PPROF=11202 \ | ||
./cadence-server --env development start --services matching & | ||
|
||
# Start two more instances of the history service on different ports | ||
HISTORY_PORT=12001 HISTORY_PORT_GRPC=12101 HISTORY_PORT_PPROF=12201 \ | ||
./cadence-server --env development start --services history & | ||
HISTORY_PORT=12002 HISTORY_PORT_GRPC=12102 HISTORY_PORT_PPROF=12202 \ | ||
./cadence-server --env development start --services history & | ||
|
||
wait |