diff --git a/README.md b/README.md index ccbb5949..d73d3df2 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ The storage-engine [`data-in-memory`](https://docs.aerospike.com/reference/confi #### `DEFAULT_TTL` -The namespace [`default-ttl`](https://docs.aerospike.com/reference/configuration#default-ttl). Default: *30d* +The namespace [`default-ttl`](https://docs.aerospike.com/reference/configuration#default-ttl). Default: *0* #### `MEM_GB` @@ -215,7 +215,7 @@ The namespace [`memory-size`](https://docs.aerospike.com/reference/configuration #### `NSUP_PERIOD` -The namespace [`nsup-period`](https://docs.aerospike.com/reference/configuration#nsup-period). Default: *120* , nsup-period in seconds +The namespace [`nsup-period`](https://docs.aerospike.com/reference/configuration#nsup-period). Default: *120* , nsup-period in seconds - also disabled when `default-ttl` is `0`. #### `STORAGE_GB` diff --git a/community/ubuntu24.04/aerospike.template.conf b/community/ubuntu24.04/aerospike.template.conf index 7942a049..ac922226 100644 --- a/community/ubuntu24.04/aerospike.template.conf +++ b/community/ubuntu24.04/aerospike.template.conf @@ -54,9 +54,10 @@ network { } namespace ${NAMESPACE} { - default-ttl ${DEFAULT_TTL} # use 0 to never expire/evict. - nsup-period ${NSUP_PERIOD} replication-factor 1 + $( (("${DEFAULT_TTL}" != 0 )) && echo "default-ttl ${DEFAULT_TTL}") + $( (("${DEFAULT_TTL}" != 0 )) && echo "nsup-period ${NSUP_PERIOD}") + storage-engine $([ "${DATA_IN_MEMORY}" = "true" ] && echo "memory" || echo "device") { # For 'storage-engine memory' with 'device' or 'file' backing, we # recommend having multiple devices (eight is recommended). One is used diff --git a/community/ubuntu24.04/entrypoint.sh b/community/ubuntu24.04/entrypoint.sh index 1aa9d0ea..60e1bf3d 100755 --- a/community/ubuntu24.04/entrypoint.sh +++ b/community/ubuntu24.04/entrypoint.sh @@ -8,76 +8,76 @@ export SERVICE_ADDRESS=${SERVICE_ADDRESS:-any} export SERVICE_PORT=${SERVICE_PORT:-3000} export NAMESPACE=${NAMESPACE:-test} export DATA_IN_MEMORY=${DATA_IN_MEMORY:-false} -export DEFAULT_TTL=${DEFAULT_TTL:-30d} +export DEFAULT_TTL=${DEFAULT_TTL:-0} export MEM_GB=${MEM_GB:-1} export NSUP_PERIOD=${NSUP_PERIOD:-120} export STORAGE_GB=${STORAGE_GB:-4} if [ "${DATA_IN_MEMORY}" = "true" ]; then - export READ_PAGE_CACHE="false" + export READ_PAGE_CACHE="false" else - export READ_PAGE_CACHE="true" + export READ_PAGE_CACHE="true" fi if asd --version | grep -q "Community"; then - FEATURE_KEY_FILE="" # invalid for community edition + FEATURE_KEY_FILE="" # invalid for community edition fi function bash_eval_template() { - local template_file=$1 - local target_file=$2 - - echo "" >"${target_file}" - - while IFS= read -r line; do - if grep -qE "[$][(]|[{]" <<<"${line}"; then - local update - update=$(eval echo "\"${line}\"") || exit 1 - grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" - else - echo "${line}" >>"${target_file}" - fi - done <"${template_file}" - - # Ignore failure when template is mounted in a read-only filesystem. - rm "${template_file}" || true + local template_file=$1 + local target_file=$2 + + echo "" >"${target_file}" + + while IFS= read -r line; do + if grep -qE "[$][(]|[{]" <<<"${line}"; then + local update + update=$(eval echo "\"${line}\"") || exit 1 + grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" + else + echo "${line}" >>"${target_file}" + fi + done <"${template_file}" + + # Ignore failure when template is mounted in a read-only filesystem. + rm "${template_file}" || true } # Fill out conffile with above values if [ -f /etc/aerospike/aerospike.template.conf ]; then - conf=/etc/aerospike/aerospike.conf - template=/etc/aerospike/aerospike.template.conf + conf=/etc/aerospike/aerospike.conf + template=/etc/aerospike/aerospike.template.conf - bash_eval_template "${template}" "${conf}" + bash_eval_template "${template}" "${conf}" fi # if command starts with an option, prepend asd if [ "${1:0:1}" = '-' ]; then - set -- asd "$@" + set -- asd "$@" fi # if asd is specified for the command, start it with any given options if [ "$1" = 'asd' ]; then - NETLINK=${NETLINK:-eth0} - - # We will wait a bit for the network link to be up. - NETLINK_UP=0 - NETLINK_COUNT=0 - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" - - while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do - if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then - NETLINK_UP=1 - else - sleep 0.1 - ((++NETLINK_COUNT)) - fi - done - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" - # asd should always run in the foreground. - set -- "$@" --foreground + NETLINK=${NETLINK:-eth0} + + # We will wait a bit for the network link to be up. + NETLINK_UP=0 + NETLINK_COUNT=0 + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" + + while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do + if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then + NETLINK_UP=1 + else + sleep 0.1 + ((++NETLINK_COUNT)) + fi + done + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" + # asd should always run in the foreground. + set -- "$@" --foreground fi exec "$@" diff --git a/enterprise/ubuntu24.04/aerospike.template.conf b/enterprise/ubuntu24.04/aerospike.template.conf index 7942a049..ac922226 100644 --- a/enterprise/ubuntu24.04/aerospike.template.conf +++ b/enterprise/ubuntu24.04/aerospike.template.conf @@ -54,9 +54,10 @@ network { } namespace ${NAMESPACE} { - default-ttl ${DEFAULT_TTL} # use 0 to never expire/evict. - nsup-period ${NSUP_PERIOD} replication-factor 1 + $( (("${DEFAULT_TTL}" != 0 )) && echo "default-ttl ${DEFAULT_TTL}") + $( (("${DEFAULT_TTL}" != 0 )) && echo "nsup-period ${NSUP_PERIOD}") + storage-engine $([ "${DATA_IN_MEMORY}" = "true" ] && echo "memory" || echo "device") { # For 'storage-engine memory' with 'device' or 'file' backing, we # recommend having multiple devices (eight is recommended). One is used diff --git a/enterprise/ubuntu24.04/entrypoint.sh b/enterprise/ubuntu24.04/entrypoint.sh index 1aa9d0ea..60e1bf3d 100755 --- a/enterprise/ubuntu24.04/entrypoint.sh +++ b/enterprise/ubuntu24.04/entrypoint.sh @@ -8,76 +8,76 @@ export SERVICE_ADDRESS=${SERVICE_ADDRESS:-any} export SERVICE_PORT=${SERVICE_PORT:-3000} export NAMESPACE=${NAMESPACE:-test} export DATA_IN_MEMORY=${DATA_IN_MEMORY:-false} -export DEFAULT_TTL=${DEFAULT_TTL:-30d} +export DEFAULT_TTL=${DEFAULT_TTL:-0} export MEM_GB=${MEM_GB:-1} export NSUP_PERIOD=${NSUP_PERIOD:-120} export STORAGE_GB=${STORAGE_GB:-4} if [ "${DATA_IN_MEMORY}" = "true" ]; then - export READ_PAGE_CACHE="false" + export READ_PAGE_CACHE="false" else - export READ_PAGE_CACHE="true" + export READ_PAGE_CACHE="true" fi if asd --version | grep -q "Community"; then - FEATURE_KEY_FILE="" # invalid for community edition + FEATURE_KEY_FILE="" # invalid for community edition fi function bash_eval_template() { - local template_file=$1 - local target_file=$2 - - echo "" >"${target_file}" - - while IFS= read -r line; do - if grep -qE "[$][(]|[{]" <<<"${line}"; then - local update - update=$(eval echo "\"${line}\"") || exit 1 - grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" - else - echo "${line}" >>"${target_file}" - fi - done <"${template_file}" - - # Ignore failure when template is mounted in a read-only filesystem. - rm "${template_file}" || true + local template_file=$1 + local target_file=$2 + + echo "" >"${target_file}" + + while IFS= read -r line; do + if grep -qE "[$][(]|[{]" <<<"${line}"; then + local update + update=$(eval echo "\"${line}\"") || exit 1 + grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" + else + echo "${line}" >>"${target_file}" + fi + done <"${template_file}" + + # Ignore failure when template is mounted in a read-only filesystem. + rm "${template_file}" || true } # Fill out conffile with above values if [ -f /etc/aerospike/aerospike.template.conf ]; then - conf=/etc/aerospike/aerospike.conf - template=/etc/aerospike/aerospike.template.conf + conf=/etc/aerospike/aerospike.conf + template=/etc/aerospike/aerospike.template.conf - bash_eval_template "${template}" "${conf}" + bash_eval_template "${template}" "${conf}" fi # if command starts with an option, prepend asd if [ "${1:0:1}" = '-' ]; then - set -- asd "$@" + set -- asd "$@" fi # if asd is specified for the command, start it with any given options if [ "$1" = 'asd' ]; then - NETLINK=${NETLINK:-eth0} - - # We will wait a bit for the network link to be up. - NETLINK_UP=0 - NETLINK_COUNT=0 - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" - - while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do - if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then - NETLINK_UP=1 - else - sleep 0.1 - ((++NETLINK_COUNT)) - fi - done - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" - # asd should always run in the foreground. - set -- "$@" --foreground + NETLINK=${NETLINK:-eth0} + + # We will wait a bit for the network link to be up. + NETLINK_UP=0 + NETLINK_COUNT=0 + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" + + while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do + if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then + NETLINK_UP=1 + else + sleep 0.1 + ((++NETLINK_COUNT)) + fi + done + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" + # asd should always run in the foreground. + set -- "$@" --foreground fi exec "$@" diff --git a/federal/ubuntu24.04/aerospike.template.conf b/federal/ubuntu24.04/aerospike.template.conf index 7942a049..ac922226 100644 --- a/federal/ubuntu24.04/aerospike.template.conf +++ b/federal/ubuntu24.04/aerospike.template.conf @@ -54,9 +54,10 @@ network { } namespace ${NAMESPACE} { - default-ttl ${DEFAULT_TTL} # use 0 to never expire/evict. - nsup-period ${NSUP_PERIOD} replication-factor 1 + $( (("${DEFAULT_TTL}" != 0 )) && echo "default-ttl ${DEFAULT_TTL}") + $( (("${DEFAULT_TTL}" != 0 )) && echo "nsup-period ${NSUP_PERIOD}") + storage-engine $([ "${DATA_IN_MEMORY}" = "true" ] && echo "memory" || echo "device") { # For 'storage-engine memory' with 'device' or 'file' backing, we # recommend having multiple devices (eight is recommended). One is used diff --git a/federal/ubuntu24.04/entrypoint.sh b/federal/ubuntu24.04/entrypoint.sh index 1aa9d0ea..60e1bf3d 100755 --- a/federal/ubuntu24.04/entrypoint.sh +++ b/federal/ubuntu24.04/entrypoint.sh @@ -8,76 +8,76 @@ export SERVICE_ADDRESS=${SERVICE_ADDRESS:-any} export SERVICE_PORT=${SERVICE_PORT:-3000} export NAMESPACE=${NAMESPACE:-test} export DATA_IN_MEMORY=${DATA_IN_MEMORY:-false} -export DEFAULT_TTL=${DEFAULT_TTL:-30d} +export DEFAULT_TTL=${DEFAULT_TTL:-0} export MEM_GB=${MEM_GB:-1} export NSUP_PERIOD=${NSUP_PERIOD:-120} export STORAGE_GB=${STORAGE_GB:-4} if [ "${DATA_IN_MEMORY}" = "true" ]; then - export READ_PAGE_CACHE="false" + export READ_PAGE_CACHE="false" else - export READ_PAGE_CACHE="true" + export READ_PAGE_CACHE="true" fi if asd --version | grep -q "Community"; then - FEATURE_KEY_FILE="" # invalid for community edition + FEATURE_KEY_FILE="" # invalid for community edition fi function bash_eval_template() { - local template_file=$1 - local target_file=$2 - - echo "" >"${target_file}" - - while IFS= read -r line; do - if grep -qE "[$][(]|[{]" <<<"${line}"; then - local update - update=$(eval echo "\"${line}\"") || exit 1 - grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" - else - echo "${line}" >>"${target_file}" - fi - done <"${template_file}" - - # Ignore failure when template is mounted in a read-only filesystem. - rm "${template_file}" || true + local template_file=$1 + local target_file=$2 + + echo "" >"${target_file}" + + while IFS= read -r line; do + if grep -qE "[$][(]|[{]" <<<"${line}"; then + local update + update=$(eval echo "\"${line}\"") || exit 1 + grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" + else + echo "${line}" >>"${target_file}" + fi + done <"${template_file}" + + # Ignore failure when template is mounted in a read-only filesystem. + rm "${template_file}" || true } # Fill out conffile with above values if [ -f /etc/aerospike/aerospike.template.conf ]; then - conf=/etc/aerospike/aerospike.conf - template=/etc/aerospike/aerospike.template.conf + conf=/etc/aerospike/aerospike.conf + template=/etc/aerospike/aerospike.template.conf - bash_eval_template "${template}" "${conf}" + bash_eval_template "${template}" "${conf}" fi # if command starts with an option, prepend asd if [ "${1:0:1}" = '-' ]; then - set -- asd "$@" + set -- asd "$@" fi # if asd is specified for the command, start it with any given options if [ "$1" = 'asd' ]; then - NETLINK=${NETLINK:-eth0} - - # We will wait a bit for the network link to be up. - NETLINK_UP=0 - NETLINK_COUNT=0 - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" - - while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do - if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then - NETLINK_UP=1 - else - sleep 0.1 - ((++NETLINK_COUNT)) - fi - done - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" - # asd should always run in the foreground. - set -- "$@" --foreground + NETLINK=${NETLINK:-eth0} + + # We will wait a bit for the network link to be up. + NETLINK_UP=0 + NETLINK_COUNT=0 + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" + + while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do + if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then + NETLINK_UP=1 + else + sleep 0.1 + ((++NETLINK_COUNT)) + fi + done + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" + # asd should always run in the foreground. + set -- "$@" --foreground fi exec "$@" diff --git a/template/0/entrypoint.sh b/template/0/entrypoint.sh index 1aa9d0ea..60e1bf3d 100755 --- a/template/0/entrypoint.sh +++ b/template/0/entrypoint.sh @@ -8,76 +8,76 @@ export SERVICE_ADDRESS=${SERVICE_ADDRESS:-any} export SERVICE_PORT=${SERVICE_PORT:-3000} export NAMESPACE=${NAMESPACE:-test} export DATA_IN_MEMORY=${DATA_IN_MEMORY:-false} -export DEFAULT_TTL=${DEFAULT_TTL:-30d} +export DEFAULT_TTL=${DEFAULT_TTL:-0} export MEM_GB=${MEM_GB:-1} export NSUP_PERIOD=${NSUP_PERIOD:-120} export STORAGE_GB=${STORAGE_GB:-4} if [ "${DATA_IN_MEMORY}" = "true" ]; then - export READ_PAGE_CACHE="false" + export READ_PAGE_CACHE="false" else - export READ_PAGE_CACHE="true" + export READ_PAGE_CACHE="true" fi if asd --version | grep -q "Community"; then - FEATURE_KEY_FILE="" # invalid for community edition + FEATURE_KEY_FILE="" # invalid for community edition fi function bash_eval_template() { - local template_file=$1 - local target_file=$2 - - echo "" >"${target_file}" - - while IFS= read -r line; do - if grep -qE "[$][(]|[{]" <<<"${line}"; then - local update - update=$(eval echo "\"${line}\"") || exit 1 - grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" - else - echo "${line}" >>"${target_file}" - fi - done <"${template_file}" - - # Ignore failure when template is mounted in a read-only filesystem. - rm "${template_file}" || true + local template_file=$1 + local target_file=$2 + + echo "" >"${target_file}" + + while IFS= read -r line; do + if grep -qE "[$][(]|[{]" <<<"${line}"; then + local update + update=$(eval echo "\"${line}\"") || exit 1 + grep -qE "[^[:space:]]*" <<<"${update}" && echo "${update}" >>"${target_file}" + else + echo "${line}" >>"${target_file}" + fi + done <"${template_file}" + + # Ignore failure when template is mounted in a read-only filesystem. + rm "${template_file}" || true } # Fill out conffile with above values if [ -f /etc/aerospike/aerospike.template.conf ]; then - conf=/etc/aerospike/aerospike.conf - template=/etc/aerospike/aerospike.template.conf + conf=/etc/aerospike/aerospike.conf + template=/etc/aerospike/aerospike.template.conf - bash_eval_template "${template}" "${conf}" + bash_eval_template "${template}" "${conf}" fi # if command starts with an option, prepend asd if [ "${1:0:1}" = '-' ]; then - set -- asd "$@" + set -- asd "$@" fi # if asd is specified for the command, start it with any given options if [ "$1" = 'asd' ]; then - NETLINK=${NETLINK:-eth0} - - # We will wait a bit for the network link to be up. - NETLINK_UP=0 - NETLINK_COUNT=0 - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" - - while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do - if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then - NETLINK_UP=1 - else - sleep 0.1 - ((++NETLINK_COUNT)) - fi - done - - echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" - # asd should always run in the foreground. - set -- "$@" --foreground + NETLINK=${NETLINK:-eth0} + + # We will wait a bit for the network link to be up. + NETLINK_UP=0 + NETLINK_COUNT=0 + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate)" + + while [ ${NETLINK_UP} -eq 0 ] && [ ${NETLINK_COUNT} -lt 20 ]; do + if grep -q "up" /sys/class/net/"${NETLINK}"/operstate; then + NETLINK_UP=1 + else + sleep 0.1 + ((++NETLINK_COUNT)) + fi + done + + echo "link ${NETLINK} state $(cat /sys/class/net/"${NETLINK}"/operstate) in ${NETLINK_COUNT}" + # asd should always run in the foreground. + set -- "$@" --foreground fi exec "$@" diff --git a/template/7/aerospike.template.conf b/template/7/aerospike.template.conf index 7942a049..ac922226 100644 --- a/template/7/aerospike.template.conf +++ b/template/7/aerospike.template.conf @@ -54,9 +54,10 @@ network { } namespace ${NAMESPACE} { - default-ttl ${DEFAULT_TTL} # use 0 to never expire/evict. - nsup-period ${NSUP_PERIOD} replication-factor 1 + $( (("${DEFAULT_TTL}" != 0 )) && echo "default-ttl ${DEFAULT_TTL}") + $( (("${DEFAULT_TTL}" != 0 )) && echo "nsup-period ${NSUP_PERIOD}") + storage-engine $([ "${DATA_IN_MEMORY}" = "true" ] && echo "memory" || echo "device") { # For 'storage-engine memory' with 'device' or 'file' backing, we # recommend having multiple devices (eight is recommended). One is used