diff --git a/bitnami/valkey/7.2/debian-12/Dockerfile b/bitnami/valkey/7.2/debian-12/Dockerfile index 33974dd9a9250..2f3dd7b743a89 100644 --- a/bitnami/valkey/7.2/debian-12/Dockerfile +++ b/bitnami/valkey/7.2/debian-12/Dockerfile @@ -3,15 +3,16 @@ FROM docker.io/bitnami/minideb:bookworm +ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith" ARG TARGETARCH LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2024-10-04T10:43:18Z" \ + org.opencontainers.image.created="2024-10-22T15:56:55Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/valkey/README.md" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="7.2.7-debian-12-r0" \ + org.opencontainers.image.ref.name="7.2.7-debian-12-r1" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/valkey" \ org.opencontainers.image.title="valkey" \ org.opencontainers.image.vendor="Broadcom, Inc." \ @@ -29,12 +30,12 @@ RUN install_packages ca-certificates curl libgomp1 libssl3 procps RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \ COMPONENTS=( \ "wait-for-port-1.0.8-5-linux-${OS_ARCH}-debian-12" \ - "valkey-7.2.7-0-linux-${OS_ARCH}-debian-12" \ + "valkey-7.2.7-3-linux-${OS_ARCH}-debian-12" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ - curl -SsLf "https://downloads.bitnami.com/files/stacksmith/${COMPONENT}.tar.gz" -O ; \ - curl -SsLf "https://downloads.bitnami.com/files/stacksmith/${COMPONENT}.tar.gz.sha256" -O ; \ + curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz" -O ; \ + curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz.sha256" -O ; \ fi ; \ sha256sum -c "${COMPONENT}.tar.gz.sha256" ; \ tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner --wildcards '*/files' ; \ diff --git a/bitnami/valkey/7.2/debian-12/docker-compose-replicaset.yml b/bitnami/valkey/7.2/debian-12/docker-compose-replicaset.yml index 2752343c60a1a..a275a047df0ca 100644 --- a/bitnami/valkey/7.2/debian-12/docker-compose-replicaset.yml +++ b/bitnami/valkey/7.2/debian-12/docker-compose-replicaset.yml @@ -7,23 +7,23 @@ services: ports: - '6379' environment: - - VALKEY_REPLICATION_MODE=master + - VALKEY_REPLICATION_MODE=primary - VALKEY_PASSWORD=my_password - VALKEY_DISABLE_COMMANDS=FLUSHDB,FLUSHALL volumes: - 'valkey_data:/bitnami/valkey/data' - valkey-secondary: + valkey-replica: image: docker.io/bitnami/valkey:7.2 ports: - '6379' depends_on: - valkey-primary environment: - - VALKEY_REPLICATION_MODE=slave - - VALKEY_MASTER_HOST=valkey-primary - - VALKEY_MASTER_PORT_NUMBER=6379 - - VALKEY_MASTER_PASSWORD=my_password + - VALKEY_REPLICATION_MODE=replica + - VALKEY_PRIMARY_HOST=valkey-primary + - VALKEY_PRIMARY_PORT_NUMBER=6379 + - VALKEY_PRIMARY_PASSWORD=my_password - VALKEY_PASSWORD=my_password - VALKEY_DISABLE_COMMANDS=FLUSHDB,FLUSHALL diff --git a/bitnami/valkey/7.2/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json b/bitnami/valkey/7.2/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json index d9991e12ec806..a80ce51349e99 100644 --- a/bitnami/valkey/7.2/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json +++ b/bitnami/valkey/7.2/debian-12/prebuildfs/opt/bitnami/.bitnami_components.json @@ -3,7 +3,7 @@ "arch": "amd64", "distro": "debian-12", "type": "NAMI", - "version": "7.2.7-0" + "version": "7.2.7-3" }, "wait-for-port": { "arch": "amd64", diff --git a/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/libvalkey.sh b/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/libvalkey.sh index e16ee6ae576da..1e87bd02153b9 100644 --- a/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/libvalkey.sh +++ b/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/libvalkey.sh @@ -199,17 +199,17 @@ valkey_validate() { [[ -z "$VALKEY_PASSWORD" ]] && empty_password_error VALKEY_PASSWORD fi if [[ -n "$VALKEY_REPLICATION_MODE" ]]; then - if [[ "$VALKEY_REPLICATION_MODE" =~ ^(slave|replica)$ ]]; then - if [[ -n "$VALKEY_MASTER_PORT_NUMBER" ]]; then - if ! err=$(validate_port "$VALKEY_MASTER_PORT_NUMBER"); then - print_validation_error "An invalid port was specified in the environment variable VALKEY_MASTER_PORT_NUMBER: $err" + if [[ "$VALKEY_REPLICATION_MODE" = "replica" ]]; then + if [[ -n "$VALKEY_PRIMARY_PORT_NUMBER" ]]; then + if ! err=$(validate_port "$VALKEY_PRIMARY_PORT_NUMBER"); then + print_validation_error "An invalid port was specified in the environment variable VALKEY_PRIMARY_PORT_NUMBER: $err" fi fi - if ! is_boolean_yes "$ALLOW_EMPTY_PASSWORD" && [[ -z "$VALKEY_MASTER_PASSWORD" ]]; then - empty_password_error VALKEY_MASTER_PASSWORD + if ! is_boolean_yes "$ALLOW_EMPTY_PASSWORD" && [[ -z "$VALKEY_PRIMARY_PASSWORD" ]]; then + empty_password_error VALKEY_PRIMARY_PASSWORD fi - elif [[ "$VALKEY_REPLICATION_MODE" != "master" ]]; then - print_validation_error "Invalid replication mode. Available options are 'master/replica'" + elif [[ "$VALKEY_REPLICATION_MODE" != "primary" ]]; then + print_validation_error "Invalid replication mode. Available options are 'primary/replica'" fi fi if is_boolean_yes "$VALKEY_TLS_ENABLED"; then @@ -257,32 +257,29 @@ valkey_configure_replication() { info "Configuring replication mode" valkey_conf_set replica-announce-ip "${VALKEY_REPLICA_IP:-$(get_machine_ip)}" - valkey_conf_set replica-announce-port "${VALKEY_REPLICA_PORT:-$VALKEY_MASTER_PORT_NUMBER}" + valkey_conf_set replica-announce-port "${VALKEY_REPLICA_PORT:-$VALKEY_PRIMARY_PORT_NUMBER}" # Use TLS in the replication connections if is_boolean_yes "$VALKEY_TLS_ENABLED"; then valkey_conf_set tls-replication yes fi - if [[ "$VALKEY_REPLICATION_MODE" = "master" ]]; then + if [[ "$VALKEY_REPLICATION_MODE" = "primary" ]]; then if [[ -n "$VALKEY_PASSWORD" ]]; then - valkey_conf_set masterauth "$VALKEY_PASSWORD" + valkey_conf_set primaryauth "$VALKEY_PASSWORD" fi - elif [[ "$VALKEY_REPLICATION_MODE" =~ ^(slave|replica)$ ]]; then + elif [[ "$VALKEY_REPLICATION_MODE" = "replica" ]]; then if [[ -n "$VALKEY_SENTINEL_HOST" ]]; then local -a sentinel_info_command=("valkey-cli" "-h" "${VALKEY_SENTINEL_HOST}" "-p" "${VALKEY_SENTINEL_PORT_NUMBER}") is_boolean_yes "$VALKEY_TLS_ENABLED" && sentinel_info_command+=("--tls" "--cert" "${VALKEY_TLS_CERT_FILE}" "--key" "${VALKEY_TLS_KEY_FILE}") # shellcheck disable=SC2015 is_empty_value "$VALKEY_TLS_CA_FILE" && sentinel_info_command+=("--cacertdir" "${VALKEY_TLS_CA_DIR}") || sentinel_info_command+=("--cacert" "${VALKEY_TLS_CA_FILE}") - sentinel_info_command+=("sentinel" "get-master-addr-by-name" "${VALKEY_SENTINEL_MASTER_NAME}") + sentinel_info_command+=("sentinel" "get-master-addr-by-name" "${VALKEY_SENTINEL_PRIMARY_NAME}") read -r -a VALKEY_SENTINEL_INFO <<< "$("${sentinel_info_command[@]}" | tr '\n' ' ')" - VALKEY_MASTER_HOST=${VALKEY_SENTINEL_INFO[0]} - VALKEY_MASTER_PORT_NUMBER=${VALKEY_SENTINEL_INFO[1]} + VALKEY_PRIMARY_HOST=${VALKEY_SENTINEL_INFO[0]} + VALKEY_PRIMARY_PORT_NUMBER=${VALKEY_SENTINEL_INFO[1]} fi - wait-for-port --host "$VALKEY_MASTER_HOST" "$VALKEY_MASTER_PORT_NUMBER" - [[ -n "$VALKEY_MASTER_PASSWORD" ]] && valkey_conf_set masterauth "$VALKEY_MASTER_PASSWORD" - # Starting with Valkey 5, use 'replicaof' instead of 'slaveof'. Maintaining both for backward compatibility - local parameter="replicaof" - [[ $(valkey_major_version) -lt 5 ]] && parameter="slaveof" - valkey_conf_set "$parameter" "$VALKEY_MASTER_HOST $VALKEY_MASTER_PORT_NUMBER" + wait-for-port --host "$VALKEY_PRIMARY_HOST" "$VALKEY_PRIMARY_PORT_NUMBER" + [[ -n "$VALKEY_PRIMARY_PASSWORD" ]] && valkey_conf_set primaryauth "$VALKEY_PRIMARY_PASSWORD" + valkey_conf_set "replicaof" "$VALKEY_PRIMARY_HOST $VALKEY_PRIMARY_PORT_NUMBER" fi } diff --git a/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/valkey-env.sh b/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/valkey-env.sh index b941ce1221327..a7666c1b96917 100644 --- a/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/valkey-env.sh +++ b/bitnami/valkey/7.2/debian-12/rootfs/opt/bitnami/scripts/valkey-env.sh @@ -31,8 +31,8 @@ valkey_env_vars=( VALKEY_AOF_ENABLED VALKEY_RDB_POLICY VALKEY_RDB_POLICY_DISABLED - VALKEY_MASTER_HOST - VALKEY_MASTER_PORT_NUMBER + VALKEY_PRIMARY_HOST + VALKEY_PRIMARY_PORT_NUMBER VALKEY_PORT_NUMBER VALKEY_ALLOW_REMOTE_CONNECTIONS VALKEY_REPLICATION_MODE @@ -41,7 +41,7 @@ valkey_env_vars=( VALKEY_EXTRA_FLAGS ALLOW_EMPTY_PASSWORD VALKEY_PASSWORD - VALKEY_MASTER_PASSWORD + VALKEY_PRIMARY_PASSWORD VALKEY_ACLFILE VALKEY_IO_THREADS_DO_READS VALKEY_IO_THREADS @@ -54,7 +54,7 @@ valkey_env_vars=( VALKEY_TLS_CA_FILE VALKEY_TLS_DH_PARAMS_FILE VALKEY_TLS_AUTH_CLIENTS - VALKEY_SENTINEL_MASTER_NAME + VALKEY_SENTINEL_PRIMARY_NAME VALKEY_SENTINEL_HOST VALKEY_SENTINEL_PORT_NUMBER VALKEY_TLS_PORT @@ -98,8 +98,8 @@ export VALKEY_DATABASE="${VALKEY_DATABASE:-valkey}" export VALKEY_AOF_ENABLED="${VALKEY_AOF_ENABLED:-yes}" export VALKEY_RDB_POLICY="${VALKEY_RDB_POLICY:-}" export VALKEY_RDB_POLICY_DISABLED="${VALKEY_RDB_POLICY_DISABLED:-no}" -export VALKEY_MASTER_HOST="${VALKEY_MASTER_HOST:-}" -export VALKEY_MASTER_PORT_NUMBER="${VALKEY_MASTER_PORT_NUMBER:-6379}" +export VALKEY_PRIMARY_HOST="${VALKEY_PRIMARY_HOST:-}" +export VALKEY_PRIMARY_PORT_NUMBER="${VALKEY_PRIMARY_PORT_NUMBER:-6379}" export VALKEY_DEFAULT_PORT_NUMBER="6379" # only used at build time export VALKEY_PORT_NUMBER="${VALKEY_PORT_NUMBER:-$VALKEY_DEFAULT_PORT_NUMBER}" export VALKEY_ALLOW_REMOTE_CONNECTIONS="${VALKEY_ALLOW_REMOTE_CONNECTIONS:-yes}" @@ -109,7 +109,7 @@ export VALKEY_REPLICA_PORT="${VALKEY_REPLICA_PORT:-}" export VALKEY_EXTRA_FLAGS="${VALKEY_EXTRA_FLAGS:-}" export ALLOW_EMPTY_PASSWORD="${ALLOW_EMPTY_PASSWORD:-no}" export VALKEY_PASSWORD="${VALKEY_PASSWORD:-}" -export VALKEY_MASTER_PASSWORD="${VALKEY_MASTER_PASSWORD:-}" +export VALKEY_PRIMARY_PASSWORD="${VALKEY_PRIMARY_PASSWORD:-}" export VALKEY_ACLFILE="${VALKEY_ACLFILE:-}" export VALKEY_IO_THREADS_DO_READS="${VALKEY_IO_THREADS_DO_READS:-}" export VALKEY_IO_THREADS="${VALKEY_IO_THREADS:-}" @@ -127,7 +127,7 @@ export VALKEY_TLS_DH_PARAMS_FILE="${VALKEY_TLS_DH_PARAMS_FILE:-}" export VALKEY_TLS_AUTH_CLIENTS="${VALKEY_TLS_AUTH_CLIENTS:-yes}" # Valkey Sentinel cluster settings -export VALKEY_SENTINEL_MASTER_NAME="${VALKEY_SENTINEL_MASTER_NAME:-}" +export VALKEY_SENTINEL_PRIMARY_NAME="${VALKEY_SENTINEL_PRIMARY_NAME:-}" export VALKEY_SENTINEL_HOST="${VALKEY_SENTINEL_HOST:-}" export VALKEY_SENTINEL_PORT_NUMBER="${VALKEY_SENTINEL_PORT_NUMBER:-26379}" diff --git a/bitnami/valkey/README.md b/bitnami/valkey/README.md index 685f458b9a34f..141240f684981 100644 --- a/bitnami/valkey/README.md +++ b/bitnami/valkey/README.md @@ -172,41 +172,41 @@ docker-compose up -d #### Customizable environment variables -| Name | Description | Default Value | -|-----------------------------------|---------------------------------------------------|---------------------------------------------| -| `VALKEY_DATA_DIR` | Valkey data directory | `${VALKEY_VOLUME_DIR}/data` | -| `VALKEY_OVERRIDES_FILE` | Valkey config overrides file | `${VALKEY_MOUNTED_CONF_DIR}/overrides.conf` | -| `VALKEY_DISABLE_COMMANDS` | Commands to disable in Valkey | `nil` | -| `VALKEY_DATABASE` | Default Valkey database | `valkey` | -| `VALKEY_AOF_ENABLED` | Enable AOF | `yes` | -| `VALKEY_RDB_POLICY` | Enable RDB policy persitence | `nil` | -| `VALKEY_RDB_POLICY_DISABLED` | Allows to enable RDB policy persistence | `no` | -| `VALKEY_MASTER_HOST` | Valkey master host (used by slaves) | `nil` | -| `VALKEY_MASTER_PORT_NUMBER` | Valkey master host port (used by slaves) | `6379` | -| `VALKEY_PORT_NUMBER` | Valkey port number | `$VALKEY_DEFAULT_PORT_NUMBER` | -| `VALKEY_ALLOW_REMOTE_CONNECTIONS` | Allow remote connection to the service | `yes` | -| `VALKEY_REPLICATION_MODE` | Valkey replication mode (values: master, slave) | `nil` | -| `VALKEY_REPLICA_IP` | The replication announce ip | `nil` | -| `VALKEY_REPLICA_PORT` | The replication announce port | `nil` | -| `VALKEY_EXTRA_FLAGS` | Additional flags pass to 'valkey-server' commands | `nil` | -| `ALLOW_EMPTY_PASSWORD` | Allow password-less access | `no` | -| `VALKEY_PASSWORD` | Password for Valkey | `nil` | -| `VALKEY_MASTER_PASSWORD` | Valkey master node password | `nil` | -| `VALKEY_ACLFILE` | Valkey ACL file | `nil` | -| `VALKEY_IO_THREADS_DO_READS` | Enable multithreading when reading socket | `nil` | -| `VALKEY_IO_THREADS` | Number of threads | `nil` | -| `VALKEY_TLS_ENABLED` | Enable TLS | `no` | -| `VALKEY_TLS_PORT_NUMBER` | Valkey TLS port (requires VALKEY_ENABLE_TLS=yes) | `6379` | -| `VALKEY_TLS_CERT_FILE` | Valkey TLS certificate file | `nil` | -| `VALKEY_TLS_CA_DIR` | Directory containing TLS CA certificates | `nil` | -| `VALKEY_TLS_KEY_FILE` | Valkey TLS key file | `nil` | -| `VALKEY_TLS_KEY_FILE_PASS` | Valkey TLS key file passphrase | `nil` | -| `VALKEY_TLS_CA_FILE` | Valkey TLS CA file | `nil` | -| `VALKEY_TLS_DH_PARAMS_FILE` | Valkey TLS DH parameter file | `nil` | -| `VALKEY_TLS_AUTH_CLIENTS` | Enable Valkey TLS client authentication | `yes` | -| `VALKEY_SENTINEL_MASTER_NAME` | Valkey Sentinel master name | `nil` | -| `VALKEY_SENTINEL_HOST` | Valkey Sentinel host | `nil` | -| `VALKEY_SENTINEL_PORT_NUMBER` | Valkey Sentinel host port (used by slaves) | `26379` | +| Name | Description | Default Value | +|-----------------------------------|----------------------------------------------------|---------------------------------------------| +| `VALKEY_DATA_DIR` | Valkey data directory | `${VALKEY_VOLUME_DIR}/data` | +| `VALKEY_OVERRIDES_FILE` | Valkey config overrides file | `${VALKEY_MOUNTED_CONF_DIR}/overrides.conf` | +| `VALKEY_DISABLE_COMMANDS` | Commands to disable in Valkey | `nil` | +| `VALKEY_DATABASE` | Default Valkey database | `valkey` | +| `VALKEY_AOF_ENABLED` | Enable AOF | `yes` | +| `VALKEY_RDB_POLICY` | Enable RDB policy persitence | `nil` | +| `VALKEY_RDB_POLICY_DISABLED` | Allows to enable RDB policy persistence | `no` | +| `VALKEY_PRIMARY_HOST` | Valkey primary host (used by replicas) | `nil` | +| `VALKEY_PRIMARY_PORT_NUMBER` | Valkey primary host port (used by replicas) | `6379` | +| `VALKEY_PORT_NUMBER` | Valkey port number | `$VALKEY_DEFAULT_PORT_NUMBER` | +| `VALKEY_ALLOW_REMOTE_CONNECTIONS` | Allow remote connection to the service | `yes` | +| `VALKEY_REPLICATION_MODE` | Valkey replication mode (values: primary, replica) | `nil` | +| `VALKEY_REPLICA_IP` | The replication announce ip | `nil` | +| `VALKEY_REPLICA_PORT` | The replication announce port | `nil` | +| `VALKEY_EXTRA_FLAGS` | Additional flags pass to 'valkey-server' commands | `nil` | +| `ALLOW_EMPTY_PASSWORD` | Allow password-less access | `no` | +| `VALKEY_PASSWORD` | Password for Valkey | `nil` | +| `VALKEY_PRIMARY_PASSWORD` | Valkey primary node password | `nil` | +| `VALKEY_ACLFILE` | Valkey ACL file | `nil` | +| `VALKEY_IO_THREADS_DO_READS` | Enable multithreading when reading socket | `nil` | +| `VALKEY_IO_THREADS` | Number of threads | `nil` | +| `VALKEY_TLS_ENABLED` | Enable TLS | `no` | +| `VALKEY_TLS_PORT_NUMBER` | Valkey TLS port (requires VALKEY_ENABLE_TLS=yes) | `6379` | +| `VALKEY_TLS_CERT_FILE` | Valkey TLS certificate file | `nil` | +| `VALKEY_TLS_CA_DIR` | Directory containing TLS CA certificates | `nil` | +| `VALKEY_TLS_KEY_FILE` | Valkey TLS key file | `nil` | +| `VALKEY_TLS_KEY_FILE_PASS` | Valkey TLS key file passphrase | `nil` | +| `VALKEY_TLS_CA_FILE` | Valkey TLS CA file | `nil` | +| `VALKEY_TLS_DH_PARAMS_FILE` | Valkey TLS DH parameter file | `nil` | +| `VALKEY_TLS_AUTH_CLIENTS` | Enable Valkey TLS client authentication | `yes` | +| `VALKEY_SENTINEL_PRIMARY_NAME` | Valkey Sentinel primary name | `nil` | +| `VALKEY_SENTINEL_HOST` | Valkey Sentinel host | `nil` | +| `VALKEY_SENTINEL_PORT_NUMBER` | Valkey Sentinel host port (used by replicas) | `26379` | #### Read-only environment variables @@ -364,7 +364,7 @@ services: ### Setting up a standalone instance -By default, this image is set up to launch Valkey in standalone mode on port 6379. Should you need to change this behavior, setting the `VALKEY_PORT_NUMBER` environment variable will modify the port number. This is not to be confused with `VALKEY_MASTER_PORT_NUMBER` or `VALKEY_REPLICA_PORT` environment variables that are applicable in replication mode. +By default, this image is set up to launch Valkey in standalone mode on port 6379. Should you need to change this behavior, setting the `VALKEY_PORT_NUMBER` environment variable will modify the port number. This is not to be confused with `VALKEY_PRIMARY_PORT_NUMBER` or `VALKEY_REPLICA_PORT` environment variables that are applicable in replication mode. ```console docker run --name valkey -e VALKEY_PORT_NUMBER=7000 -p 7000:7000 bitnami/valkey:latest @@ -388,27 +388,27 @@ services: A replication cluster can easily be setup with the Bitnami Valkey Docker Image using the following environment variables: -* `VALKEY_REPLICATION_MODE`: The replication mode. Possible values `master`/`slave`. No defaults. +* `VALKEY_REPLICATION_MODE`: The replication mode. Possible values `primary`/`replica`. No defaults. * `VALKEY_REPLICA_IP`: The replication announce ip. Defaults to `$(get_machine_ip)` which return the ip of the container. -* `VALKEY_REPLICA_PORT`: The replication announce port. Defaults to `VALKEY_MASTER_PORT_NUMBER`. -* `VALKEY_MASTER_HOST`: Hostname/IP of replication master (replica node parameter). No defaults. -* `VALKEY_MASTER_PORT_NUMBER`: Server port of the replication master (replica node parameter). Defaults to `6379`. -* `VALKEY_MASTER_PASSWORD`: Password to authenticate with the master (replica node parameter). No defaults. As an alternative, you can mount a file with the password and set the `VALKEY_MASTER_PASSWORD_FILE` variable. +* `VALKEY_REPLICA_PORT`: The replication announce port. Defaults to `VALKEY_PRIMARY_PORT_NUMBER`. +* `VALKEY_PRIMARY_HOST`: Hostname/IP of replication primary (replica node parameter). No defaults. +* `VALKEY_PRIMARY_PORT_NUMBER`: Server port of the replication primaty (replica node parameter). Defaults to `6379`. +* `VALKEY_PRIMARY_PASSWORD`: Password to authenticate with the primary (replica node parameter). No defaults. As an alternative, you can mount a file with the password and set the `VALKEY_PRIMARY_PASSWORD_FILE` variable. -In a replication cluster you can have one master and zero or more replicas. When replication is enabled the master node is in read-write mode, while the replicas are in read-only mode. For best performance its advisable to limit the reads to the replicas. +In a replication cluster you can have one primary and zero or more replicas. When replication is enabled the primary node is in read-write mode, while the replicas are in read-only mode. For best performance its advisable to limit the reads to the replicas. -#### Step 1: Create the replication master +#### Step 1: Create the replication primary -The first step is to start the Valkey master. +The first step is to start the Valkey primary. ```console -docker run --name valkey-master \ - -e VALKEY_REPLICATION_MODE=master \ - -e VALKEY_PASSWORD=masterpassword123 \ +docker run --name valkey-primary \ + -e VALKEY_REPLICATION_MODE=primary \ + -e VALKEY_PASSWORD=primarypassword123 \ bitnami/valkey:latest ``` -In the above command the container is configured as the `master` using the `VALKEY_REPLICATION_MODE` parameter. The `VALKEY_PASSWORD` parameter enables authentication on the Valkey master. +In the above command the container is configured as the `primary` using the `VALKEY_REPLICATION_MODE` parameter. The `VALKEY_PASSWORD` parameter enables authentication on the Valkey primary. #### Step 2: Create the replica node @@ -416,40 +416,40 @@ Next we start a Valkey replica container. ```console docker run --name valkey-replica \ - --link valkey-master:master \ - -e VALKEY_REPLICATION_MODE=slave \ - -e VALKEY_MASTER_HOST=master \ - -e VALKEY_MASTER_PORT_NUMBER=6379 \ - -e VALKEY_MASTER_PASSWORD=masterpassword123 \ + --link valkey-primary:primary \ + -e VALKEY_REPLICATION_MODE=replica \ + -e VALKEY_PRIMARY_HOST=primary \ + -e VALKEY_PRIMARY_PORT_NUMBER=6379 \ + -e VALKEY_PRIMARY_PASSWORD=primarypassword123 \ -e VALKEY_PASSWORD=password123 \ bitnami/valkey:latest ``` -In the above command the container is configured as a `slave` using the `VALKEY_REPLICATION_MODE` parameter. The `VALKEY_MASTER_HOST`, `VALKEY_MASTER_PORT_NUMBER` and `VALKEY_MASTER_PASSWORD` parameters are used connect and authenticate with the Valkey master. The `VALKEY_PASSWORD` parameter enables authentication on the Valkey replica. +In the above command the container is configured as a `replica` using the `VALKEY_REPLICATION_MODE` parameter. The `VALKEY_PRIMARY_HOST`, `VALKEY_PRIMARY_PORT_NUMBER` and `VALKEY_PRIMARY_PASSWORD` parameters are used connect and authenticate with the Valkey primary. The `VALKEY_PASSWORD` parameter enables authentication on the Valkey replica. -You now have a two node Valkey master/replica replication cluster up and running which can be scaled by adding/removing replicas. +You now have a two node Valkey primary/replica replication cluster up and running which can be scaled by adding/removing replicas. -If the Valkey master goes down you can reconfigure a replica to become a master using: +If the Valkey primary goes down you can reconfigure a replica to become a primary using: ```console -docker exec valkey-replica valkey-cli -a password123 SLAVEOF NO ONE +docker exec valkey-replica valkey-cli -a password123 REPLICAOF NO ONE ``` -> **Note**: The configuration of the other replicas in the cluster needs to be updated so that they are aware of the new master. In our example, this would involve restarting the other replicas with `--link valkey-replica:master`. +> **Note**: The configuration of the other replicas in the cluster needs to be updated so that they are aware of the new primary. In our example, this would involve restarting the other replicas with `--link valkey-replica:primary`. -With Docker Compose the master/replica mode can be setup using: +With Docker Compose the primary/replica mode can be setup using: ```yaml version: '2' services: - valkey-master: + valkey-primary: image: 'bitnami/valkey:latest' ports: - '6379' environment: - - VALKEY_REPLICATION_MODE=master - - VALKEY_PASSWORD=my_master_password + - VALKEY_REPLICATION_MODE=primary + - VALKEY_PASSWORD=my_primary_password volumes: - '/path/to/valkey-persistence:/bitnami' @@ -458,24 +458,24 @@ services: ports: - '6379' depends_on: - - valkey-master + - valkey-primary environment: - - VALKEY_REPLICATION_MODE=slave - - VALKEY_MASTER_HOST=valkey-master - - VALKEY_MASTER_PORT_NUMBER=6379 - - VALKEY_MASTER_PASSWORD=my_master_password + - VALKEY_REPLICATION_MODE=replica + - VALKEY_PRIMARY_HOST=valkey-primary + - VALKEY_PRIMARY_PORT_NUMBER=6379 + - VALKEY_PRIMARY_PASSWORD=my_primary_password - VALKEY_PASSWORD=my_replica_password ``` Scale the number of replicas using: ```console -docker-compose up --detach --scale valkey-master=1 --scale valkey-secondary=3 +docker-compose up --detach --scale valkey-primary=1 --scale valkey-replica=3 ``` The above command scales up the number of replicas to `3`. You can scale down in the same way. -> **Note**: You should not scale up/down the number of master nodes. Always have only one master node running. +> **Note**: You should not scale up/down the number of primary nodes. Always have only one primary node running. ### Securing Valkey traffic @@ -689,6 +689,12 @@ If you detect any issue in the `docker-compose.yaml` file, feel free to report i We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/containers/issues) or submitting a [pull request](https://github.com/bitnami/containers/pulls) with your contribution. +## Notable Changes + +### Starting October 20, 2024 + +* All the references have been updated from `master/slave` to `primary/replica` to follow the upstream project strategy. Environment variables previously prefixed as `VALKEY_MASTER` or `VALKEY_SENTINEL_MASTER` use `VALKEY_PRIMARY` and `VALKEY_SENTINEL_PRIMARY` now. + ## Issues If you encountered a problem running this container, you can file an [issue](https://github.com/bitnami/containers/issues/new/choose). For us to provide better support, be sure to fill the issue template.