Skip to content

Switch gossip mode when dc and rack are specified #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions 2.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ if [ "$1" = 'cassandra' ]; then

sed -ri 's/(- seeds:).*/\1 "'"$CASSANDRA_SEEDS"'"/' "$CASSANDRA_CONFIG/cassandra.yaml"

# Set Rack and Datacenter properties, if specified
for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
# Configure the setting in the properties file
sed -ri 's/^('"$rackdc"'=).*/\1'"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"

# Specifying rack and dc properties means you probably want GossipingPropertyFileSnitch
# as well, unless you specifically requested something else.
if [ ! "$CASSANDRA_ENDPOINT_SNITCH" ]; then
export CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
fi
fi
done

# Update supported Cassandra yaml properties from environment variables
for yaml in \
broadcast_address \
broadcast_rpc_address \
Expand All @@ -51,13 +68,6 @@ if [ "$1" = 'cassandra' ]; then
fi
done

for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
sed -ri 's/^('"$rackdc"'=).*/\1 '"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"
fi
done
fi

exec "$@"
24 changes: 17 additions & 7 deletions 2.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ if [ "$1" = 'cassandra' ]; then

sed -ri 's/(- seeds:).*/\1 "'"$CASSANDRA_SEEDS"'"/' "$CASSANDRA_CONFIG/cassandra.yaml"

# Set Rack and Datacenter properties, if specified
for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
# Configure the setting in the properties file
sed -ri 's/^('"$rackdc"'=).*/\1'"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"

# Specifying rack and dc properties means you probably want GossipingPropertyFileSnitch
# as well, unless you specifically requested something else.
if [ ! "$CASSANDRA_ENDPOINT_SNITCH" ]; then
export CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
fi
fi
done

# Update supported Cassandra yaml properties from environment variables
for yaml in \
broadcast_address \
broadcast_rpc_address \
Expand All @@ -51,13 +68,6 @@ if [ "$1" = 'cassandra' ]; then
fi
done

for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
sed -ri 's/^('"$rackdc"'=).*/\1 '"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"
fi
done
fi

exec "$@"
24 changes: 17 additions & 7 deletions 3.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ if [ "$1" = 'cassandra' ]; then

sed -ri 's/(- seeds:).*/\1 "'"$CASSANDRA_SEEDS"'"/' "$CASSANDRA_CONFIG/cassandra.yaml"

# Set Rack and Datacenter properties, if specified
for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
# Configure the setting in the properties file
sed -ri 's/^('"$rackdc"'=).*/\1'"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"

# Specifying rack and dc properties means you probably want GossipingPropertyFileSnitch
# as well, unless you specifically requested something else.
if [ ! "$CASSANDRA_ENDPOINT_SNITCH" ]; then
export CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
fi
fi
done

# Update supported Cassandra yaml properties from environment variables
for yaml in \
broadcast_address \
broadcast_rpc_address \
Expand All @@ -51,13 +68,6 @@ if [ "$1" = 'cassandra' ]; then
fi
done

for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
sed -ri 's/^('"$rackdc"'=).*/\1 '"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"
fi
done
fi

exec "$@"
24 changes: 17 additions & 7 deletions 3.11/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ if [ "$1" = 'cassandra' ]; then

sed -ri 's/(- seeds:).*/\1 "'"$CASSANDRA_SEEDS"'"/' "$CASSANDRA_CONFIG/cassandra.yaml"

# Set Rack and Datacenter properties, if specified
for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
# Configure the setting in the properties file
sed -ri 's/^('"$rackdc"'=).*/\1'"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"

# Specifying rack and dc properties means you probably want GossipingPropertyFileSnitch
# as well, unless you specifically requested something else.
if [ ! "$CASSANDRA_ENDPOINT_SNITCH" ]; then
export CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
fi
fi
done

# Update supported Cassandra yaml properties from environment variables
for yaml in \
broadcast_address \
broadcast_rpc_address \
Expand All @@ -51,13 +68,6 @@ if [ "$1" = 'cassandra' ]; then
fi
done

for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
sed -ri 's/^('"$rackdc"'=).*/\1 '"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"
fi
done
fi

exec "$@"
24 changes: 17 additions & 7 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ if [ "$1" = 'cassandra' ]; then

sed -ri 's/(- seeds:).*/\1 "'"$CASSANDRA_SEEDS"'"/' "$CASSANDRA_CONFIG/cassandra.yaml"

# Set Rack and Datacenter properties, if specified
for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
# Configure the setting in the properties file
sed -ri 's/^('"$rackdc"'=).*/\1'"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"

# Specifying rack and dc properties means you probably want GossipingPropertyFileSnitch
# as well, unless you specifically requested something else.
if [ ! "$CASSANDRA_ENDPOINT_SNITCH" ]; then
export CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
fi
fi
done

# Update supported Cassandra yaml properties from environment variables
for yaml in \
broadcast_address \
broadcast_rpc_address \
Expand All @@ -51,13 +68,6 @@ if [ "$1" = 'cassandra' ]; then
fi
done

for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
val="${!var}"
if [ "$val" ]; then
sed -ri 's/^('"$rackdc"'=).*/\1 '"$val"'/' "$CASSANDRA_CONFIG/cassandra-rackdc.properties"
fi
done
fi

exec "$@"