Skip to content

Commit

Permalink
Adding protoversion in config file (cadence-workflow#4263)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrodrigo authored Jun 23, 2021
1 parent 12ddac4 commit c4f2c09
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ docker run -e CASSANDRA_SEEDS=10.x.x.x -- csv of cassandra serv
-e KEYSPACE=<keyspace> -- Cassandra keyspace
-e VISIBILITY_KEYSPACE=<visibility_keyspace> -- Cassandra visibility keyspace, if using basic visibility
-e KAFKA_SEEDS=10.x.x.x -- Kafka broker seed, if using ElasticSearch + Kafka for advanced visibility feature
-e CASSANDRA_PROTOCOL_VERSION=<protocol_version> -- Cassandra protocol version
-e ES_SEEDS=10.x.x.x -- ElasticSearch seed , if using ElasticSearch + Kafka for advanced visibility feature
-e RINGPOP_SEEDS=10.x.x.x,10.x.x.x -- csv of ipaddrs for gossip bootstrap
-e STATSD_ENDPOINT=10.x.x.x:8125 -- statsd server endpoint
Expand Down
2 changes: 2 additions & 0 deletions docker/config_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ persistence:
keyspace: {{ default .Env.KEYSPACE "cadence" }}
user: {{ default .Env.CASSANDRA_USER "" }}
password: {{ default .Env.CASSANDRA_PASSWORD "" }}
protocolVersion: {{ default .Env.CASSANDRA_PROTOCOL_VERSION "4" }}
visibility:
nosql:
pluginName: "cassandra"
hosts: {{ default .Env.CASSANDRA_SEEDS "" }}
keyspace: {{ default .Env.VISIBILITY_KEYSPACE "cadence_visibility" }}
user: {{ default .Env.CASSANDRA_USER "" }}
password: {{ default .Env.CASSANDRA_PASSWORD "" }}
protocolVersion: {{ default .Env.CASSANDRA_PROTOCOL_VERSION "4" }}
{{- else if eq $db "mysql" }}
default:
sql:
Expand Down
5 changes: 3 additions & 2 deletions docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export CASSANDRA_USER="${CASSANDRA_USER:-cassandra}"
export CASSANDRA_PASSWORD="${CASSANDRA_PASSWORD:-cassandra}"
export KEYSPACE="${KEYSPACE:-cadence}"
export VISIBILITY_KEYSPACE="${VISIBILITY_KEYSPACE:-cadence_visibility}"
export CASSANDRA_PROTOCOL_VERSION="${CASSANDRA_PROTOCOL_VERSION:-4}"

# mysql env
export DBNAME="${DBNAME:-cadence}"
Expand Down Expand Up @@ -84,7 +85,7 @@ setup_schema() {

wait_for_cassandra() {
server=`echo $CASSANDRA_SEEDS | awk -F ',' '{print $1}'`
until cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASSWORD --cqlversion=3.4.4 $server < /dev/null; do
until cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASSWORD --cqlversion=3.4.4 --protocol-version=$CASSANDRA_PROTOCOL_VERSION $server < /dev/null; do
echo 'waiting for cassandra to start up'
sleep 1
done
Expand All @@ -93,7 +94,7 @@ wait_for_cassandra() {

wait_for_scylla() {
server=`echo $CASSANDRA_SEEDS | awk -F ',' '{print $1}'`
until cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASSWORD --cqlversion=3.3.1 $server < /dev/null; do
until cqlsh -u $CASSANDRA_USER -p $CASSANDRA_PASSWORD --cqlversion=3.3.1 --protocol-version=$CASSANDRA_PROTOCOL_VERSION $server < /dev/null; do
echo 'waiting for scylla to start up'
sleep 1
done
Expand Down

0 comments on commit c4f2c09

Please sign in to comment.