mirror of
https://github.com/bitnami/containers.git
synced 2026-10-18 09:03:23 +02:00
[bitnami/mongodb-sharded] Release 5.0.23-debian-11-r5 (#54337)
Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
@@ -7,10 +7,10 @@ ARG TARGETARCH
|
||||
|
||||
LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \
|
||||
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \
|
||||
org.opencontainers.image.created="2023-12-24T08:19:49Z" \
|
||||
org.opencontainers.image.created="2024-01-02T12:57:01Z" \
|
||||
org.opencontainers.image.description="Application packaged by VMware, Inc" \
|
||||
org.opencontainers.image.licenses="Apache-2.0" \
|
||||
org.opencontainers.image.ref.name="5.0.23-debian-11-r4" \
|
||||
org.opencontainers.image.ref.name="5.0.23-debian-11-r5" \
|
||||
org.opencontainers.image.title="mongodb-sharded" \
|
||||
org.opencontainers.image.vendor="VMware, Inc." \
|
||||
org.opencontainers.image.version="5.0.23"
|
||||
|
||||
+4
-4
@@ -191,7 +191,7 @@ mongodb_sharded_set_sharding_conf() {
|
||||
mongodb_sharded_join_shard_cluster() {
|
||||
mongodb_start_bg
|
||||
info "Joining the shard cluster"
|
||||
if ! retry_while "mongodb_sharded_is_join_shard_pending $MONGODB_REPLICA_SET_NAME/$MONGODB_ADVERTISED_HOSTNAME:$MONGODB_PORT_NUMBER $MONGODB_MONGOS_HOST $MONGODB_MONGOS_PORT_NUMBER root $MONGODB_ROOT_PASSWORD" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_sharded_is_join_shard_pending $MONGODB_REPLICA_SET_NAME/$MONGODB_ADVERTISED_HOSTNAME:$MONGODB_PORT_NUMBER $MONGODB_MONGOS_HOST $MONGODB_MONGOS_PORT_NUMBER root $MONGODB_ROOT_PASSWORD" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Unable to join the sharded cluster"
|
||||
exit 1
|
||||
fi
|
||||
@@ -283,11 +283,11 @@ EOF
|
||||
}
|
||||
|
||||
mongodb_start_bg
|
||||
if ! retry_while "mongodb_sharded_is_svr_initiated" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_sharded_is_svr_initiated" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Unable to initialize primary config server: cannot initiate"
|
||||
exit 1
|
||||
fi
|
||||
if ! retry_while "mongodb_is_primary_node_up 127.0.0.1 $MONGODB_PORT_NUMBER admin" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_primary_node_up 127.0.0.1 $MONGODB_PORT_NUMBER admin" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Unable to initialize primary config server: cannot become primary"
|
||||
exit 1
|
||||
fi
|
||||
@@ -329,7 +329,7 @@ mongodb_sharded_reconfigure_svr_primary() {
|
||||
info "Configuring MongoDB primary node...: $node"
|
||||
wait-for-port --timeout 360 "$MONGODB_PORT_NUMBER"
|
||||
|
||||
if ! retry_while "mongodb_sharded_is_svr_primary_reconfigured $node" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_sharded_is_svr_primary_reconfigured $node" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Unable to initialize primary config server"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -383,7 +383,7 @@ mongodb_start_bg() {
|
||||
fi
|
||||
|
||||
# wait until the server is up and answering queries
|
||||
if ! retry_while "mongodb_is_mongodb_started" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_mongodb_started" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "MongoDB did not start"
|
||||
exit 1
|
||||
fi
|
||||
@@ -423,7 +423,7 @@ mongodb_stop() {
|
||||
info "Stopping MongoDB..."
|
||||
|
||||
stop_service_using_pid "$MONGODB_PID_FILE"
|
||||
if ! retry_while "is_mongodb_not_running" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "is_mongodb_not_running" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "MongoDB failed to stop"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1003,7 +1003,7 @@ mongodb_configure_primary() {
|
||||
info "Configuring MongoDB primary node"
|
||||
wait-for-port --timeout 360 "$MONGODB_PORT_NUMBER"
|
||||
|
||||
if ! retry_while "mongodb_is_primary_node_initiated $node $port" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_primary_node_initiated $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "MongoDB primary node failed to get configured"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1024,7 +1024,7 @@ mongodb_wait_confirmation() {
|
||||
local -r port="${2:?port is required}"
|
||||
|
||||
debug "Waiting until ${node}:${port} is added to the replica set..."
|
||||
if ! retry_while "mongodb_node_currently_in_cluster ${node} ${port}" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_node_currently_in_cluster ${node} ${port}" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Unable to confirm that ${node}:${port} has been added to the replica set!"
|
||||
exit 1
|
||||
else
|
||||
@@ -1098,14 +1098,14 @@ mongodb_wait_for_node() {
|
||||
debug "Waiting for primary node..."
|
||||
|
||||
info "Trying to connect to MongoDB server $host..."
|
||||
if ! retry_while "wait-for-port --host $host --timeout 10 $port" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "wait-for-port --host $host --timeout 10 $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Unable to connect to host $host"
|
||||
exit 1
|
||||
else
|
||||
info "Found MongoDB server listening at $host:$port !"
|
||||
fi
|
||||
|
||||
if ! retry_while "mongodb_is_node_available $host $port $user $password" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_node_available $host $port $user $password" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Node $host did not become available"
|
||||
exit 1
|
||||
else
|
||||
@@ -1130,7 +1130,7 @@ mongodb_wait_for_primary_node() {
|
||||
mongodb_wait_for_node "$host" "$port" "$user" "$password"
|
||||
|
||||
debug "Waiting for primary host $host to be ready..."
|
||||
if ! retry_while "mongodb_is_primary_node_up $host $port $user $password" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_primary_node_up $host $port $user $password" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Unable to validate $host as primary node in the replica set scenario!"
|
||||
exit 1
|
||||
else
|
||||
@@ -1158,7 +1158,7 @@ mongodb_configure_secondary() {
|
||||
info "Node currently in the cluster"
|
||||
else
|
||||
info "Adding node to the cluster"
|
||||
if ! retry_while "mongodb_is_secondary_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_secondary_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Secondary node did not get ready"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1166,14 +1166,14 @@ mongodb_configure_secondary() {
|
||||
|
||||
# Ensure that secondary nodes do not count as voting members until they are fully initialized
|
||||
# https://docs.mongodb.com/manual/reference/method/rs.add/#behavior
|
||||
if ! retry_while "mongodb_is_secondary_node_ready $node $port" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_secondary_node_ready $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Secondary node did not get marked as secondary"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Grant voting rights to node
|
||||
# https://docs.mongodb.com/manual/tutorial/modify-psa-replica-set-safely/
|
||||
if ! retry_while "mongodb_configure_secondary_node_voting $node $port" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_configure_secondary_node_voting $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Secondary node did not get marked as secondary"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1208,7 +1208,7 @@ mongodb_configure_hidden() {
|
||||
info "Node currently in the cluster"
|
||||
else
|
||||
info "Adding hidden node to the cluster"
|
||||
if ! retry_while "mongodb_is_hidden_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_hidden_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Hidden node did not get ready"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1236,7 +1236,7 @@ mongodb_configure_arbiter() {
|
||||
info "Node currently in the cluster"
|
||||
else
|
||||
info "Configuring MongoDB arbiter node"
|
||||
if ! retry_while "mongodb_is_arbiter_node_pending $node $port" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_is_arbiter_node_pending $node $port" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY"; then
|
||||
error "Arbiter node did not get ready"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1277,7 +1277,7 @@ EOF
|
||||
mongodb_wait_until_sync_complete() {
|
||||
info "Waiting until initial data sync is complete..."
|
||||
|
||||
if ! retry_while "mongodb_is_not_in_sync" "$MONGODB_MAX_TIMEOUT" 1; then
|
||||
if ! retry_while "mongodb_is_not_in_sync" "$MONGODB_INIT_RETRY_ATTEMPTS" "$MONGODB_INIT_RETRY_DELAY" 1; then
|
||||
error "Initial data sync did not finish after $MONGODB_MAX_TIMEOUT seconds"
|
||||
exit 1
|
||||
else
|
||||
|
||||
@@ -25,7 +25,8 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}"
|
||||
# variable will be overridden with the value specified in that file
|
||||
mongodb_env_vars=(
|
||||
MONGODB_MOUNTED_CONF_DIR
|
||||
MONGODB_MAX_TIMEOUT
|
||||
MONGODB_INIT_RETRY_ATTEMPTS
|
||||
MONGODB_INIT_RETRY_DELAY
|
||||
MONGODB_PORT_NUMBER
|
||||
MONGODB_ENABLE_MAJORITY_READ
|
||||
MONGODB_DEFAULT_ENABLE_MAJORITY_READ
|
||||
@@ -112,7 +113,8 @@ export MONGODB_DAEMON_GROUP="mongo"
|
||||
|
||||
# MongoDB configuration
|
||||
export MONGODB_MOUNTED_CONF_DIR="${MONGODB_MOUNTED_CONF_DIR:-${MONGODB_VOLUME_DIR}/conf}"
|
||||
export MONGODB_MAX_TIMEOUT="${MONGODB_MAX_TIMEOUT:-35}"
|
||||
export MONGODB_INIT_RETRY_ATTEMPTS="${MONGODB_INIT_RETRY_ATTEMPTS:-7}"
|
||||
export MONGODB_INIT_RETRY_DELAY="${MONGODB_INIT_RETRY_DELAY:-5}"
|
||||
export MONGODB_DEFAULT_PORT_NUMBER="27017"
|
||||
export MONGODB_PORT_NUMBER="${MONGODB_PORT_NUMBER:-$MONGODB_DEFAULT_PORT_NUMBER}"
|
||||
export MONGODB_ENABLE_MAJORITY_READ="${MONGODB_ENABLE_MAJORITY_READ:-true}"
|
||||
|
||||
Reference in New Issue
Block a user