Skip to content
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

journal doesnt work anymore #75699

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# where and how to store data.
storage:
dbPath: {{MONGODB_DATA_DIR}}/db
journal:
enabled: {{MONGODB_DEFAULT_ENABLE_JOURNAL}}
directoryPerDB: {{MONGODB_DEFAULT_ENABLE_DIRECTORY_PER_DB}}

# where to write logging data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,36 +470,6 @@ mongodb_set_log_conf() {
fi
}

########################
# Change journaling setting
# Globals:
# MONGODB_*
# Arguments:
# None
# Returns:
# None
#########################
mongodb_set_journal_conf() {
local -r conf_file_path="${1:-$MONGODB_CONF_FILE}"
local -r conf_file_name="${conf_file_path#"$MONGODB_CONF_DIR"}"
local mongodb_conf

if ! mongodb_is_file_external "$conf_file_name"; then
# Disable journal.enabled since it is not supported from 7.0 on
if [[ "$(mongodb_get_major_version)" -ge 7 ]]; then
mongodb_conf="$(sed '/journal:/,/enabled: .*/d' "$conf_file_path")"
echo "$mongodb_conf" >"$conf_file_path"
else
if [[ -n "$MONGODB_ENABLE_JOURNAL" ]]; then
mongodb_conf="$(sed -E "/^ *journal:/,/^ *[^:]*:/s/enabled:.*/enabled: $({ is_boolean_yes "$MONGODB_ENABLE_JOURNAL" && echo 'true'; } || echo 'false')/" "$conf_file_path")"
echo "$mongodb_conf" >"$conf_file_path"
fi
fi
else
debug "$conf_file_name mounted. Skipping setting log settings"
fi
}

########################
# Change common storage settings
# Globals:
Expand Down Expand Up @@ -1425,7 +1395,6 @@ mongodb_initialize() {
mongodb_copy_mounted_config
mongodb_set_net_conf "$MONGODB_CONF_FILE"
mongodb_set_log_conf "$MONGODB_CONF_FILE"
mongodb_set_journal_conf "$MONGODB_CONF_FILE"
mongodb_set_storage_conf "$MONGODB_CONF_FILE"
is_boolean_yes "$MONGODB_DISABLE_JAVASCRIPT" && mongodb_disable_javascript_conf "$MONGODB_CONF_FILE"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ mongodb_env_vars=(
MONGODB_ADVERTISE_IP
MONGODB_ADVERTISED_PORT_NUMBER
MONGODB_DISABLE_JAVASCRIPT
MONGODB_ENABLE_JOURNAL
MONGODB_DISABLE_SYSTEM_LOG
MONGODB_ENABLE_DIRECTORY_PER_DB
MONGODB_ENABLE_IPV6
Expand Down Expand Up @@ -123,7 +122,6 @@ export MONGODB_ADVERTISED_HOSTNAME="${MONGODB_ADVERTISED_HOSTNAME:-}"
export MONGODB_ADVERTISE_IP="${MONGODB_ADVERTISE_IP:-false}"
export MONGODB_ADVERTISED_PORT_NUMBER="${MONGODB_ADVERTISED_PORT_NUMBER:-}"
export MONGODB_DISABLE_JAVASCRIPT="${MONGODB_DISABLE_JAVASCRIPT:-no}"
export MONGODB_ENABLE_JOURNAL="${MONGODB_ENABLE_JOURNAL:-}"
export MONGODB_DEFAULT_ENABLE_JOURNAL="true"
export MONGODB_DISABLE_SYSTEM_LOG="${MONGODB_DISABLE_SYSTEM_LOG:-}"
export MONGODB_DEFAULT_DISABLE_SYSTEM_LOG="false"
Expand Down
23 changes: 0 additions & 23 deletions bitnami/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ docker-compose up -d
| `MONGODB_ADVERTISE_IP` | Whether advertised hostname is set to container ip | `false` |
| `MONGODB_ADVERTISED_PORT_NUMBER` | MongoDB advertised port number. It is recommended to pass this environment variable if you have a proxy port forwarding requests to container. | `nil` |
| `MONGODB_DISABLE_JAVASCRIPT` | Disable MongoDB server-side javascript execution | `no` |
| `MONGODB_ENABLE_JOURNAL` | Enable MongoDB journal | `nil` |
| `MONGODB_DISABLE_SYSTEM_LOG` | Disable MongoDB daemon system log | `nil` |
| `MONGODB_ENABLE_DIRECTORY_PER_DB` | Use a separate folder for storing each database data | `nil` |
| `MONGODB_ENABLE_IPV6` | Use IPv6 for database connections | `nil` |
Expand Down Expand Up @@ -348,28 +347,6 @@ services:
...
```

### Enabling/disabling journaling

Enabling/disabling [journal](https://docs.mongodb.com/manual/reference/configuration-options/#mongodb-setting-storage.journal.enabled) is possible through the following env var:

* `MONGODB_ENABLE_JOURNAL`: Whether to enable/disable journaling on MongoDB®. Default: `true`. Possible values: `[true, false]`

```console
docker run --name mongodb -e ALLOW_EMPTY_PASSWORD=yes -e MONGODB_ENABLE_JOURNAL=true bitnami/mongodb:latest
```

or by modifying the [`docker-compose.yml`](https://github.com/bitnami/containers/blob/main/bitnami/mongodb/docker-compose.yml) file present in this repository:

```yaml
services:
mongodb:
...
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MONGODB_ENABLE_JOURNAL=true
...
```

### Setting the root user and password on first run

Passing the `MONGODB_ROOT_PASSWORD` environment variable when running the image for the first time will set the password of `MONGODB_ROOT_USER` to the value of `MONGODB_ROOT_PASSWORD` and enable authentication on the MongoDB® server. If unset, `MONGODB_ROOT_USER` defaults to `root`.
Expand Down
Loading