4.0.27-debian-9-r111 release

This commit is contained in:
Bitnami Bot 2022-01-05 20:02:52 +00:00
parent 1770abf049
commit 4eb2c17ef2
4 changed files with 95 additions and 9 deletions

View File

@ -12,14 +12,14 @@ RUN install_packages acl ca-certificates curl gzip libc6 libcomerr2 libcurl3 lib
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "yq" "4.16.2-0" --checksum f15327460a3006aae64e378e8a2753387882205418a8858fcb76aa9032a790be
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.1-4" --checksum c45ee409fbdf90bf18295323ba4242eeea060ad22c1a423e3a1d460d328942ee
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "render-template" "1.0.1-4" --checksum 9828603aa29cf7743a583f8e6214e474214775d3a4e841e5210fe8768d66a56c
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb" "4.0.27-0" --checksum 95b7a05fa4c90f5483f7a93d6b937fdba16ae44b016e5e3b2db6a5b7130462c9
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb" "4.0.27-1" --checksum ad3d8fd8122ddf409cac416626351559ffb8709691ed82579d2b26de129c5580
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-0" --checksum d177bc3da307f83d83ac8284be8062fc8b428e8f38a3b697876b5efc73ebf74f
RUN chmod g+rwX /opt/bitnami
COPY rootfs /
RUN /opt/bitnami/scripts/mongodb/postunpack.sh
ENV BITNAMI_APP_NAME="mongodb" \
BITNAMI_IMAGE_VERSION="4.0.27-debian-9-r109" \
BITNAMI_IMAGE_VERSION="4.0.27-debian-9-r111" \
PATH="/opt/bitnami/common/bin:/opt/bitnami/mongodb/bin:$PATH"
EXPOSE 27017

View File

@ -8,10 +8,10 @@
},
"mongodb": {
"arch": "amd64",
"digest": "95b7a05fa4c90f5483f7a93d6b937fdba16ae44b016e5e3b2db6a5b7130462c9",
"digest": "ad3d8fd8122ddf409cac416626351559ffb8709691ed82579d2b26de129c5580",
"distro": "debian-9",
"type": "NAMI",
"version": "4.0.27-0"
"version": "4.0.27-1"
},
"render-template": {
"arch": "amd64",

View File

@ -837,15 +837,16 @@ mongodb_is_secondary_node_pending() {
mongodb_set_dwc
debug "Adding secondary node ${node}:${port}"
result=$(
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" <<EOF
rs.add({host: '$node:$port'})
rs.add({host: '$node:$port', priority: 0, votes: 0})
EOF
)
debug "$result"
# Error code 103 is considered OK.
# It indicates a possiblely desynced configuration,
# which will become resynced when the secondary joins the replicaset.
# Error code 103 is considered OK
# It indicates a possibly desynced configuration, which will become resynced when the secondary joins the replicaset
# Note: Error NewReplicaSetConfigurationIncompatible rejects the node addition so we need to filter it out
if { grep -q "\"code\" : 103" <<<"$result"; } && ! { grep -q "NewReplicaSetConfigurationIncompatible" <<<"$result"; }; then
warn "The ReplicaSet configuration is not aligned with primary node's configuration. Starting secondary node so it syncs with ReplicaSet..."
@ -854,6 +855,62 @@ EOF
grep -q "\"ok\" : 1" <<<"$result"
}
########################
# Get if secondary node is ready to be granted voting rights
# Globals:
# MONGODB_*
# Arguments:
# $1 - node
# $2 - port
# Returns:
# Boolean
#########################
mongodb_is_secondary_node_ready() {
local -r node="${1:?node is required}"
local -r port="${2:?port is required}"
debug "Waiting for the node to be marked as secondary"
result=$(
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" <<EOF
rs.status().members.filter(m => m.name === '$node:$port' && m.stateStr === 'SECONDARY').length === 1
EOF
)
debug "$result"
grep -q "true" <<<"$result"
}
########################
# Grant voting rights to secondary node
# Globals:
# MONGODB_*
# Arguments:
# $1 - node
# $2 - port
# Returns:
# Boolean
#########################
mongodb_configure_secondary_node_voting() {
local -r node="${1:?node is required}"
local -r port="${2:?port is required}"
debug "Granting voting rights to the node"
local reconfig_cmd="rs.reconfigForPSASet(member, cfg)"
[[ "$(mongodb_get_version)" =~ ^4\.(0|2)\. ]] && reconfig_cmd="rs.reconfig(cfg)"
result=$(
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" <<EOF
cfg = rs.conf()
member = cfg.members.findIndex(m => m.host === '$node:$port')
cfg.members[member].priority = 1
cfg.members[member].votes = 1
$reconfig_cmd
EOF
)
debug "$result"
grep -q "\"ok\" : 1" <<<"$result"
}
########################
# Get if hidden node is pending
# Globals:
@ -871,6 +928,7 @@ mongodb_is_hidden_node_pending() {
mongodb_set_dwc
debug "Adding hidden node ${node}:${port}"
result=$(
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" <<EOF
rs.add({host: '$node:$port', hidden: true, priority: 0})
@ -903,6 +961,7 @@ mongodb_is_arbiter_node_pending() {
mongodb_set_dwc
debug "Adding arbiter node ${node}:${port}"
result=$(
mongodb_execute_print_output "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_INITIAL_PRIMARY_HOST" "$MONGODB_INITIAL_PRIMARY_PORT_NUMBER" <<EOF
rs.addArb('$node:$port')
@ -1086,6 +1145,20 @@ mongodb_configure_secondary() {
exit 1
fi
mongodb_wait_confirmation "$node"
# 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
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
error "Secondary node did not get marked as secondary"
exit 1
fi
fi
}
@ -1375,6 +1448,19 @@ mongodb_is_file_external() {
fi
}
########################
# Get MongoDB version
# Globals:
# MONGODB_*
# Arguments:
# None
# Returns:
# version
#########################
mongodb_get_version() {
mongo --version 2>/dev/null | grep 'shell version v' | sed 's/.* v//g'
}
########################
# Run custom initialization scripts
# Globals:

View File

@ -51,7 +51,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t
* [`5.0`, `5.0-debian-10`, `5.0.5`, `5.0.5-debian-10-r26` (5.0/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/5.0.5-debian-10-r26/5.0/debian-10/Dockerfile)
* [`4.4`, `4.4-debian-10`, `4.4.11`, `4.4.11-debian-10-r7`, `latest` (4.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.4.11-debian-10-r7/4.4/debian-10/Dockerfile)
* [`4.2`, `4.2-debian-10`, `4.2.18`, `4.2.18-debian-10-r1` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.18-debian-10-r1/4.2/debian-10/Dockerfile)
* [`4.0`, `4.0-debian-9`, `4.0.27`, `4.0.27-debian-9-r110` (4.0/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.0.27-debian-9-r110/4.0/debian-9/Dockerfile)
* [`4.0`, `4.0-debian-9`, `4.0.27`, `4.0.27-debian-9-r111` (4.0/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.0.27-debian-9-r111/4.0/debian-9/Dockerfile)
Subscribe to project updates by watching the [bitnami/mongodb GitHub repo](https://github.com/bitnami/bitnami-docker-mongodb).