4.2.17-debian-10-r39 release
This commit is contained in:
parent
e5c3b5f761
commit
b933d8a03a
|
|
@ -10,8 +10,8 @@ COPY prebuildfs /
|
|||
# Install required system packages and dependencies
|
||||
RUN install_packages acl ca-certificates curl gzip libc6 libcom-err2 libcurl4 libffi6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed4 libidn2-0 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 libnettle6 libnghttp2-14 libp11-kit0 libpcap0.8 libpsl5 librtmp1 libsasl2-2 libssh2-1 libssl1.1 libtasn1-6 libunistring2 numactl procps tar zlib1g
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "yq" "4.14.1-0" --checksum 4883f9bf7d3454c72f11a6fd3218f001f049e28344045d7ab0df3bcb104deca7
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.0-3" --checksum 7521d9a4f9e4e182bf32977e234026caa7b03759799868335bccb1edd8f8fd12
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "render-template" "1.0.0-3" --checksum 8179ad1371c9a7d897fe3b1bf53bbe763f94edafef19acad2498dd48b3674efe
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "wait-for-port" "1.0.1-1" --checksum 28dc75dff64df07e67b711d20859c24ebc996db0eaac06138553341d0f769299
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "render-template" "1.0.1-1" --checksum 00722b62c7561929e039877a6e445a4bb782c340890c0a090fdae3c9e1960161
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "mongodb" "4.2.17-0" --checksum 67756c58b294913301c9b40c742054d9cf96798237fcc4c5c6bf14fbb1fa787c
|
||||
RUN . /opt/bitnami/scripts/libcomponent.sh && component_unpack "gosu" "1.14.0-0" --checksum 3e6fc37ca073b10a73a804d39c2f0c028947a1a596382a4f8ebe43dfbaa3a25e
|
||||
RUN chmod g+rwX /opt/bitnami
|
||||
|
|
@ -22,7 +22,7 @@ RUN ln -s /opt/bitnami/scripts/mongodb-sharded/run.sh /run.sh
|
|||
COPY rootfs /
|
||||
RUN /opt/bitnami/scripts/mongodb-sharded/postunpack.sh
|
||||
ENV BITNAMI_APP_NAME="mongodb-sharded" \
|
||||
BITNAMI_IMAGE_VERSION="4.2.17-debian-10-r38" \
|
||||
BITNAMI_IMAGE_VERSION="4.2.17-debian-10-r39" \
|
||||
PATH="/opt/bitnami/common/bin:/opt/bitnami/mongodb/bin:$PATH"
|
||||
|
||||
EXPOSE 27017
|
||||
|
|
|
|||
|
|
@ -15,17 +15,17 @@
|
|||
},
|
||||
"render-template": {
|
||||
"arch": "amd64",
|
||||
"digest": "8179ad1371c9a7d897fe3b1bf53bbe763f94edafef19acad2498dd48b3674efe",
|
||||
"digest": "00722b62c7561929e039877a6e445a4bb782c340890c0a090fdae3c9e1960161",
|
||||
"distro": "debian-10",
|
||||
"type": "NAMI",
|
||||
"version": "1.0.0-3"
|
||||
"version": "1.0.1-1"
|
||||
},
|
||||
"wait-for-port": {
|
||||
"arch": "amd64",
|
||||
"digest": "7521d9a4f9e4e182bf32977e234026caa7b03759799868335bccb1edd8f8fd12",
|
||||
"digest": "28dc75dff64df07e67b711d20859c24ebc996db0eaac06138553341d0f769299",
|
||||
"distro": "debian-10",
|
||||
"type": "NAMI",
|
||||
"version": "1.0.0-3"
|
||||
"version": "1.0.1-1"
|
||||
},
|
||||
"yq": {
|
||||
"arch": "amd64",
|
||||
|
|
|
|||
|
|
@ -50,8 +50,9 @@ ensure_dir_exists() {
|
|||
# boolean
|
||||
#########################
|
||||
is_dir_empty() {
|
||||
local dir="${1:?missing directory}"
|
||||
|
||||
local -r path="${1:?missing directory}"
|
||||
# Calculate real path in order to avoid issues with symlinks
|
||||
local -r dir="$(realpath "$path")"
|
||||
if [[ ! -e "$dir" ]] || [[ -z "$(ls -A "$dir")" ]]; then
|
||||
true
|
||||
else
|
||||
|
|
@ -88,7 +89,7 @@ is_file_writable() {
|
|||
local dir
|
||||
dir="$(dirname "$file")"
|
||||
|
||||
if [[ ( -f "$file" && -w "$file" ) || ( ! -f "$file" && -d "$dir" && -w "$dir" ) ]]; then
|
||||
if [[ (-f "$file" && -w "$file") || (! -f "$file" && -d "$dir" && -w "$dir") ]]; then
|
||||
true
|
||||
else
|
||||
false
|
||||
|
|
@ -136,31 +137,31 @@ configure_permissions_ownership() {
|
|||
shift 1
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
-f|--file-mode)
|
||||
shift
|
||||
file_mode="${1:?missing mode for files}"
|
||||
;;
|
||||
-d|--dir-mode)
|
||||
shift
|
||||
dir_mode="${1:?missing mode for directories}"
|
||||
;;
|
||||
-u|--user)
|
||||
shift
|
||||
user="${1:?missing user}"
|
||||
;;
|
||||
-g|--group)
|
||||
shift
|
||||
group="${1:?missing group}"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid command line flag $1" >&2
|
||||
return 1
|
||||
;;
|
||||
-f | --file-mode)
|
||||
shift
|
||||
file_mode="${1:?missing mode for files}"
|
||||
;;
|
||||
-d | --dir-mode)
|
||||
shift
|
||||
dir_mode="${1:?missing mode for directories}"
|
||||
;;
|
||||
-u | --user)
|
||||
shift
|
||||
user="${1:?missing user}"
|
||||
;;
|
||||
-g | --group)
|
||||
shift
|
||||
group="${1:?missing group}"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid command line flag $1" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
read -r -a filepaths <<< "$paths"
|
||||
read -r -a filepaths <<<"$paths"
|
||||
for p in "${filepaths[@]}"; do
|
||||
if [[ -e "$p" ]]; then
|
||||
if [[ -n $dir_mode ]]; then
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ mongodb_sharded_shard_currently_in_cluster() {
|
|||
local -r replicaset="${1:?node is required}"
|
||||
local result
|
||||
|
||||
result=$(mongodb_execute "$MONGODB_INITIAL_PRIMARY_ROOT_USER" "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" "admin" "$MONGODB_MONGOS_HOST" "$MONGODB_MONGOS_PORT_NUMBER" <<EOF
|
||||
result=$(mongodb_execute_print_output "$MONGODB_ROOT_USER" "$MONGODB_ROOT_PASSWORD" "admin" "$MONGODB_MONGOS_HOST" "$MONGODB_MONGOS_PORT_NUMBER" <<EOF
|
||||
db.adminCommand({ listShards: 1 })
|
||||
EOF
|
||||
)
|
||||
|
|
@ -56,9 +56,12 @@ mongodb_sharded_mongod_initialize() {
|
|||
ensure_dir_exists "$MONGODB_DATA_DIR/db"
|
||||
am_i_root && chown -R "$MONGODB_DAEMON_USER" "$MONGODB_DATA_DIR/db"
|
||||
|
||||
if [[ "$MONGODB_SHARDING_MODE" = "configsvr" ]] && [[ "$MONGODB_REPLICA_SET_MODE" = "primary" ]]; then
|
||||
mongodb_sharded_initiate_configsvr_primary
|
||||
mongodb_set_replicasetmode_conf
|
||||
|
||||
if [[ "$MONGODB_SHARDING_MODE" =~ ^(configsvr|shardsvr)$ ]] && [[ "$MONGODB_REPLICA_SET_MODE" = "primary" ]]; then
|
||||
mongodb_sharded_initiate_svr_primary
|
||||
fi
|
||||
|
||||
mongodb_start_bg
|
||||
mongodb_create_users
|
||||
mongodb_create_keyfile "$MONGODB_REPLICA_SET_KEY"
|
||||
|
|
@ -82,9 +85,9 @@ mongodb_sharded_mongod_initialize() {
|
|||
if [[ "$MONGODB_SHARDING_MODE" = "shardsvr" ]] && [[ "$MONGODB_REPLICA_SET_MODE" = "primary" ]]; then
|
||||
mongodb_wait_for_node "$MONGODB_MONGOS_HOST" "$MONGODB_MONGOS_PORT_NUMBER" "root" "$MONGODB_ROOT_PASSWORD"
|
||||
if ! mongodb_sharded_shard_currently_in_cluster "$MONGODB_REPLICA_SET_NAME"; then
|
||||
mongodb_sharded_join_shard_cluster
|
||||
mongodb_sharded_join_shard_cluster
|
||||
else
|
||||
info "Shard already in cluster"
|
||||
info "Shard already in cluster"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
@ -209,7 +212,7 @@ mongodb_sharded_is_join_shard_pending() {
|
|||
local -r password="${5:?password is required}"
|
||||
local result
|
||||
|
||||
result=$(mongodb_execute "$user" "$password" "admin" "$mongos_host" "$mongos_port" <<EOF
|
||||
result=$(mongodb_execute_print_output "$user" "$password" "admin" "$mongos_host" "$mongos_port" <<EOF
|
||||
sh.addShard("$shard_connection_string")
|
||||
EOF
|
||||
)
|
||||
|
|
@ -231,15 +234,12 @@ mongodb_sharded_configure_replica_set() {
|
|||
info "Configuring MongoDB Sharded replica set..."
|
||||
|
||||
node=$(get_mongo_hostname)
|
||||
mongodb_set_replicasetmode_conf
|
||||
mongodb_restart
|
||||
|
||||
case "$MONGODB_REPLICA_SET_MODE" in
|
||||
"primary" )
|
||||
if [[ "$MONGODB_SHARDING_MODE" = "configsvr" ]]; then
|
||||
mongodb_sharded_configure_configsvr_primary "$node"
|
||||
else
|
||||
mongodb_configure_primary "$node"
|
||||
if [[ "$MONGODB_SHARDING_MODE" =~ ^(configsvr|shardsvr)$ ]]; then
|
||||
mongodb_sharded_reconfigure_svr_primary "$node"
|
||||
fi
|
||||
;;
|
||||
"secondary")
|
||||
|
|
@ -259,7 +259,7 @@ mongodb_sharded_configure_replica_set() {
|
|||
}
|
||||
|
||||
########################
|
||||
# First initialization for the configsvr node
|
||||
# First initialization for the configsvr or shardsvr node
|
||||
# Globals:
|
||||
# MONGODB_*
|
||||
# Arguments:
|
||||
|
|
@ -267,19 +267,18 @@ mongodb_sharded_configure_replica_set() {
|
|||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
mongodb_sharded_initiate_configsvr_primary() {
|
||||
mongodb_sharded_is_configsvr_initiated() {
|
||||
mongodb_sharded_initiate_svr_primary() {
|
||||
mongodb_sharded_is_svr_initiated() {
|
||||
local result
|
||||
result=$(mongodb_execute "" "" "" "127.0.0.1" <<EOF
|
||||
rs.initiate({"_id":"$MONGODB_REPLICA_SET_NAME", "protocolVersion":1, "members":[{"_id":0,"host":"127.0.0.1:$MONGODB_PORT_NUMBER","priority":5}]})
|
||||
result=$(mongodb_execute_print_output "" "" "" "127.0.0.1" <<EOF
|
||||
rs.initiate({"_id":"$MONGODB_REPLICA_SET_NAME", "protocolVersion":1, "members":[{"_id":0,"host":"127.0.0.1:$MONGODB_PORT_NUMBER"}]})
|
||||
EOF
|
||||
)
|
||||
grep -q "\"ok\" : 1" <<< "$result"
|
||||
}
|
||||
|
||||
mongodb_set_replicasetmode_conf
|
||||
mongodb_start_bg
|
||||
if ! retry_while "mongodb_sharded_is_configsvr_initiated" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_sharded_is_svr_initiated" "$MONGODB_MAX_TIMEOUT"; then
|
||||
error "Unable to initialize primary config server: cannot initiate"
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -290,7 +289,7 @@ EOF
|
|||
}
|
||||
|
||||
########################
|
||||
# Get if primary node is reconfigured
|
||||
# Get if the configsvr or shardsvr primary node is reconfigured
|
||||
# Globals:
|
||||
# MONGODB_*
|
||||
# Arguments:
|
||||
|
|
@ -298,18 +297,19 @@ EOF
|
|||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
mongodb_sharded_is_configsvr_reconfigured() {
|
||||
mongodb_sharded_is_svr_primary_reconfigured() {
|
||||
local -r node="${1:?node is required}"
|
||||
local result
|
||||
result=$(mongodb_execute "root" "$MONGODB_ROOT_PASSWORD" "admin" "$node" "$MONGODB_PORT_NUMBER" <<EOF
|
||||
rs.reconfig({"_id":"$MONGODB_REPLICA_SET_NAME", "protocolVersion":1, "configsvr": true, "members":[{"_id":0,"host":"$node:$MONGODB_PORT_NUMBER","priority":5}]})
|
||||
|
||||
result=$(mongodb_execute_print_output "root" "$MONGODB_ROOT_PASSWORD" "admin" "$node" "$MONGODB_PORT_NUMBER" <<EOF
|
||||
rs.reconfig({"_id":"$MONGODB_REPLICA_SET_NAME","configsvr": $([[ "$MONGODB_SHARDING_MODE" = "configsvr" ]] && echo "true" || echo "false"),"protocolVersion":1,"members":[{"_id":0,"host":"$node:$MONGODB_PORT_NUMBER","priority":5}]})
|
||||
EOF
|
||||
)
|
||||
grep -q "\"ok\" : 1" <<< "$result"
|
||||
}
|
||||
|
||||
########################
|
||||
# Configure primary node
|
||||
# Reconfigure configsvr or shardsvr primary node
|
||||
# Globals:
|
||||
# MONGODB_*
|
||||
# Arguments:
|
||||
|
|
@ -317,13 +317,13 @@ EOF
|
|||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
mongodb_sharded_configure_configsvr_primary() {
|
||||
mongodb_sharded_reconfigure_svr_primary() {
|
||||
local -r node="${1:?node is required}"
|
||||
|
||||
info "Configuring MongoDB primary node...: $node"
|
||||
wait-for-port --timeout 360 "$MONGODB_PORT_NUMBER"
|
||||
|
||||
if ! retry_while "mongodb_sharded_is_configsvr_reconfigured $node" "$MONGODB_MAX_TIMEOUT"; then
|
||||
if ! retry_while "mongodb_sharded_is_svr_primary_reconfigured $node" "$MONGODB_MAX_TIMEOUT"; then
|
||||
error "Unable to initialize primary config server"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ Learn more about the Bitnami tagging policy and the difference between rolling t
|
|||
|
||||
* [`5.0`, `5.0-debian-10`, `5.0.3`, `5.0.3-debian-10-r-1` (5.0/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/5.0.3-debian-10-r-1/5.0/debian-10/Dockerfile)
|
||||
* [`4.4`, `4.4-debian-10`, `4.4.10`, `4.4.10-debian-10-r19`, `latest` (4.4/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.4.10-debian-10-r19/4.4/debian-10/Dockerfile)
|
||||
* [`4.2`, `4.2-debian-10`, `4.2.17`, `4.2.17-debian-10-r38` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.17-debian-10-r38/4.2/debian-10/Dockerfile)
|
||||
* [`4.2`, `4.2-debian-10`, `4.2.17`, `4.2.17-debian-10-r39` (4.2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.2.17-debian-10-r39/4.2/debian-10/Dockerfile)
|
||||
* [`4.0`, `4.0-debian-9`, `4.0.27`, `4.0.27-debian-9-r54` (4.0/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-mongodb/blob/4.0.27-debian-9-r54/4.0/debian-9/Dockerfile)
|
||||
|
||||
Subscribe to project updates by watching the [bitnami/mongodb GitHub repo](https://github.com/bitnami/bitnami-docker-mongodb).
|
||||
|
|
|
|||
Loading…
Reference in New Issue