Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- wait till cert files appear, because node-init may not finished before a container starts - provision vrouter with host ip taken from vhost0 - non empty default value for SERVER_CA_CERTFILE - retries for detecting own IP in 3rd party containers, in case of all-in-one there is a race with vhost0 initialization (at this moment there is no own ip detected) Change-Id: Id08030a70b859b660ef9843a37256b2326176963 Partial-Bug: #1760051
- Loading branch information
Showing
10 changed files
with
227 additions
and
159 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
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 |
---|---|---|
@@ -1,32 +1,40 @@ | ||
#!/bin/bash -e | ||
|
||
IFS=',' read -ra srv_list <<< "$CASSANDRA_SEEDS" | ||
local_ips=",$(cat "/proc/net/fib_trie" | awk '/32 host/ { print f } {f=$2}' | tr '\n' ',')," | ||
for srv in "${srv_list[@]}"; do | ||
if [[ "$local_ips" =~ ",$srv," ]] ; then | ||
echo "INFO: found '$srv' in local IPs '$local_ips'" | ||
my_ip=$srv | ||
# In all in one deployment there is the race between vhost0 initialization | ||
# and own IP detection, so there is 10 retries | ||
for i in {1..10} ; do | ||
my_ip='' | ||
IFS=',' read -ra srv_list <<< "$CASSANDRA_SEEDS" | ||
local_ips=",$(cat "/proc/net/fib_trie" | awk '/32 host/ { print f } {f=$2}' | tr '\n' ',')," | ||
for srv in "${srv_list[@]}"; do | ||
if [[ "$local_ips" =~ ",$srv," ]] ; then | ||
echo "INFO: found '$srv' in local IPs '$local_ips'" | ||
my_ip=$srv | ||
break | ||
fi | ||
done | ||
if [ -n "$my_ip" ]; then | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
|
||
|
||
if [ -z "$my_ip" ]; then | ||
echo "ERROR: Cannot find self ips ('$local_ips') in Cassandra nodes ('$CASSANDRA_SEEDS')" | ||
exit | ||
exit -1 | ||
fi | ||
|
||
# use first two servers as seeds | ||
export CASSANDRA_SEEDS=$(echo $CASSANDRA_SEEDS | cut -d ',' -f 1,2) | ||
export CASSANDRA_LISTEN_ADDRESS=$my_ip | ||
|
||
export JVM_EXTRA_OPTS="-Dcassandra.rpc_port=${CASSANDRA_PORT:-9160} \ | ||
export JVM_EXTRA_OPTS="${JVM_EXTRA_OPTS} -Dcassandra.rpc_port=${CASSANDRA_PORT:-9160} \ | ||
-Dcassandra.native_transport_port=${CASSANDRA_CQL_PORT:-9042} \ | ||
-Dcassandra.ssl_storage_port=${CASSANDRA_SSL_STORAGE_PORT:-7011} \ | ||
-Dcassandra.storage_port=${CASSANDRA_STORAGE_PORT:-7010} \ | ||
-Dcassandra.jmx.local.port=${CASSANDRA_JMX_LOCAL_PORT:-7200}" | ||
|
||
echo "INFO: CASSANDRA_SEEDS=$CASSANDRA_SEEDS CASSANDRA_LISTEN_ADDRESS=$CASSANDRA_LISTEN_ADDRESS" | ||
echo "INFO: CASSANDRA_SEEDS=$CASSANDRA_SEEDS CASSANDRA_LISTEN_ADDRESS=$CASSANDRA_LISTEN_ADDRESS JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" | ||
echo "INFO: exec /docker-entrypoint.sh $@" | ||
|
||
exec /docker-entrypoint.sh "$@" |
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
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
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
Oops, something went wrong.