From 872e7a8fa02a0413175fd976b628e97d560e505f Mon Sep 17 00:00:00 2001 From: petera5 Date: Fri, 3 Jun 2016 10:25:07 -0500 Subject: [PATCH 01/13] Fixed single rogue character in dockerservice enable. --- ecs-single-node/step1_ecs_singlenode_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecs-single-node/step1_ecs_singlenode_install.py b/ecs-single-node/step1_ecs_singlenode_install.py index 767d4b00..691ef14d 100755 --- a/ecs-single-node/step1_ecs_singlenode_install.py +++ b/ecs-single-node/step1_ecs_singlenode_install.py @@ -394,7 +394,7 @@ def set_docker_configuration_func(): # set container to start on boot logger.info("Set container to start on boot.") - subprocess.call(["systelctl", "enable", "docker.service"]) + subprocess.call(["systemctl", "enable", "docker.service"]) os.system("echo \"docker start ecsstandalone\" >>/etc/rc.local") except Exception as ex: From 568e3100cabf901f70fbdf99ff521ea6d82113f4 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Jun 2016 10:21:09 -0400 Subject: [PATCH 02/13] Patch files for 2.2.1.0 --- patches/2.2.1.0/Dockerfile | 17 + patches/2.2.1.0/coordinator.properties | 13 + .../2.2.1.0/storageserver-partition-config.sh | 119 +++ patches/2.2.1.0/systool | 730 ++++++++++++++++++ patches/2.2.1.0/transformsvc | 15 + patches/2.2.1.0/vnest.object.properties | 121 +++ 6 files changed, 1015 insertions(+) create mode 100644 patches/2.2.1.0/Dockerfile create mode 100644 patches/2.2.1.0/coordinator.properties create mode 100755 patches/2.2.1.0/storageserver-partition-config.sh create mode 100755 patches/2.2.1.0/systool create mode 100755 patches/2.2.1.0/transformsvc create mode 100644 patches/2.2.1.0/vnest.object.properties diff --git a/patches/2.2.1.0/Dockerfile b/patches/2.2.1.0/Dockerfile new file mode 100644 index 00000000..77c4b63c --- /dev/null +++ b/patches/2.2.1.0/Dockerfile @@ -0,0 +1,17 @@ +# Four fixes to the default 2.2.1.0 image. +FROM emcvipr/object:2.2.1.0-77331.4f57cc6-reduced + +# Reduce timeout for systems that are shutdown for a while +ADD coordinator.properties /opt/storageos/conf/ +# Increase memory for transformsvc +ADD transformsvc /opt/storageos/bin/ + +# Fix disk partitioning script +ADD storageserver-partition-config.sh /opt/storageos/bin/ + +# Make vnest use separate thread pools to prevent deadlock +#ADD vnest.object.properties /opt/storageos/conf/ +RUN f=/opt/storageos/conf/vnest-common-conf-template.xml; grep -q "object.UseSeparateThreadPools" $f || sed -i '/properties id="serviceProperties"/a \ \ \ \ \ \ \ \ true' $f + +# Remove forced exit from systool +ADD systool /etc/ diff --git a/patches/2.2.1.0/coordinator.properties b/patches/2.2.1.0/coordinator.properties new file mode 100644 index 00000000..78346311 --- /dev/null +++ b/patches/2.2.1.0/coordinator.properties @@ -0,0 +1,13 @@ +# genconfig will set flag based on control node vs. data node +coordinator.useExternalConfig=true +coordinator.serverClientPort=2181 +coordinator.dataDir=/data/zk +coordinator.serverConfigFile=/data/vnest/vnest-main/configuration/coord-server +coordinator.clientConfigFile=/data/vnest/vnest-main/configuration/coord-client +coordinator.lastServedFile=/data/vnest/vnest-main/configuration/coord-last-served +# if node down for this long, wait to see if still member before proceeding +coordinator.lastServedThreshSecs=3600 +# if lastServedThreshSecs exceeded, wait this long for config to be updated +coordinator.lastServedTimeoutSecs=5 +# how often to touch last served file +coordinator.lastServedUpdateSecs=120 diff --git a/patches/2.2.1.0/storageserver-partition-config.sh b/patches/2.2.1.0/storageserver-partition-config.sh new file mode 100755 index 00000000..dbb9a0b4 --- /dev/null +++ b/patches/2.2.1.0/storageserver-partition-config.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# Copyright (c) 2013 EMC Corporation +# All Rights Reserved +# +# This software contains the intellectual property of EMC Corporation +# or is licensed to EMC Corporation from third parties. Use of this +# software and the intellectual property contained therein is expressly +# limited to the terms and conditions of the License Agreement under which +# it is provided by or on behalf of EMC. +# + +date + +# This script will generate the partition file (ss-partition-conf.json) to be used on this server if one is not found. +# Also a general configuration file will be generated with main parameters and a ss uuid. +# Assumes this is running on gen 3 hardware or a vipr data test node using disks mounted with a +# /dae/uuid-58f917ab-23ba-457f-a9df-d0f4b0597e2d type pattern or will look for /data (vipr) + +export configdir="/opt/storageos/conf" + +export p_configfile="$configdir/storageserver-partition-conf.json" +export configfile="$configdir/storageserver.conf" + +blockbinsizegb=10 +vm_bb_cout=5 +vm_part_count=5 + +function setopt() { + opt=$1 + val=$2 + if grep -q "$opt" "$configfile" ; then + sed -i "s#$opt=.*#$opt=$val#g" "$configfile" + else + echo "$opt=$val" >> $configfile + fi + +} + +echo "creating main config file: $configfile" +if [ ! -e "$configfile" ]; then + echo "creating $configfile" + mkdir -p "$configdir" + cat << EOF > "$configfile" +listenaddress=0.0.0.0 +port=9099 +iothreads=100 +blockbinsizegb=$blockbinsizegb +debugenabled=false +logtoconsole=false +logtosyslog=true +maxoutstandingrequests=0 +initblockbins=0 +netserverListenPort=9069 +netserverLogLevel=INFO +ioThreadNumber=200 +perfCountEnabled=true +maxMemThresholdKb=3145728 +sendQHighWaterMark=1000 +recvThreadNicePriority=-15 +sendThreadNicePriority=-15 +enableAffinity=true +partitionroot=/dae +agentUrlEndPoint=/host/data/agent.json +agentDisksRestFragment=/v1/agent/node/storage/disk/disks +trustStore=/host/data/security/truststore.pem +verifyCerts=true +dbusEnabled=false +EOF +else + echo "$configfile already exists, no action taken" +fi + +if grep -q -E 'VMware.*Virtual.*disk' /proc/scsi/sg/device_strs && [ ! -e /data/is_community_edition ] +then + # this a virtual datanode, creating a json file with predefined values + echo "virtual node detected - using json config file" + setopt partitionconfig $p_configfile + setopt partitionroot=/dae + root="/data/storageserver" + + for part in $(seq 1 $vm_part_count); do + for bb in $(seq 1 $vm_bb_cout); do + bb=$(printf "%0*d\n" 4 $bb) + mkdir -m 777 -p $root/uuid-$part + fallocate -l${blockbinsizegb}G $root/uuid-$part/$bb + chmod 777 $root/uuid-$part/$bb + done + done + + if [ ! -e "$p_configfile" ]; then + echo "creating $p_configfile" + mkdir -p "$configdir" + + printf '{\n%2s"disks": [\n' > $p_configfile + for part in $(seq 1 "$vm_part_count"); do + printf '%4s{\n%6s"uuid": "'$part'",\n%6s"health": "Good"\n%4s}' >> $p_configfile + [ "$part" -lt "$vm_part_count" ] && echo "," >> $p_configfile || echo "" >> $p_configfile + done + printf '%2s]\n}' >> $p_configfile + + else + echo "$p_configfile already exists, no action taken" + fi +else + # this is a commodity hardware node. do not generate a json file - ss will use dbus to obtain partitions + echo "commodity node detected - using dbus api" +fi + +if ! grep --quiet "uuid" "$configfile"; then + echo "generating server uuid" + uuidgen="$(which uuidgen)" + if [ ! -z "$uuidgen" ]; then + uuid="$(uuidgen)" + else + echo "warning: uuidgen utility was not found on your system. using timestamp as a uuid" + uuid="$(date +%s)" + fi + setopt uuid "$uuid" +fi diff --git a/patches/2.2.1.0/systool b/patches/2.2.1.0/systool new file mode 100755 index 00000000..c008fe96 --- /dev/null +++ b/patches/2.2.1.0/systool @@ -0,0 +1,730 @@ +#!/bin/bash +# +# Copyright (c) 2014 EMC Corporation +# All Rights Reserved +# +# This software contains the intellectual property of EMC Corporation +# or is licensed to EMC Corporation from third parties. Use of this +# software and the intellectual property contained therein is expressly +# limited to the terms and conditions of the License Agreement under which +# it is provided by or on behalf of EMC. +# +# /etc/systool +# + +export PATH=/bin:/bin:/sbin:/usr/bin:/usr/sbin + +. /etc/rc.status + +_usage() { + set +Ex + echo "Usage: $0 --list" >&2 + echo " or: $0 --get-default" >&2 + echo " or: $0 --set-default name" >&2 + echo " or: $0 --get-image name" >&2 + echo " or: $0 --install file" >&2 + echo " or: $0 --remove name" >&2 + echo " or: $0 --getprops" >&2 + echo " or: $0 --get-controller-ovfprops" >&2 + echo " or: $0 --set-controller-ovfprops file" >&2 + echo " or: $0 --setoverrides file" >&2 + echo " or: $0 --reboot" >&2 + echo " or: $0 --poweroff" >&2 + echo " or: $0 --reconfig" >&2 + echo " or: $0 --restart service" >&2 + echo " or: $0 --test" >&2 + exit 2 +} + +_info() { + echo "$0: Info: $*" >&2 +} + +_warn() { + echo "$0: Warning: $*" >&2 +} + +_fatal() { + set +Ex + echo "$0: Error: $*" >&2 + exit 1 +} + +_fatal2() { + local code=${1:-1} ; shift + set +Ex + echo "$0: Error: $*" >&2 + exit ${code} +} + +_err_handler() { + set +E + _fatal "Line ${LINENO}: $(eval echo \"${BASH_COMMAND}\")" +} + +_exit_handler() { + set +E + for action in "${on_exit_actions[@]}" ; do + eval "${action}" + done +} + +_set_on_exit() { + on_exit_actions=( "${@}" "${on_exit_actions[@]}" ) +} + +_exit_handler() { + set +E + for action in "${on_exit_actions[@]}" ; do + eval "${action}" + done +} + +_set_traps() { + declare -a on_exit_actions + trap '' SIGINT + trap '' SIGTERM + trap _exit_handler EXIT + trap 'set +Ex ; _fatal "Line ${LINENO}: $(eval echo \"${BASH_COMMAND}\")"' ERR + if [ -n "${*}" ] ; then set "${@}" ; fi +} + +_is_appliance() { + [ -d "${bootfs_mntp}/boot/grub/i386-pc" ] +} + +_get_deployment_mode() { + if [ -f "/etc/fabrictool" ]; then + mode=$(/etc/fabrictool --mode) + echo ${mode} + fi +} + +deployment_mode=$(_get_deployment_mode) + +_ismounted() { + ( set +x ; while read dev mnt type flags dummy ; do case ${#} in + 1) [ "${dev}" = "${1}" -o "${mnt}" = "${1}" ] && break ;; + 2) [ "${dev}" = "${1}" -a "${mnt}" = "${2}" ] && break ;; + esac ; done &1) && return 0 + case "${err}" in + *'No medium found') return 1;; + *) echo "${err}" >&2;; + esac + sleep 1 + done + return 1 +} + +_mount() { + local dev=${@: -2: 1} + local mnt=${@: -1: 1} + if ! _ismounted "${dev}" "${mnt}" ; then + mkdir -p "${mnt}" + mount "${@}" && _set_on_exit "_umount ${mnt}" + fi +} + +_umount() { + if _ismounted "${1}" ; then + umount "${1}" || return $? + fi +} + +_bootfs_mount_ro() { + if [ "${deployment_mode}" == "fabric" ]; then + _warn "Fabric deployment. Skipping _bootfs_mount_ro()" + elif ! _is_appliance ; then + _warn "Not a real appliance. Skipping _bootfs_mount_ro()" + elif ! _ismounted "${bootfs_dev}" "${bootfs_mntp}" ; then + mkdir -p "${bootfs_mntp}" + mount -n -t ext3 -o ro "${bootfs_dev}" "${bootfs_mntp}" + elif _ismounted_rw "${bootfs_dev}" "${bootfs_mntp}" ; then + mount -n -o remount,ro "${bootfs_dev}" "${bootfs_mntp}" + fi +} + +_bootfs_mount_rw() { + [ "${bootfs_readonly}" != "true" ] || _fatal "Internal error: read-only bootfs" + if [ "${deployment_mode}" == "fabric" ]; then + _warn "Fabric deployment. Skipping _bootfs_mount_rw()" + elif ! _is_appliance ; then + _warn "Not a real appliance. Skipping _bootfs_mount_rw()" + elif ! _ismounted "${bootfs_dev}" "${bootfs_mntp}" ; then + mkdir -p "${bootfs_mntp}" + mount -n -t ext3 -o rw,noatime,barrier=1 "${bootfs_dev}" "${bootfs_mntp}" + if [ "${1}" != "no" ] ; then _set_on_exit _bootfs_mount_ro ; fi + elif ! _ismounted_rw "${bootfs_dev}" "${bootfs_mntp}" ; then + mount -n -o remount,rw,noatime,barrier=1 "${bootfs_dev}" "${bootfs_mntp}" + if [ "${1}" != "no" ] ; then _set_on_exit _bootfs_mount_ro ; fi + fi +} + +lock_file=/tmp/${0##*/}.lock +lock_timeout=${lock_timeout:-30} + +_s() { + ( _set_traps -E && flock -s -w "${lock_timeout}" 200 && bootfs_readonly=true && _bootfs_mount_ro && "${@}" ) 200>${lock_file} +} + +_x() { + ( _set_traps -E && flock -x -w "${lock_timeout}" 200 && _bootfs_mount_ro && "${@}" ) 200>${lock_file} +} + +_filter_valid() { + local d ; while read d ; do + if [[ "${d}" =~ ^.*-[1-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[^.]+(\.[^.]+)?$ ]] && [ -d "${bootfs_mntp}/${d}" ] && [ -f "${bootfs_mntp}/${d}/${bootfs_rootimg}" ] ; then echo "${d}" ; fi + done +} + +_list_all() { + local d ; ls -t "${bootfs_mntp}" | while read d ; do + [ -L "${bootfs_mntp}/${d}" -o "${d}" = "boot" ] || echo "${d}" + done +} + +_add_dummy_version() { + if ! _is_appliance && [ "${deployment_mode}" != "fabric" ] ; then + echo "vipr-2.0.0.0.0" + fi +} + +_list_valid() { + _list_all | _filter_valid + if [ "${DO_NOT_INCLUDE}" != "yes" ] ; then + _add_dummy_version + fi +} + +_get_default() { + local symlink="${bootfs_mntp}/${bootfs_default}" + local target="" + if [ -L "${symlink}" ] ; then + target=$(readlink "${symlink}") + local d=${target%%/*} + local v=$(echo "${d}" | _filter_valid) + [ -n "${v}" ] || { _warn "Internal inconsistency: ${bootfs_default} -> ${d} (Invalid directory)" ; return 0 ; } + [ -f "${symlink}" ] || { _warn "Internal inconsistency: ${bootfs_default} -> ${d} (No such file)" ; return 0 ; } + echo "${v}" + fi + _add_dummy_version +} + +_set_default() { + local symlink="${bootfs_mntp}/${bootfs_default}" + local image="${1}/${bootfs_rootimg}" + [ -n "${1}" ] || _fatal "Invalid argument" + local d=$(echo "${1}" | _filter_valid) + [ -n "${d}" ] || _fatal "${1}: Invalid version" + [ -d "${bootfs_mntp}/${1}" ] || _fatal "${1}: No such version (Internal error)" + [ -f "${bootfs_mntp}/${image}" ] || _fatal "${1}: No such version (Corrupted?)" + [ "${1}" = "$(_get_default)" ] && return 0 + _bootfs_mount_rw + rm -f "${symlink}" + ln -s "${image}" "${symlink}" +} + +_get_image() { + local image="${1}/${bootfs_rootimg}" + [ -n "${1}" ] || _fatal "Invalid argument" + local d=$(echo "${1}" | _filter_valid) + [ -n "${d}" ] || _fatal "${1}: Invalid version" + [ -d "${bootfs_mntp}/${1}" ] || _fatal "${1}: No such version (Internal error)" + [ -f "${bootfs_mntp}/${image}" ] || _fatal "${1}: No such version (Corrupted?)" + echo "${bootfs_mntp}/${image}" +} + +_remove() { + [ -n "${1}" ] || _fatal "Invalid argument" + [ "${1}" != "$(_get_default)" ] || _fatal "${1}: Can't remove ${bootfs_default}" + _bootfs_mount_rw + local d="${bootfs_mntp}/${1}" + if [ -d "${d}" ] ; then rm -r "${d}" ; fi +} + +_read_file() { + [ -f "${1}" ] || _fatal "${1}: No such file" + echo "$(<${1})" +} + +_read_override_file() { + if [ -f "${1}" ] ; then + cat "${1}" + fi +} + +_install() { + local rootimg_file="${1}" + local rootimg_mntp="/.volumes/${rootimg_file##*/}" + if [ "${deployment_mode}" == "fabric" ]; then + _fatal "Upgrade implementation pending. Skipping deploying the file ${rootimg_file} " + else + # Validate the root image and get its title + _mount -t squashfs -o ro,loop "${rootimg_file}" "${rootimg_mntp}" + local menuentry && menuentry==$(_read_file "${rootimg_mntp}/${bootfs_menuentry}") + local title && title=$(_read_file "${rootimg_mntp}/${bootfs_title}") + umount "${rootimg_mntp}" + + # Mount rw + # Remove this version if exists + # Make sure we have one empty slot + _bootfs_mount_rw + _remove "${title}" + + # Sanity checks + local bootfs_dir="${bootfs_mntp}/${title}" + [ ! -d "${bootfs_dir}" ] || _fatal "${bootfs_dir}: Directory exists" + [ ! -e "${bootfs_dir}" ] || _fatal "${bootfs_dir}: File exists" + + # Install + mkdir -p -m 755 "${bootfs_dir}" + cp -p "${rootimg_file}" "${bootfs_dir}/${bootfs_rootimg}" + echo ${title} + fi +} + +_get_override_props_path() { + [ -e "${bootfs_override_props}" ] || _fatal "${bootfs_override_props}: No such file" + echo "${bootfs_override_props}" +} + +_get_props() { + [ ! -f "${1}" ] || ovf_props_file="${1}" + [ ! -f "${2}" ] || override_link="${2}" + [ ! -f "${3}" ] || dflts_file="${3}" + _props_trymerge +} + +_get_override_props() { + _read_override_file "${bootfs_override_props}" +} + +_get_controller_props() { + if [ -f "${bootfs_controller_props}" ] ; then + _read_file "${bootfs_controller_props}" + fi +} + +_get_vdc_props() { + if [ -f "${bootfs_vdc_props}" ] ; then + _read_file "${bootfs_vdc_props}" + fi +} + +_write_props_file() { + local s && s=$(<"${1}") + if [ -e "${2}" ] ; then + [ "${s}" != "$(<"${2}")" ] || return 0 + _bootfs_mount_rw + mv "${2}" "${2}~" + else + _bootfs_mount_rw + fi + mkdir -p "${2%/*}" + cp /dev/null "${2}" + chmod 600 "${2}" + echo "${s}" >"${2}" + +} + +_set_vdc_props() { + _write_props_file "${1}" "${bootfs_vdc_props}" +} + +_get_ovf_props() { + _read_file "${ovf_props_file}" +} + +_get_props_defaults() { + _read_file "${dflts_file}" +} + +_write_file_and_set_permissions() { + mkdir -p "${1%/*}" + cp /dev/null "${1}" + chmod 600 "${1}" + echo "${2}" >"${1}" +} + +_set_override_props() { + local s && s=$(<"${1}") + if [ -e "${bootfs_override_props}" ] ; then + [ "${s}" != "$(<"${bootfs_override_props}")" ] || return 0 + _bootfs_mount_rw + mv "${bootfs_override_props}" "${bootfs_override_props}~" + else + _bootfs_mount_rw + fi + + _write_file_and_set_permissions "${bootfs_override_props}" "${s}" +} + +_set_controller_props() { + local s && s=$(<"${1}") + if [ -e "${bootfs_controller_props}" ] ; then + [ "${s}" != "$(<"${bootfs_controller_props}")" ] || return 0 + _bootfs_mount_rw + mv "${bootfs_controller_props}" "${bootfs_controller_props}~" + else + _bootfs_mount_rw + fi + + _write_file_and_set_permissions "${bootfs_controller_props}" "${s}" +} + +_reboot() { + if [ "${deployment_mode}" == "fabric" ]; then + echo "container reboot implementation pending" + elif ! _is_appliance ; then + _fatal2 66 "Not a real appliance. Reboot manually." + else + exec /sbin/reboot + _fatal "Failed to exec /sbin/reboot" + fi +} + +_poweroff() { + if [ "${deployment_mode}" == "fabric" ]; then + echo "container poweroff implementation pending" + elif ! _is_appliance ; then + _fatal2 66 "Not a real appliance. Poweroff manually." + else + exec /sbin/poweroff + _fatal "Failed to exec /sbin/poweroff" + fi +} + +_reconfig() { + if ! _is_appliance && [ "${deployment_mode}" != "fabric" ] ; then + _fatal2 66 "Not a real appliance. Reconfig manually." + else + exec /etc/genconfig <&2 + elif ! _is_appliance ; then + _fatal2 66 "Not a real appliance." + else + echo "Ok" >&2 + fi +} + +# This is only used for upgrade from 1.1.x to 2.x +_migrate_props() { + if [ -f "${old_props}" ] ; then + local oprops=$(_get_old_mutated_props) + _props_write "${tmp_mutated_file}" "${oprops}" + _set_override_props "${tmp_mutated_file}" + rm -f ${old_props} ${old_props}~ ${tmp_mutated_file} ${old_dflts_file} + fi +} + +# This is only used for data nodes +_extract_old_controller_ovf_props() { + #Print only relevant keys. Ignoring other properites stored in old files + sed -n 's/^\(network_.*_ipaddr\|network_vip\|network_vip6\|node_count\).*/\0/p' +} + +_initialize_datasvc_overrides() { + local override_props_cdrom_file=${cdrom_mnt}/${override_props} + if [ ! -f ${bootfs_override_props} -a -f ${override_props_cdrom_file} ] ; then + _set_override_props ${override_props_cdrom_file} + fi +} + +_initialize_datasvc_controller_props() { + local controller_ovf_cdrom_file=${cdrom_mnt}/${controller_props} + local old_controller_props_file=${cdrom_mnt}/ovf-env.defaults + if [ ! -f ${bootfs_controller_props} ] ; then + if [ -f ${controller_ovf_cdrom_file} ] ; then + _set_controller_props ${controller_ovf_cdrom_file} + elif [ -f ${old_controller_props_file} ] ; then + local tmp_ovf_props="/tmp/${controller_props}" + local old_ovf_props="$(_extract_old_controller_ovf_props <"${old_controller_props_file}")" + _props_write "${tmp_ovf_props}" "${old_ovf_props}" + _set_controller_props ${tmp_ovf_props} + fi + fi +} + +_initialize_datasvc() { + local cdrom_mnt='/.volumes/cdrom1' + if [ "${deployment_mode}" == "fabric" ]; then + local cdrom_dev=$(/etc/fabrictool --fabric-mount-loc)'/config.iso' + _mount -o loop -t iso9660 "${cdrom_dev}" "${cdrom_mnt}" + else + local cdrom_dev='/dev/sr1' + _probe "${cdrom_dev}" 2>/dev/null || return 0 + _mount -t iso9660 -o ro "${cdrom_dev}" "${cdrom_mnt}" + fi + _initialize_datasvc_controller_props + _initialize_datasvc_overrides +} + +_initialize_ovfenv_props() { + /etc/getovfproperties --readCDROM &>/dev/null +} + +_initialize_props() { + _migrate_props && + _initialize_datasvc && + _props_symlink && + _initialize_ovfenv_props + +} + +_get_old_mutated_props() { + local dflts=$(<"${old_dflts_file}") + local old_properties=$(<"${old_props}") + local ifs="${IFS}" + IFS="${nl}" + local -a dlines=( ${dflts} ) + local -a olines=( ${old_properties} ) + IFS="${ifs}" + while [ ${#olines[@]} -gt 0 -o ${#dlines[@]} -gt 0 ] ; do + local oline=${olines[0]} + local dline=${dlines[0]} + local okey=${oline%%=*} + local dkey=${dline%%=*} + if [[ "${okey}" == "${dkey}" ]] ; then + if [[ "${oline}" != "${dline}" ]] ; then + ulines+=( "${oline}" ) + fi + olines=( "${olines[@]:1}" ) + dlines=( "${dlines[@]:1}" ) + elif [[ -z "${okey}" || -z "${dkey}" ]] ; then + break + elif [[ "${okey}" < "${dkey}" ]] ; then + olines=( "${olines[@]:1}" ) + else + dlines=( "${dlines[@]:1}" ) + fi + done + local uline && for uline in "${ulines[@]}" ; do echo "${uline}" ; done +} + + +# Write the properties file with the write permissions +# +_props_write() { + rm -f "${1}" && cp /dev/null "${1}" && chmod 400 "${1}" && echo "${2}" >>"${1}" +} + +_props_trymerge() { + _debug() { + [ -n "${DEBUG}" ] || return 0 + local k=${1} && shift + local x && for x in "${@}" ; do echo "*** ${k} ${x}" >&2 ; done + } + + _merge() { + local -a rlines=() + while [ ${#olines[@]} -gt 0 -o ${#clines[@]} -gt 0 -o ${#dlines[@]} -gt 0 ] ; do + _debug "*" "o=${#olines[@]} c=${#clines[@]} d=${#dlines[@]}" + _debug "o" "${olines[@]}" + _debug "c" "${clines[@]}" + _debug "d" "${dlines[@]}" + _debug "r" "${rlines[@]}" + _debug "-" "-----------------------------------------" + local oline=${olines[0]} + local cline=${clines[0]} + local dline=${dlines[0]} + local okey=${oline%%=*} + local ckey=${cline%%=*} + local dkey=${dline%%=*} + local key= + if [[ ! -z "${okey}" ]] ; then + key=${okey} + elif [[ ! -z "${ckey}" ]] ; then + key=${ckey} + elif [[ ! -z "${dkey}" ]] ; then + key=${dkey} + else + break + fi + + if [[ "${ckey}" < "${key}" ]] ; then + if [[ ! -z "${ckey}" ]] ; then + key=${ckey} + fi + fi + if [[ "${dkey}" < "${key}" ]] ; then + if [[ ! -z "${dkey}" ]] ; then + key=${dkey} + fi + fi + + if [[ "${key}" == "${okey}" ]] ; then + rlines+=( "${oline}" ) + olines=( "${olines[@]:1}" ) + if [[ "${key}" == "${ckey}" ]] ; then + clines=( "${clines[@]:1}" ) + fi + if [[ "${key}" == "${dkey}" ]] ; then + dlines=( "${dlines[@]:1}" ) + fi + elif [[ "${key}" == "${ckey}" ]] ; then + rlines+=( "${cline}" ) + clines=( "${clines[@]:1}" ) + if [[ "${key}" == "${dkey}" ]] ; then + dlines=( "${dlines[@]:1}" ) + fi + else + rlines+=( "${dline}" ) + dlines=( "${dlines[@]:1}" ) + fi + done + local rline && for rline in "${rlines[@]}" ; do echo "${rline}" ; done + } + + # Three Way Merge of OVF Properties, Override Properties, and Defaults + # - Read the properties defaults into ${dflts}, OVF properties into ${ovf_props}, and Overrides into ${overrides} + # - The Overrides are simply cached properties that the user has mutated + # - The OVF props have priority 1, Overrides have priority 2, amd Defaults have priority 3 + # - Echo the result of the merge + # + if [ ! -f "${override_link}" ] ; then + echo >> "${override_link}" + fi + local dflts && dflts=$(<"${dflts_file}") && local ovf_props && ovf_props=$(<"${ovf_props_file}") && local overrides && overrides=$(<"${override_link}") && { + local ifs="${IFS}" + IFS="${nl}" + local -a dlines=( ${dflts} ) + local -a olines=( ${ovf_props} ) + local -a clines=( ${overrides} ) + IFS="${ifs}" + + echo "$(_merge)" + + if [ -f "${bootfs_vdc_props}" ] ; then + cat "${bootfs_vdc_props}" + fi + } +} + +# Install ${override_link} -> $(/etc/systool --getoverrideprops-path) +# - Get the bootfs target and the current ${override_link} target +# - If the correct symlink is already in place do nothing +# +_props_symlink() { + local old_target && old_target=$(readlink "${override_link}") || old_target="" + local new_target=${bootfs_override_props} + if ! new_target=$(_get_override_props_path 2>/dev/null) ; then + : + elif [ "${old_target}" = "${new_target}" ] ; then + return 0 + else + rm -f "${override_link}" && ln -s "${new_target}" "${override_link}" + fi +} + +# Defaults +bootfs_dev=${bootfs_dev:-'/dev/sda1'} +bootfs_mntp=${bootfs_mntp:-'/.volumes/bootfs'} +bootfs_vdc_props=${bootfs_props:-${bootfs_mntp}/etc/vdcconfig.properties} +override_props='config-override.properties' +bootfs_override_props=${bootfs_mntp}/etc/${override_props} +override_link='/etc/'${override_props} +bootfs_max_versions=${bootfs_max_versions:-3} +bootfs_default="default" +old_props='/.volumes/bootfs/etc/ovf-env.properties' +old_dflts_file='/etc/patch-props.defaults' +dflts_file='/etc/config.defaults' +ovf_props_file='/etc/ovfenv.properties' +props_temp='/tmp/config.properties' +tmp_mutated_file='/tmp/mutated.properties' +controller_props='controller-ovf.properties' +bootfs_controller_props='/.volumes/bootfs/etc/'${controller_props} +nl=' +' + +# These names must match mkrootfs.sh +bootfs_title="label" +bootfs_menuentry="boot" +bootfs_rootimg="rootimg" + +DO_NOT_INCLUDE="no" + +rc_reset + +# Parse flags and hacks +while [ $# -gt 0 ] ; do + case ${1} in + -x|--xtrace|--debug) + set -x ; shift ; continue ;; + --bootfs-dev=*) + bootfs_dev="${1#*=}" ; shift ; continue ;; + --bootfs-mntp=*) + bootfs_mntp="${1#*=}" ; shift ; continue ;; + --DO_NOT_INCLUDE=*) + DO_NOT_INCLUDE="${1#*=}" ; shift ; continue ;; + *) + break ;; + esac +done + +# Parse options +#_set_traps -E +case ${#} in + 1) case ${1} in + --test) _test_appliance ;; + --reboot) _reboot ;; + --poweroff) _poweroff ;; + --reconfig) _x _reconfig ;; + --list) _s _list_valid ;; + --get-default) _s _get_default ;; + --getprops) _s _get_props ;; + --getoverrides) _s _get_override_props ;; + --get-controller-ovfprops) _s _get_controller_props ;; + --getvdcprops) _s _get_vdc_props ;; + --initializeprops) _x _initialize_props ;; + --remount-rw) _x _bootfs_mount_rw "no" ;; + --remount-ro) _x true ;; + *) _usage + esac;; + 2) case ${1} in + --set-default) _x _set_default "${2}" ;; + --install) _x _install "${2}" ;; + --get-image) _s _get_image "${2}" ;; + --remove) _x _remove "${2}" ;; + --setoverrides) _x _set_override_props "${2}" ;; + --set-controller-ovfprops) _x _set_controller_props "${2}" ;; + --setvdcprops) _x _set_vdc_props "${2}" ;; + --restart) _x _restart "${2}" ;; + *) _usage + esac;; + 4) case ${1} in + --getprops) _s _get_props "${2}" "${3}" "${4}" ;; + *) + esac;; + *) _usage +esac + +rc_exit diff --git a/patches/2.2.1.0/transformsvc b/patches/2.2.1.0/transformsvc new file mode 100755 index 00000000..0d2a8bf6 --- /dev/null +++ b/patches/2.2.1.0/transformsvc @@ -0,0 +1,15 @@ +#!/bin/sh +LIB_DIR="/opt/storageos/lib" +export JAVA_HOME="/usr/lib64/jvm/java-1.8.0-oracle/jre" +export PATH="${JAVA_HOME}/bin:/opt/storageos/bin:/bin:/usr/bin" + +export CLASSPATH="/opt/storageos/conf:${LIB_DIR}:${LIB_DIR}/storageos-transformsvc.jar:${LIB_DIR}/rsa-bsafe-for-centera.jar:${LIB_DIR}/slf4j-api-1.7.5.jar:${LIB_DIR}/slf4j-log4j12-1.7.5.jar:${LIB_DIR}/jul-to-slf4j-1.7.5.jar:${LIB_DIR}/apache-log4j-extras-1.1.jar:${LIB_DIR}/joda-time-2.2.jar:${LIB_DIR}/super-csv-2.1.0.jar:${LIB_DIR}/antlr-runtime-3.2.jar:${LIB_DIR}/uuid-3.2.jar:${LIB_DIR}/cassandra-clientutil-2.0.10.jar:${LIB_DIR}/cassandra-thrift-2.0.10.jar:${LIB_DIR}/cassandra-all-2.0.10.jar:${LIB_DIR}/commons-lang3-3.1.jar:${LIB_DIR}/compress-lzf-0.8.4.jar:${LIB_DIR}/high-scale-lib-1.1.2.jar:${LIB_DIR}/jackson-mapper-asl-1.9.2.jar:${LIB_DIR}/jackson-core-asl-1.9.2.jar:${LIB_DIR}/jamm-0.2.5.jar:${LIB_DIR}/jbcrypt-0.3m.jar:${LIB_DIR}/jline-1.0.jar:${LIB_DIR}/json-simple-1.1.jar:${LIB_DIR}/lz4-1.2.0.jar:${LIB_DIR}/netty-3.6.6.Final.jar:${LIB_DIR}/metrics-core-2.2.0.jar:${LIB_DIR}/servlet-api-2.5.jar:${LIB_DIR}/snakeyaml-1.11.jar:${LIB_DIR}/snaptree-0.1.jar:${LIB_DIR}/antlr-3.2.jar:${LIB_DIR}/snappy-java-1.0.5.jar:${LIB_DIR}/concurrentlinkedhashmap-lru-1.3.jar:${LIB_DIR}/commons-cli-1.1.jar:${LIB_DIR}/libthrift-0.9.1.jar:${LIB_DIR}/astyanax-queue-1.56.49.jar:${LIB_DIR}/astyanax-recipes-1.56.49.jar:${LIB_DIR}/astyanax-cassandra-1.56.49.jar:${LIB_DIR}/astyanax-core-1.56.49.jar:${LIB_DIR}/astyanax-entity-mapper-1.56.49.jar:${LIB_DIR}/astyanax-thrift-1.56.49.jar:${LIB_DIR}/commons-lang-2.6.jar:${LIB_DIR}/aopalliance-1.0.jar:${LIB_DIR}/spring-aop-4.2.0.RELEASE.jar:${LIB_DIR}/spring-aspects-4.2.0.RELEASE.jar:${LIB_DIR}/spring-beans-4.2.0.RELEASE.jar:${LIB_DIR}/spring-context-4.2.0.RELEASE.jar:${LIB_DIR}/spring-context-support-4.2.0.RELEASE.jar:${LIB_DIR}/spring-core-4.2.0.RELEASE.jar:${LIB_DIR}/spring-expression-4.2.0.RELEASE.jar:${LIB_DIR}/spring-instrument-4.2.0.RELEASE.jar:${LIB_DIR}/spring-oxm-4.2.0.RELEASE.jar:${LIB_DIR}/spring-test-4.2.0.RELEASE.jar:${LIB_DIR}/spring-tx-4.2.0.RELEASE.jar:${LIB_DIR}/spring-web-4.2.0.RELEASE.jar:${LIB_DIR}/spring-webmvc-4.2.0.RELEASE.jar:${LIB_DIR}/javax.servlet-api-3.0.1.jar:${LIB_DIR}/spring-security-aspects-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-config-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-core-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-crypto-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-ldap-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-openid-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-remoting-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-taglibs-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-web-4.0.2.RELEASE.jar:${LIB_DIR}/spring-ldap-core-2.0.3.RELEASE.jar:${LIB_DIR}/netty-3.2.8.Final.jar:${LIB_DIR}/zookeeper-3.4.6-11-vipr.jar:${LIB_DIR}/curator-client-2.6.0.jar:${LIB_DIR}/curator-framework-2.6.0.jar:${LIB_DIR}/curator-recipes-2.6.0.jar:${LIB_DIR}/curator-test-2.6.0.jar:${LIB_DIR}/curator-x-discovery-2.6.0.jar:${LIB_DIR}/curator-x-discovery-server-2.6.0.jar:${LIB_DIR}/commons-logging-adapters-1.1.jar:${LIB_DIR}/commons-logging-api-1.1.jar:${LIB_DIR}/commons-httpclient-3.1.jar:${LIB_DIR}/asm-3.1.jar:${LIB_DIR}/jackson-jaxrs-1.9.2.jar:${LIB_DIR}/jackson-xc-1.9.2.jar:${LIB_DIR}/jersey-client-1.12.jar:${LIB_DIR}/jersey-core-1.12.jar:${LIB_DIR}/jersey-json-1.12.jar:${LIB_DIR}/jersey-server-1.12.jar:${LIB_DIR}/jersey-servlet-1.12.jar:${LIB_DIR}/jettison-1.1.jar:${LIB_DIR}/jsr311-api-1.1.1.jar:${LIB_DIR}/jersey-apache-client-1.12.jar:${LIB_DIR}/jersey-apache-client4-1.12.jar:${LIB_DIR}/jersey-multipart-1.12.jar:${LIB_DIR}/jetty-server-7.6.4.v20120524.jar:${LIB_DIR}/jetty-util-7.6.4.v20120524.jar:${LIB_DIR}/jetty-servlet-7.6.4.v20120524.jar:${LIB_DIR}/jetty-servlets-7.6.4.v20120524.jar:${LIB_DIR}/jetty-http-7.6.4.v20120524.jar:${LIB_DIR}/jetty-security-7.6.4.v20120524.jar:${LIB_DIR}/jetty-io-7.6.4.v20120524.jar:${LIB_DIR}/jetty-continuation-7.6.4.v20120524.jar:${LIB_DIR}/jetty-deploy-7.6.4.v20120524.jar:${LIB_DIR}/jetty-webapp-7.6.4.v20120524.jar:${LIB_DIR}/jetty-xml-7.6.4.v20120524.jar:${LIB_DIR}/commons-jexl-1.1.jar:${LIB_DIR}/perf4j-0.9.16.jar:${LIB_DIR}/aspectjweaver-1.7.0.jar:${LIB_DIR}/aspectjrt-1.7.0.jar:${LIB_DIR}/cglib-nodep-2.2.2.jar:${LIB_DIR}/httpcore-4.3.2.jar:${LIB_DIR}/httpclient-4.3.3.jar:${LIB_DIR}/jna-3.5.1.jar:${LIB_DIR}/platform-3.5.1.jar:${LIB_DIR}/netty-all-4.0.19.Final.jar:${LIB_DIR}/casnaming-2.1.0.2-832.jar:${LIB_DIR}/blitz4j-1.34.jar:${LIB_DIR}/archaius-core-0.6.0.jar:${LIB_DIR}/servo-core-0.7.2.jar:${LIB_DIR}/commons-configuration-1.10.jar:${LIB_DIR}/aws-java-sdk-core-1.9.30.jar:${LIB_DIR}/aws-java-sdk-s3-1.9.30.jar:${LIB_DIR}/storageos-xml.jar:${LIB_DIR}/storageos-common.jar:${LIB_DIR}/storageos-client.jar:${LIB_DIR}/storageos-controller.jar:${LIB_DIR}/storageos-objcontrolsvc.jar:${LIB_DIR}/storageos-provisionsvc.jar:${LIB_DIR}/storageos-directoryactions.jar:${LIB_DIR}/storageos-ownership.jar:${LIB_DIR}/storageos-devicescanner.jar:${LIB_DIR}/storageos-gc.jar:${LIB_DIR}/storageos-ssmclient.jar:${LIB_DIR}/storageos-sscommunicator.jar:${LIB_DIR}/storageos-shared.jar:${LIB_DIR}/storageos-faultinjection.jar:${LIB_DIR}/storageos-centeramapiclient.jar:${LIB_DIR}/storageos-blobclient.jar:${LIB_DIR}/storageos-vnest.jar:${LIB_DIR}/storageos-vnestclient.jar:${LIB_DIR}/storageos-transformclient.jar:${LIB_DIR}/storageos-cashead.jar:${LIB_DIR}/storageos-stat.jar:${LIB_DIR}/platforminterfaces-4.3.479.jar:${LIB_DIR}/protobuf-java-2.5.0.jar:${LIB_DIR}/storageos-logging.jar:${LIB_DIR}/fabric-agent-api-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-agent-client-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-base-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-lifecycle-api-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-lifecycle-client-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/cryptojce-6.1.2-FIPS-140.jar:${LIB_DIR}/cryptojcommon-6.1.2-FIPS-140.jar:${LIB_DIR}/jcmFIPS-6.1.2-FIPS-140.jar:${LIB_DIR}/certj-6.1.1-FIPS-140.jar:${LIB_DIR}/sslj-6.1.2-FIPS-140.jar:${LIB_DIR}/storageos-apisvc.jar:${LIB_DIR}/storageos-syssvc.jar:${LIB_DIR}/storageos-ec.jar:${LIB_DIR}/storageos-dynamicconfig.jar:${LIB_DIR}/storageos-daresecurity.jar:${LIB_DIR}/storageos-nfsclient.jar:${LIB_DIR}/FPLibrary-3.3.62.jar:${LIB_DIR}/commons-io-2.4.jar:${LIB_DIR}/storageos-datasecurity.jar:${LIB_DIR}/storageos-ipc.jar:${LIB_DIR}/storageos-netty.jar:${LIB_DIR}/storageos-keystone.jar:${LIB_DIR}/storageos-directoryclient.jar:${LIB_DIR}/storageos-casnaming.jar:${LIB_DIR}/storageos-resourceclient.jar:${LIB_DIR}/storageos-keypool.jar:${LIB_DIR}/storageos-metering-client.jar:${LIB_DIR}/storageos-statclient.jar:${LIB_DIR}/storageos-policy.jar:${LIB_DIR}/storageos-filesvcCommon.jar:${LIB_DIR}/storageos-directorytable.jar:${LIB_DIR}/storageos-zkstore.jar:${LIB_DIR}/storageos-monitoring.jar:${LIB_DIR}/commons-collections-3.2.1.jar:${LIB_DIR}/storageos-communication.jar:${LIB_DIR}/commons-pool2-2.2.jar:${LIB_DIR}/nile-apisvc_models-1.0.0.0.466.502508c.jar:${LIB_DIR}/storageos-fastmd5.jar:${LIB_DIR}/jaxen-1.1.1.jar:${LIB_DIR}/dom4j-1.6.1.jar:${LIB_DIR}/junit-4.11.jar:${LIB_DIR}/hamcrest-core-1.3.jar:${LIB_DIR}/hamcrest-library-1.3.jar:${LIB_DIR}/mapi-4.3.519.jar:${LIB_DIR}/storageos-cas_security.jar:${LIB_DIR}/storageos-cas_common.jar:${LIB_DIR}/storageos-blobclient_common.jar:${LIB_DIR}/storageos-btree.jar:${LIB_DIR}/storageos-cas-datastore.jar:${LIB_DIR}/storageos-statistics.jar:${LIB_DIR}/storageos-npacket.jar:${LIB_DIR}/storageos-blobaddress.jar:${LIB_DIR}/storageos-agent.jar:${LIB_DIR}/storageos-bytes.jar:${LIB_DIR}/storageos-utils.jar:${LIB_DIR}/storageos-config.jar:${LIB_DIR}/storageos-blobsvc.jar:${LIB_DIR}/concurrent-1.3.3.jar:${LIB_DIR}/sisu-guice-2.1.7.jar:${LIB_DIR}/jersey-spring-1.12.jar:${LIB_DIR}/storageos-ecs-client.jar:${LIB_DIR}/storageos-controllersvc.jar:${LIB_DIR}/storageos-security.jar:${LIB_DIR}/commons-compress-1.4.1.jar:${LIB_DIR}/xz-1.0.jar:${LIB_DIR}/jema-api-0.jar:${LIB_DIR}/xercesImpl-2.9.1.jar:${LIB_DIR}/eccpresso-all-2.8.jar:${LIB_DIR}/elmjava-3.3.0.jar:${LIB_DIR}/flexlm-11.11.1.jar:${LIB_DIR}/storageos-coordinatorsvc.jar:${LIB_DIR}/storageos-backup.jar:${LIB_DIR}/storageos-dbclient.jar:${LIB_DIR}/bcpkix-jdk15on-1.52.jar:${LIB_DIR}/bcprov-ext-jdk15on-1.52.jar:${LIB_DIR}/bcprov-jdk16-1.46.jar:${LIB_DIR}/javax.ws.rs-api-2.0.1.jar:${LIB_DIR}/storageos-paxos.jar:${LIB_DIR}/storageos-zkbtree.jar:${LIB_DIR}/storageos-md5.jar:${LIB_DIR}/storageos-georeplayer.jar:${LIB_DIR}/javax.inject-1.jar:${LIB_DIR}/gson-2.1.jar:${LIB_DIR}/jsch-0.1.51.jar:${LIB_DIR}/storageos-geomodels.jar:${LIB_DIR}/mail-1.4.3.jar:${LIB_DIR}/storageos-errorhandling.jar:${LIB_DIR}/storageos-models.jar:${LIB_DIR}/storageos-serviceutils.jar:${LIB_DIR}/javassist-3.18.0-GA.jar:${LIB_DIR}/storageos-jmx.jar:${LIB_DIR}/activation-1.1.jar:${LIB_DIR}/guava-15.0.jar:${LIB_DIR}/log4j-1.2.17.jar:${LIB_DIR}/jackson-core-2.3.5.jar:${LIB_DIR}/jackson-databind-2.3.5.jar:${LIB_DIR}/jackson-annotations-2.3.5.jar:${LIB_DIR}/commons-codec-1.8.jar:${LIB_DIR}/commons-logging-1.2.jar:${LIB_DIR}/tools.jar" + +# Save PID +echo $$ >/var/run/${0##*/}.pid + + +exec -a $0 ${JAVA_HOME}/bin/java -ea -server -d64 -Xmx512m -Dproduct.home="${PRODUCT_HOME:-/opt/storageos}" \ + -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/storageos/logs/transformsvc-$$.hprof -XX:+PrintGCDateStamps -XX:+PrintGCDetails \ + -Dlog4j.configuration=file:/opt/storageos/conf/transformsvc-log4j.properties -XX:NewSize=300m -XX:MaxNewSize=300m -Dsun.net.inetaddr.ttl=0 -XX:MaxPermSize=128m -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseCMSInitiatingOccupancyOnly -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintTenuringDistribution -XX:+PrintGCDateStamps -Xloggc:/opt/storageos/logs/transformsvc-gc-$((($(ls /opt/storageos/logs/transformsvc-gc-*.log.0* -t 2>/dev/null | head -n1 | sed 's/.*-gc-\([0-9]\).*/\1/')+1)%10)).log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 -XX:GCLogFileSize=50M \ + com.emc.storageos.data.transformation.Main "${@}" diff --git a/patches/2.2.1.0/vnest.object.properties b/patches/2.2.1.0/vnest.object.properties new file mode 100644 index 00000000..accde9f6 --- /dev/null +++ b/patches/2.2.1.0/vnest.object.properties @@ -0,0 +1,121 @@ +# vnest cluster group size +object.QuorumSize=5 +# number of zk servers in the ensemble +# keep same as QuorumSize; it is a separate config so it can be adjusted for standalone +object.ZkEnsembleSize=5 +# ownership lease time +object.zkReconfigWaitTimeSecs=300 + +object.RetryInterval=10000 +# This retry limit is for heartbeat only +object.RetryLimit=0 +# retry limit for bootstrap +object.BootstrapRetryLimit=1 + +object.TcpConnTimeout=1000 +object.MembershipBroadcastIntervalSecs=60 +object.UpdateCoordConfigIntervalSecs=60 +#number of thread to start for bcast +object.BcastLoadPerThread=3 +#number of bcast retry +object.NumBcastRetry=1 +#bcast threshold for serial or parallel +object.BcastThreshold=100 + +# comm requests to other servers +object.PaxosClientTimeoutSecs=10 + +# Total number of pre-allocated files +object.NumOfFiles=10 +# Threshold: if worker crosses this threshold then a new maintenance task is triggered to create new journal files +object.TaskTriggerThreshold=6 +# max journal size +object.FileSizeBytes=52428800 + +#Configuration module parameters +object.GroupMembershipFileName=groupmembership.config +object.CoordServerFileName=coord-server +object.CoordClientFileName=coord-client + +# configurable root, base of all directories +object.VNestRoot=/data/vnest +# configurable immediate child of VNestRoot, supports multiple vnests on single node (standalone) +object.VNestId=vnest-main + +# children of /VNestRoot/VNestId +object.ConfigurationPath=configuration +object.JournalPreallocationPath=journal +object.VNestJournalDir=replay +object.VNestIndexDir=index +object.VNestLockBoxDir=lockbox +object.VNestIndexRootRecordDir=root +object.VNestTempWorkspaceDir=workspace +object.RecycleDir=recycle +object.ShadowDir=shadow +object.VNestBootstrapDir=bootstrap + +#Initial refresh timeout in sec +object.InitialRefreshTimeoutSec=5 + +# HeartBeat +object.WaitForInitSecs=900 +object.WaitForBootstrapSecs=3600 +object.UnreachableSecs=3600 +object.UnreachableLeaderSecs=300 +object.TempNodeDownSecs=120 +object.HeartBeatFrequencySecs=5 +object.HeartBeatStatusCheckFrequencySecs=5 + +# Note: this should be less than object.WaitForInitSecs +object.MaxTimeSpentInitializingSecs=600 + +# GC +object.PreviousIndexesToKeep=3 +object.IndexGCIntervalSecs=300 +object.ChunkGCIntervalSecs=500 +# delete (true) vs. move to 'recycle' (false) +object.SkipRecycleDir=false + +# retention period of stale btree pages +object.BTree.DaysToRetain=2 +object.BTree.RecycleBinDir=recycleBin +object.BTree.StalePageRetenionDays=15 +object.VNestStaleJournalRetentionDays=5 + +# index BFW +object.IndexMaxSizePerWrite=524288 + +object.WSScanIntervalSec=600 + +object.WSDeleteThresholdSec=3600 + +# provided by container +object.NetworkConfigPath=/host/data/network.json +object.NodeInfoPath=/host/data/topology.json + +# comm retry in vNest paxos layer, for things like DT not init, etc +object.vNestPaxosRetryCount=3 + + +object.ObjectLockMaxWaitSeconds=10 + +# time before key reconfiguration task scan +object.ReconfigScanIntervalSecs=60 +# wait time after key in transition +object.ReconfigScanTimeoutIntervalSecs=140 +object.ReconfigKeyPartitions=7 +object.ReconfigThreads=8 +object.ReconfigListMaxKeys=512 + +object.KeyPurgeInitialDelayMinutes=10 +object.KeyPurgeIntervalMinutes=360 + +object.OperationsToggledInitialDelayMinutes=5 +object.OperationsToggledIntervalMinutes=60 +object.OperationsToggledLengthSeconds=10 +object.OperationsToggleEnabled=true +object.DiagnosticsEnabled=false + +# Use separate thread pools to prevent deadlock in vnest init +object.UseSeparateThreadPools=true + From 044b8637bc41d5b5e8a5dbced73345a313855219 Mon Sep 17 00:00:00 2001 From: petera5 Date: Tue, 21 Jun 2016 15:52:33 -0500 Subject: [PATCH 03/13] Inclusion of port 2049 for NFS mounting. --- Documentation/ECS-Troubleshooting.md | 1 + fwd_settings.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/ECS-Troubleshooting.md b/Documentation/ECS-Troubleshooting.md index 5ebc71aa..fba876b7 100644 --- a/Documentation/ECS-Troubleshooting.md +++ b/Documentation/ECS-Troubleshooting.md @@ -76,6 +76,7 @@ In the case of a multiple node configuration, you may |port.blob=1098| |port.provision=1198| |port.objhead=1298| +|port.nfs=2049| |port.zookeeper=2181| |port.coordinator=2889| |port.cassvc=3218| diff --git a/fwd_settings.sh b/fwd_settings.sh index a3b4a989..e49298d2 100644 --- a/fwd_settings.sh +++ b/fwd_settings.sh @@ -1,7 +1,7 @@ #!/bin/bash # Updates FirewallD settings with trusted ports in accordance with ECS requirements. -tcpadd=( 2 25 111 80 389 443 636 1095 1096 1098 1198 1298 2181 2889 3218 4443 5120 5123 7399 7400 7578 9010 9011 9020-9025 9028 9029 9040 9069 9091 9094-9101 9111 9201-9206 9208 9209 9212 9250 9888 9898 ) +tcpadd=( 2 25 111 80 389 443 636 1095 1096 1098 1198 1298 2049 2181 2889 3218 4443 5120 5123 7399 7400 7578 9010 9011 9020-9025 9028 9029 9040 9069 9091 9094-9101 9111 9201-9206 9208 9209 9212 9250 9888 9898 ) udpadd=( 1095 1096 1098 1198 1298 3218 9091 9094 9100 9201 9203 9208 9209 9250 9888 ) systemctl enable firewalld From ccba2b1659b05566dfdee66b79f30b860e7ae93c Mon Sep 17 00:00:00 2001 From: petera5 Date: Thu, 23 Jun 2016 14:37:09 -0500 Subject: [PATCH 04/13] Reiterating hostname restrictions. --- Documentation/ECS-MultiNode-Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ECS-MultiNode-Instructions.md b/Documentation/ECS-MultiNode-Instructions.md index c9524c60..0e912ef0 100644 --- a/Documentation/ECS-MultiNode-Instructions.md +++ b/Documentation/ECS-MultiNode-Instructions.md @@ -131,7 +131,7 @@ The following section needs to be performed on each one of the ECS nodes: |ecstestnode3 | 10.0.1.12 |sdc sdd | eth0 | |ecstestnode4 | 10.0.1.13 |sdc sdd | eth0 | -5. Use gathered values for each ECS node (IP addresses, hostnames, ethernet adapter name, disk names) to build the `step1_ecs_multinode_install.py` script, which will be the same across all nodes. For our example values, the command should look like this: +5. Use gathered values for each ECS node (IP addresses, hostnames, ethernet adapter name, disk names) to build the `step1_ecs_multinode_install.py` script, which will be the same across all nodes. Be advised that **the hostname can not be localhost for any node**. For our example values, the command should look like this: `sudo python step1_ecs_multinode_install.py --ips 10.0.1.10 10.0.1.11 10.0.1.12 10.0.1.13 --hostnames ecstestnode1 ecstestnode2 ecstestnode3 ecstestnode4 --disks sdc sdd --ethadapter eth0` From ee8853d1a89e65b47da39c8c96a0af68c8a5b16d Mon Sep 17 00:00:00 2001 From: petera5 Date: Thu, 23 Jun 2016 14:52:44 -0500 Subject: [PATCH 05/13] Additional closure of port-addition loop --- fwd_settings.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fwd_settings.sh b/fwd_settings.sh index e49298d2..1a38221e 100644 --- a/fwd_settings.sh +++ b/fwd_settings.sh @@ -9,10 +9,10 @@ systemctl start firewalld for port in "${tcpadd[@]}"; do firewall-cmd --permanent --add-port=$port/tcp +done for port in "${udpadd[@]}"; do firewall-cmd --permanent --add-port=$port/udp +done firewall-cmd --reload - -done exit 0 From bf2f9edb38155ff393983d6901f2d424f05b2e46 Mon Sep 17 00:00:00 2001 From: petera5 Date: Mon, 27 Jun 2016 16:03:21 -0500 Subject: [PATCH 06/13] Adding zkutils port --- Documentation/ECS-Troubleshooting.md | 1 + fwd_settings.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/ECS-Troubleshooting.md b/Documentation/ECS-Troubleshooting.md index fba876b7..e4726533 100644 --- a/Documentation/ECS-Troubleshooting.md +++ b/Documentation/ECS-Troubleshooting.md @@ -117,6 +117,7 @@ In the case of a multiple node configuration, you may |port.hdfs=9208| |port.event=9209| |port.objcontrolsvc=9212| +|port.zkutils=9230| |port.cas=9250| |port.resource=9888| |port.tcpIpcServer=9898| diff --git a/fwd_settings.sh b/fwd_settings.sh index 1a38221e..0ba42aab 100644 --- a/fwd_settings.sh +++ b/fwd_settings.sh @@ -1,7 +1,7 @@ #!/bin/bash # Updates FirewallD settings with trusted ports in accordance with ECS requirements. -tcpadd=( 2 25 111 80 389 443 636 1095 1096 1098 1198 1298 2049 2181 2889 3218 4443 5120 5123 7399 7400 7578 9010 9011 9020-9025 9028 9029 9040 9069 9091 9094-9101 9111 9201-9206 9208 9209 9212 9250 9888 9898 ) +tcpadd=( 2 25 111 80 389 443 636 1095 1096 1098 1198 1298 2049 2181 2889 3218 4443 5120 5123 7399 7400 7578 9010 9011 9020-9025 9028 9029 9040 9069 9091 9094-9101 9111 9201-9206 9208 9209 9212 9230 9250 9888 9898 ) udpadd=( 1095 1096 1098 1198 1298 3218 9091 9094 9100 9201 9203 9208 9209 9250 9888 ) systemctl enable firewalld From d1dce3d111a9b0aefa718ffb4638faca8e594a2c Mon Sep 17 00:00:00 2001 From: petera5 Date: Thu, 21 Jul 2016 17:42:10 -0500 Subject: [PATCH 07/13] Stronger notation that installation must be done on all nodes of Multiple-Node installation. --- Documentation/ECS-MultiNode-Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ECS-MultiNode-Instructions.md b/Documentation/ECS-MultiNode-Instructions.md index 0e912ef0..f6f93a63 100644 --- a/Documentation/ECS-MultiNode-Instructions.md +++ b/Documentation/ECS-MultiNode-Instructions.md @@ -114,7 +114,7 @@ rt Number|Port Description| ### Host Configuration #### :bangbang: WARNING: This is a destructive operation. Existing data on selected storage devices will be overwritten. Existing Docker installations AND images will be removed. -The following section needs to be performed on each one of the ECS nodes: +**The following section needs to be performed on each one of the ECS nodes:** 1. **Perform Updates:** Perform a Yum update using `sudo yum update` and download packages required for installation using `sudo yum install git tar wget` From 6f0101028b0315bf832b94caa7f10c5e8feda7bb Mon Sep 17 00:00:00 2001 From: petera5 Date: Thu, 21 Jul 2016 18:02:51 -0500 Subject: [PATCH 08/13] Adding changes from pull request #113 to current builds. --- ecs-multi-node/step1_ecs_multinode_install.py | 17 ++++++++++++----- .../step1_ecs_singlenode_install.py | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/ecs-multi-node/step1_ecs_multinode_install.py b/ecs-multi-node/step1_ecs_multinode_install.py index 2132f555..ab368954 100644 --- a/ecs-multi-node/step1_ecs_multinode_install.py +++ b/ecs-multi-node/step1_ecs_multinode_install.py @@ -12,6 +12,7 @@ import time import settings import re +import StringIO # Logging Initialization logging.config.dictConfig(settings.ECS_SINGLENODE_LOGGING) @@ -276,12 +277,12 @@ def prepare_data_disk_func(disks): logger.info("Make File filesystem in '{}'".format(device_name)) subprocess.call(["mkfs.xfs", "-f", device_name]) - uuid_name = "uuid-{}".format(index + 1) - # mkdir -p /ecs/uuid-1 + uuid_name = uuid_filename(device_name) + # mkdir -p /ecs/uuid-[uuid] logger.info("Make /ecs/{} Directory in attached Volume".format(uuid_name)) subprocess.call(["mkdir", "-p", "/ecs/{}".format(uuid_name)]) - # mount /dev/sdc1 /ecs/uuid-1 + # mount /dev/sdc1 /ecs/uuid-[uuid] logger.info("Mount attached {} to /ecs/{} volume.".format(device_name, uuid_name)) subprocess.call(["mount", device_name, "/ecs/{}".format(uuid_name), "-o", "noatime,seclabel,attr2,inode64,noquota"]) @@ -302,6 +303,11 @@ def prepare_data_disk_func(disks): logger.fatal("Aborting program! Please review log.") sys.exit() +def uuid_filename(device_name): + blkd_id_process = subprocess.Popen(["blkid", "-s", "UUID", "-o", "value", device_name], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = blkd_id_process.communicate() + return "uuid-{}".format(stdout.strip()) + def clean_data_disk_func(disks): """ @@ -314,13 +320,14 @@ def clean_data_disk_func(disks): disk_path = "/dev/{}".format(disk) device_name = disk_path + "1" + uuid_name = uuid_filename(device_name) uuid_name = "uuid-{}".format(index + 1) - # umount /dev/sdc1 /ecs/uuid-1 + # umount /dev/sdc1 /ecs/uuid-[uuid] logger.info("Umount attached /dev{} to /ecs/{} volume.".format(device_name, uuid_name)) subprocess.call(["umount", device_name, "/ecs/{}".format(uuid_name)]) - # rm -rf /ecs/uuid-1 + # rm -rf /ecs/uuid-[uuid] logger.info("Remove /ecs/{} Directory in attached Volume".format(uuid_name)) subprocess.call(["rm", "-rf", "/ecs/{}".format(uuid_name)]) diff --git a/ecs-single-node/step1_ecs_singlenode_install.py b/ecs-single-node/step1_ecs_singlenode_install.py index 691ef14d..5399beee 100755 --- a/ecs-single-node/step1_ecs_singlenode_install.py +++ b/ecs-single-node/step1_ecs_singlenode_install.py @@ -16,6 +16,7 @@ import socket import fcntl import struct +import StringIO # Logging Initialization @@ -270,12 +271,12 @@ def prepare_data_disk_func(disks): logger.info("Make File filesystem in '{}'".format(device_name)) subprocess.call(["mkfs.xfs", "-f", device_name]) - uuid_name = "uuid-{}".format(index + 1) - # mkdir -p /ecs/uuid-1 + uuid_name = uuid_filename(device_name) + # mkdir -p /ecs/uuid-[uuid] logger.info("Make /ecs/{} Directory in attached Volume".format(uuid_name)) subprocess.call(["mkdir", "-p", "/ecs/{}".format(uuid_name)]) - # mount /dev/sdc1 /ecs/uuid-1 + # mount /dev/sdc1 /ecs/uuid-[uuid] logger.info("Mount attached {} to /ecs/{} volume.".format(device_name, uuid_name)) subprocess.call(["mount", device_name, "/ecs/{}".format(uuid_name), "-o", "noatime,seclabel,attr2,inode64,noquota"]) @@ -296,6 +297,11 @@ def prepare_data_disk_func(disks): logger.fatal("Aborting program! Please review log.") sys.exit() +def uuid_filename(device_name): + blkd_id_process = subprocess.Popen(["blkid", "-s", "UUID", "-o", "value", device_name], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = blkd_id_process.communicate() + return "uuid-{}".format(stdout.strip()) + def run_additional_prep_file_func(disks): """ @@ -600,13 +606,13 @@ def cleanup_installation(disks): disk_path = "/dev/{}".format(disk) device_name = disk_path + "1" - uuid_name = "uuid-{}".format(index + 1) + uuid_name = uuid_filename(device_name) - # umount /dev/sdc1 /ecs/uuid-1 + # umount /dev/sdc1 /ecs/uuid-[uuid] logger.info("Umount attached /dev{} to /ecs/{} volume.".format(device_name, uuid_name)) subprocess.call(["umount", device_name, "/ecs/{}".format(uuid_name)]) - # rm -rf /ecs/uuid-1 + # rm -rf /ecs/uuid-[uuid] logger.info("Remove /ecs/{} Directory in attached Volume".format(uuid_name)) subprocess.call(["rm", "-rf", "/ecs/{}".format(uuid_name)]) From 2091c7070ff2c4eec3f2af2c08794e61ae5c3825 Mon Sep 17 00:00:00 2001 From: petera5 Date: Thu, 21 Jul 2016 18:37:19 -0500 Subject: [PATCH 09/13] Fixed typo in command. --- Documentation/ECS-Troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/ECS-Troubleshooting.md b/Documentation/ECS-Troubleshooting.md index e4726533..a95729c8 100644 --- a/Documentation/ECS-Troubleshooting.md +++ b/Documentation/ECS-Troubleshooting.md @@ -57,7 +57,7 @@ Ensure the ports in the following table are open for communication. In the case `firewall-cmd --permanent --zone=trusted --add-source=/32` -followed by `firewall-cmd --reboot` for each host. +followed by `firewall-cmd --reload` for each host. `fwd_settings.sh` in the main directory will invoke the `firewalld` service and permanently open necessary ports. In the case of a failure in this setup referencing `iptables`, please ensure that your docker network bridge is running and installed using `yum install bridge-utils`. From a6b1e784a834c59f4e1ecd3f574bc33b3c54b4d3 Mon Sep 17 00:00:00 2001 From: petera5 Date: Fri, 22 Jul 2016 10:48:56 -0500 Subject: [PATCH 10/13] Updated troubleshooting based on customer issue. --- Documentation/ECS-Troubleshooting.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/ECS-Troubleshooting.md b/Documentation/ECS-Troubleshooting.md index a95729c8..2be94a3a 100644 --- a/Documentation/ECS-Troubleshooting.md +++ b/Documentation/ECS-Troubleshooting.md @@ -37,6 +37,11 @@ If you want to see if system is making progress: `curl -X GET "http://:9101/stats/dt/DTInitStatā€¯` +### Docker Container immediately exits on startup + +If your docker instance immediately exits when started, please ensure that the entries in `/etc/hosts` on the host system and `network.json` in the install directory are correct (the latter should reflect the host's public IP and the corresponding network adapter). + + ### For those operating behind EMC firewall To install ECS Community Edition under these conditions, please view the readme file under **/emc-ssl-cert** for further instructions in installing the necessary CA certificate. From d1377bbd970fd7cc6be23873c21c4ae6a8d54249 Mon Sep 17 00:00:00 2001 From: petera5 Date: Mon, 25 Jul 2016 14:39:53 -0500 Subject: [PATCH 11/13] Duplicating fix in PR #151. --- ecs-multi-node/step1_ecs_multinode_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecs-multi-node/step1_ecs_multinode_install.py b/ecs-multi-node/step1_ecs_multinode_install.py index ab368954..e57cc1ad 100644 --- a/ecs-multi-node/step1_ecs_multinode_install.py +++ b/ecs-multi-node/step1_ecs_multinode_install.py @@ -476,7 +476,7 @@ def set_docker_configuration_func(): logger.info("Set container to start on boot.") subprocess.call(["systelctl", "enable", "docker.service"]) os.system("echo \"docker start multinode\" >>/etc/rc.local") - + os.system("chmod +x /etc/rc.d/rc.local") except Exception as ex: logger.exception(ex) From ff77092d6c332858b88c57063decdcd4494a047c Mon Sep 17 00:00:00 2001 From: petera5 Date: Mon, 25 Jul 2016 14:42:27 -0500 Subject: [PATCH 12/13] Setting --use-urandom to True as default. --- ecs-multi-node/step1_ecs_multinode_install.py | 2 +- ecs-single-node/step1_ecs_singlenode_install.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ecs-multi-node/step1_ecs_multinode_install.py b/ecs-multi-node/step1_ecs_multinode_install.py index e57cc1ad..ed1fb466 100644 --- a/ecs-multi-node/step1_ecs_multinode_install.py +++ b/ecs-multi-node/step1_ecs_multinode_install.py @@ -659,7 +659,7 @@ def main(): parser.add_argument('--imagetag', dest='imagetag', nargs='?', help='If present, pulls a specific version of the target image from DockerHub. Defaults to latest', required=False) - parser.add_argument('--use-urandom', dest='use_urandom', action='store_true', default=False, + parser.add_argument('--use-urandom', dest='use_urandom', action='store_true', default=True, help='If present, /dev/random will be mapped to /dev/urandom on the host. If you container starts up slow the first time could help.', required=False) parser.add_argument('--no-internet', dest='no_internet', action='store_true', default=False, diff --git a/ecs-single-node/step1_ecs_singlenode_install.py b/ecs-single-node/step1_ecs_singlenode_install.py index 5399beee..17d3eb21 100755 --- a/ecs-single-node/step1_ecs_singlenode_install.py +++ b/ecs-single-node/step1_ecs_singlenode_install.py @@ -402,6 +402,7 @@ def set_docker_configuration_func(): logger.info("Set container to start on boot.") subprocess.call(["systemctl", "enable", "docker.service"]) os.system("echo \"docker start ecsstandalone\" >>/etc/rc.local") + os.system("chmod +x /etc/rc.d/rc.local") except Exception as ex: logger.exception(ex) @@ -686,7 +687,7 @@ def main(): parser.add_argument('--imagetag', dest='imagetag', nargs='?', help='If present, pulls a specific version of the target image from DockerHub. Defaults to latest', required=False) - parser.add_argument('--use-urandom', dest='use_urandom', action='store_true', default=False, + parser.add_argument('--use-urandom', dest='use_urandom', action='store_true', default=True, help='If present, /dev/random will be mapped to /dev/urandom on the host. If you container starts up slow the first time could help.', required=False) parser.add_argument('--no-internet', dest='no_internet', action='store_true', default=False, From 40f6f661c287724f89cbcbda5cedf84b58536cd0 Mon Sep 17 00:00:00 2001 From: petera5 Date: Mon, 25 Jul 2016 14:45:52 -0500 Subject: [PATCH 13/13] New patch files. --- patches/2.2.1.1/Dockerfile | 22 + patches/2.2.1.1/coordinator.properties | 13 + .../2.2.1.1/storageserver-partition-config.sh | 119 +++ patches/2.2.1.1/systool | 730 ++++++++++++++++++ patches/2.2.1.1/transformsvc | 15 + patches/2.2.1.1/vnest.object.properties | 121 +++ 6 files changed, 1020 insertions(+) create mode 100644 patches/2.2.1.1/Dockerfile create mode 100644 patches/2.2.1.1/coordinator.properties create mode 100755 patches/2.2.1.1/storageserver-partition-config.sh create mode 100755 patches/2.2.1.1/systool create mode 100755 patches/2.2.1.1/transformsvc create mode 100644 patches/2.2.1.1/vnest.object.properties diff --git a/patches/2.2.1.1/Dockerfile b/patches/2.2.1.1/Dockerfile new file mode 100644 index 00000000..13bf4fcc --- /dev/null +++ b/patches/2.2.1.1/Dockerfile @@ -0,0 +1,22 @@ +# Fixes to the default 2.2.1.0 image. +FROM emcvipr/object:2.2.1.0-77706.493e577-reduced + +# Reduce timeout for systems that are shutdown for a while +ADD coordinator.properties /opt/storageos/conf/ +# Increase memory for transformsvc +ADD transformsvc /opt/storageos/bin/ + +# Fix disk partitioning script +ADD storageserver-partition-config.sh /opt/storageos/bin/ + +# Make vnest use separate thread pools to prevent deadlock +#ADD vnest.object.properties /opt/storageos/conf/ +RUN f=/opt/storageos/conf/vnest-common-conf-template.xml; grep -q "object.UseSeparateThreadPools" $f || sed -i '/properties id="serviceProperties"/a \ \ \ \ \ \ \ \ true' $f + +# Increase memory for transformsvc +ADD transformsvc /opt/storageos/bin/ +# Patch for small disk footprint disk allocation +ADD storageos-ssm.jar /opt/storageos/lib/ + +# Remove forced exit from systool +ADD systool /etc/ diff --git a/patches/2.2.1.1/coordinator.properties b/patches/2.2.1.1/coordinator.properties new file mode 100644 index 00000000..78346311 --- /dev/null +++ b/patches/2.2.1.1/coordinator.properties @@ -0,0 +1,13 @@ +# genconfig will set flag based on control node vs. data node +coordinator.useExternalConfig=true +coordinator.serverClientPort=2181 +coordinator.dataDir=/data/zk +coordinator.serverConfigFile=/data/vnest/vnest-main/configuration/coord-server +coordinator.clientConfigFile=/data/vnest/vnest-main/configuration/coord-client +coordinator.lastServedFile=/data/vnest/vnest-main/configuration/coord-last-served +# if node down for this long, wait to see if still member before proceeding +coordinator.lastServedThreshSecs=3600 +# if lastServedThreshSecs exceeded, wait this long for config to be updated +coordinator.lastServedTimeoutSecs=5 +# how often to touch last served file +coordinator.lastServedUpdateSecs=120 diff --git a/patches/2.2.1.1/storageserver-partition-config.sh b/patches/2.2.1.1/storageserver-partition-config.sh new file mode 100755 index 00000000..dbb9a0b4 --- /dev/null +++ b/patches/2.2.1.1/storageserver-partition-config.sh @@ -0,0 +1,119 @@ +#!/bin/bash +# Copyright (c) 2013 EMC Corporation +# All Rights Reserved +# +# This software contains the intellectual property of EMC Corporation +# or is licensed to EMC Corporation from third parties. Use of this +# software and the intellectual property contained therein is expressly +# limited to the terms and conditions of the License Agreement under which +# it is provided by or on behalf of EMC. +# + +date + +# This script will generate the partition file (ss-partition-conf.json) to be used on this server if one is not found. +# Also a general configuration file will be generated with main parameters and a ss uuid. +# Assumes this is running on gen 3 hardware or a vipr data test node using disks mounted with a +# /dae/uuid-58f917ab-23ba-457f-a9df-d0f4b0597e2d type pattern or will look for /data (vipr) + +export configdir="/opt/storageos/conf" + +export p_configfile="$configdir/storageserver-partition-conf.json" +export configfile="$configdir/storageserver.conf" + +blockbinsizegb=10 +vm_bb_cout=5 +vm_part_count=5 + +function setopt() { + opt=$1 + val=$2 + if grep -q "$opt" "$configfile" ; then + sed -i "s#$opt=.*#$opt=$val#g" "$configfile" + else + echo "$opt=$val" >> $configfile + fi + +} + +echo "creating main config file: $configfile" +if [ ! -e "$configfile" ]; then + echo "creating $configfile" + mkdir -p "$configdir" + cat << EOF > "$configfile" +listenaddress=0.0.0.0 +port=9099 +iothreads=100 +blockbinsizegb=$blockbinsizegb +debugenabled=false +logtoconsole=false +logtosyslog=true +maxoutstandingrequests=0 +initblockbins=0 +netserverListenPort=9069 +netserverLogLevel=INFO +ioThreadNumber=200 +perfCountEnabled=true +maxMemThresholdKb=3145728 +sendQHighWaterMark=1000 +recvThreadNicePriority=-15 +sendThreadNicePriority=-15 +enableAffinity=true +partitionroot=/dae +agentUrlEndPoint=/host/data/agent.json +agentDisksRestFragment=/v1/agent/node/storage/disk/disks +trustStore=/host/data/security/truststore.pem +verifyCerts=true +dbusEnabled=false +EOF +else + echo "$configfile already exists, no action taken" +fi + +if grep -q -E 'VMware.*Virtual.*disk' /proc/scsi/sg/device_strs && [ ! -e /data/is_community_edition ] +then + # this a virtual datanode, creating a json file with predefined values + echo "virtual node detected - using json config file" + setopt partitionconfig $p_configfile + setopt partitionroot=/dae + root="/data/storageserver" + + for part in $(seq 1 $vm_part_count); do + for bb in $(seq 1 $vm_bb_cout); do + bb=$(printf "%0*d\n" 4 $bb) + mkdir -m 777 -p $root/uuid-$part + fallocate -l${blockbinsizegb}G $root/uuid-$part/$bb + chmod 777 $root/uuid-$part/$bb + done + done + + if [ ! -e "$p_configfile" ]; then + echo "creating $p_configfile" + mkdir -p "$configdir" + + printf '{\n%2s"disks": [\n' > $p_configfile + for part in $(seq 1 "$vm_part_count"); do + printf '%4s{\n%6s"uuid": "'$part'",\n%6s"health": "Good"\n%4s}' >> $p_configfile + [ "$part" -lt "$vm_part_count" ] && echo "," >> $p_configfile || echo "" >> $p_configfile + done + printf '%2s]\n}' >> $p_configfile + + else + echo "$p_configfile already exists, no action taken" + fi +else + # this is a commodity hardware node. do not generate a json file - ss will use dbus to obtain partitions + echo "commodity node detected - using dbus api" +fi + +if ! grep --quiet "uuid" "$configfile"; then + echo "generating server uuid" + uuidgen="$(which uuidgen)" + if [ ! -z "$uuidgen" ]; then + uuid="$(uuidgen)" + else + echo "warning: uuidgen utility was not found on your system. using timestamp as a uuid" + uuid="$(date +%s)" + fi + setopt uuid "$uuid" +fi diff --git a/patches/2.2.1.1/systool b/patches/2.2.1.1/systool new file mode 100755 index 00000000..c008fe96 --- /dev/null +++ b/patches/2.2.1.1/systool @@ -0,0 +1,730 @@ +#!/bin/bash +# +# Copyright (c) 2014 EMC Corporation +# All Rights Reserved +# +# This software contains the intellectual property of EMC Corporation +# or is licensed to EMC Corporation from third parties. Use of this +# software and the intellectual property contained therein is expressly +# limited to the terms and conditions of the License Agreement under which +# it is provided by or on behalf of EMC. +# +# /etc/systool +# + +export PATH=/bin:/bin:/sbin:/usr/bin:/usr/sbin + +. /etc/rc.status + +_usage() { + set +Ex + echo "Usage: $0 --list" >&2 + echo " or: $0 --get-default" >&2 + echo " or: $0 --set-default name" >&2 + echo " or: $0 --get-image name" >&2 + echo " or: $0 --install file" >&2 + echo " or: $0 --remove name" >&2 + echo " or: $0 --getprops" >&2 + echo " or: $0 --get-controller-ovfprops" >&2 + echo " or: $0 --set-controller-ovfprops file" >&2 + echo " or: $0 --setoverrides file" >&2 + echo " or: $0 --reboot" >&2 + echo " or: $0 --poweroff" >&2 + echo " or: $0 --reconfig" >&2 + echo " or: $0 --restart service" >&2 + echo " or: $0 --test" >&2 + exit 2 +} + +_info() { + echo "$0: Info: $*" >&2 +} + +_warn() { + echo "$0: Warning: $*" >&2 +} + +_fatal() { + set +Ex + echo "$0: Error: $*" >&2 + exit 1 +} + +_fatal2() { + local code=${1:-1} ; shift + set +Ex + echo "$0: Error: $*" >&2 + exit ${code} +} + +_err_handler() { + set +E + _fatal "Line ${LINENO}: $(eval echo \"${BASH_COMMAND}\")" +} + +_exit_handler() { + set +E + for action in "${on_exit_actions[@]}" ; do + eval "${action}" + done +} + +_set_on_exit() { + on_exit_actions=( "${@}" "${on_exit_actions[@]}" ) +} + +_exit_handler() { + set +E + for action in "${on_exit_actions[@]}" ; do + eval "${action}" + done +} + +_set_traps() { + declare -a on_exit_actions + trap '' SIGINT + trap '' SIGTERM + trap _exit_handler EXIT + trap 'set +Ex ; _fatal "Line ${LINENO}: $(eval echo \"${BASH_COMMAND}\")"' ERR + if [ -n "${*}" ] ; then set "${@}" ; fi +} + +_is_appliance() { + [ -d "${bootfs_mntp}/boot/grub/i386-pc" ] +} + +_get_deployment_mode() { + if [ -f "/etc/fabrictool" ]; then + mode=$(/etc/fabrictool --mode) + echo ${mode} + fi +} + +deployment_mode=$(_get_deployment_mode) + +_ismounted() { + ( set +x ; while read dev mnt type flags dummy ; do case ${#} in + 1) [ "${dev}" = "${1}" -o "${mnt}" = "${1}" ] && break ;; + 2) [ "${dev}" = "${1}" -a "${mnt}" = "${2}" ] && break ;; + esac ; done &1) && return 0 + case "${err}" in + *'No medium found') return 1;; + *) echo "${err}" >&2;; + esac + sleep 1 + done + return 1 +} + +_mount() { + local dev=${@: -2: 1} + local mnt=${@: -1: 1} + if ! _ismounted "${dev}" "${mnt}" ; then + mkdir -p "${mnt}" + mount "${@}" && _set_on_exit "_umount ${mnt}" + fi +} + +_umount() { + if _ismounted "${1}" ; then + umount "${1}" || return $? + fi +} + +_bootfs_mount_ro() { + if [ "${deployment_mode}" == "fabric" ]; then + _warn "Fabric deployment. Skipping _bootfs_mount_ro()" + elif ! _is_appliance ; then + _warn "Not a real appliance. Skipping _bootfs_mount_ro()" + elif ! _ismounted "${bootfs_dev}" "${bootfs_mntp}" ; then + mkdir -p "${bootfs_mntp}" + mount -n -t ext3 -o ro "${bootfs_dev}" "${bootfs_mntp}" + elif _ismounted_rw "${bootfs_dev}" "${bootfs_mntp}" ; then + mount -n -o remount,ro "${bootfs_dev}" "${bootfs_mntp}" + fi +} + +_bootfs_mount_rw() { + [ "${bootfs_readonly}" != "true" ] || _fatal "Internal error: read-only bootfs" + if [ "${deployment_mode}" == "fabric" ]; then + _warn "Fabric deployment. Skipping _bootfs_mount_rw()" + elif ! _is_appliance ; then + _warn "Not a real appliance. Skipping _bootfs_mount_rw()" + elif ! _ismounted "${bootfs_dev}" "${bootfs_mntp}" ; then + mkdir -p "${bootfs_mntp}" + mount -n -t ext3 -o rw,noatime,barrier=1 "${bootfs_dev}" "${bootfs_mntp}" + if [ "${1}" != "no" ] ; then _set_on_exit _bootfs_mount_ro ; fi + elif ! _ismounted_rw "${bootfs_dev}" "${bootfs_mntp}" ; then + mount -n -o remount,rw,noatime,barrier=1 "${bootfs_dev}" "${bootfs_mntp}" + if [ "${1}" != "no" ] ; then _set_on_exit _bootfs_mount_ro ; fi + fi +} + +lock_file=/tmp/${0##*/}.lock +lock_timeout=${lock_timeout:-30} + +_s() { + ( _set_traps -E && flock -s -w "${lock_timeout}" 200 && bootfs_readonly=true && _bootfs_mount_ro && "${@}" ) 200>${lock_file} +} + +_x() { + ( _set_traps -E && flock -x -w "${lock_timeout}" 200 && _bootfs_mount_ro && "${@}" ) 200>${lock_file} +} + +_filter_valid() { + local d ; while read d ; do + if [[ "${d}" =~ ^.*-[1-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[^.]+(\.[^.]+)?$ ]] && [ -d "${bootfs_mntp}/${d}" ] && [ -f "${bootfs_mntp}/${d}/${bootfs_rootimg}" ] ; then echo "${d}" ; fi + done +} + +_list_all() { + local d ; ls -t "${bootfs_mntp}" | while read d ; do + [ -L "${bootfs_mntp}/${d}" -o "${d}" = "boot" ] || echo "${d}" + done +} + +_add_dummy_version() { + if ! _is_appliance && [ "${deployment_mode}" != "fabric" ] ; then + echo "vipr-2.0.0.0.0" + fi +} + +_list_valid() { + _list_all | _filter_valid + if [ "${DO_NOT_INCLUDE}" != "yes" ] ; then + _add_dummy_version + fi +} + +_get_default() { + local symlink="${bootfs_mntp}/${bootfs_default}" + local target="" + if [ -L "${symlink}" ] ; then + target=$(readlink "${symlink}") + local d=${target%%/*} + local v=$(echo "${d}" | _filter_valid) + [ -n "${v}" ] || { _warn "Internal inconsistency: ${bootfs_default} -> ${d} (Invalid directory)" ; return 0 ; } + [ -f "${symlink}" ] || { _warn "Internal inconsistency: ${bootfs_default} -> ${d} (No such file)" ; return 0 ; } + echo "${v}" + fi + _add_dummy_version +} + +_set_default() { + local symlink="${bootfs_mntp}/${bootfs_default}" + local image="${1}/${bootfs_rootimg}" + [ -n "${1}" ] || _fatal "Invalid argument" + local d=$(echo "${1}" | _filter_valid) + [ -n "${d}" ] || _fatal "${1}: Invalid version" + [ -d "${bootfs_mntp}/${1}" ] || _fatal "${1}: No such version (Internal error)" + [ -f "${bootfs_mntp}/${image}" ] || _fatal "${1}: No such version (Corrupted?)" + [ "${1}" = "$(_get_default)" ] && return 0 + _bootfs_mount_rw + rm -f "${symlink}" + ln -s "${image}" "${symlink}" +} + +_get_image() { + local image="${1}/${bootfs_rootimg}" + [ -n "${1}" ] || _fatal "Invalid argument" + local d=$(echo "${1}" | _filter_valid) + [ -n "${d}" ] || _fatal "${1}: Invalid version" + [ -d "${bootfs_mntp}/${1}" ] || _fatal "${1}: No such version (Internal error)" + [ -f "${bootfs_mntp}/${image}" ] || _fatal "${1}: No such version (Corrupted?)" + echo "${bootfs_mntp}/${image}" +} + +_remove() { + [ -n "${1}" ] || _fatal "Invalid argument" + [ "${1}" != "$(_get_default)" ] || _fatal "${1}: Can't remove ${bootfs_default}" + _bootfs_mount_rw + local d="${bootfs_mntp}/${1}" + if [ -d "${d}" ] ; then rm -r "${d}" ; fi +} + +_read_file() { + [ -f "${1}" ] || _fatal "${1}: No such file" + echo "$(<${1})" +} + +_read_override_file() { + if [ -f "${1}" ] ; then + cat "${1}" + fi +} + +_install() { + local rootimg_file="${1}" + local rootimg_mntp="/.volumes/${rootimg_file##*/}" + if [ "${deployment_mode}" == "fabric" ]; then + _fatal "Upgrade implementation pending. Skipping deploying the file ${rootimg_file} " + else + # Validate the root image and get its title + _mount -t squashfs -o ro,loop "${rootimg_file}" "${rootimg_mntp}" + local menuentry && menuentry==$(_read_file "${rootimg_mntp}/${bootfs_menuentry}") + local title && title=$(_read_file "${rootimg_mntp}/${bootfs_title}") + umount "${rootimg_mntp}" + + # Mount rw + # Remove this version if exists + # Make sure we have one empty slot + _bootfs_mount_rw + _remove "${title}" + + # Sanity checks + local bootfs_dir="${bootfs_mntp}/${title}" + [ ! -d "${bootfs_dir}" ] || _fatal "${bootfs_dir}: Directory exists" + [ ! -e "${bootfs_dir}" ] || _fatal "${bootfs_dir}: File exists" + + # Install + mkdir -p -m 755 "${bootfs_dir}" + cp -p "${rootimg_file}" "${bootfs_dir}/${bootfs_rootimg}" + echo ${title} + fi +} + +_get_override_props_path() { + [ -e "${bootfs_override_props}" ] || _fatal "${bootfs_override_props}: No such file" + echo "${bootfs_override_props}" +} + +_get_props() { + [ ! -f "${1}" ] || ovf_props_file="${1}" + [ ! -f "${2}" ] || override_link="${2}" + [ ! -f "${3}" ] || dflts_file="${3}" + _props_trymerge +} + +_get_override_props() { + _read_override_file "${bootfs_override_props}" +} + +_get_controller_props() { + if [ -f "${bootfs_controller_props}" ] ; then + _read_file "${bootfs_controller_props}" + fi +} + +_get_vdc_props() { + if [ -f "${bootfs_vdc_props}" ] ; then + _read_file "${bootfs_vdc_props}" + fi +} + +_write_props_file() { + local s && s=$(<"${1}") + if [ -e "${2}" ] ; then + [ "${s}" != "$(<"${2}")" ] || return 0 + _bootfs_mount_rw + mv "${2}" "${2}~" + else + _bootfs_mount_rw + fi + mkdir -p "${2%/*}" + cp /dev/null "${2}" + chmod 600 "${2}" + echo "${s}" >"${2}" + +} + +_set_vdc_props() { + _write_props_file "${1}" "${bootfs_vdc_props}" +} + +_get_ovf_props() { + _read_file "${ovf_props_file}" +} + +_get_props_defaults() { + _read_file "${dflts_file}" +} + +_write_file_and_set_permissions() { + mkdir -p "${1%/*}" + cp /dev/null "${1}" + chmod 600 "${1}" + echo "${2}" >"${1}" +} + +_set_override_props() { + local s && s=$(<"${1}") + if [ -e "${bootfs_override_props}" ] ; then + [ "${s}" != "$(<"${bootfs_override_props}")" ] || return 0 + _bootfs_mount_rw + mv "${bootfs_override_props}" "${bootfs_override_props}~" + else + _bootfs_mount_rw + fi + + _write_file_and_set_permissions "${bootfs_override_props}" "${s}" +} + +_set_controller_props() { + local s && s=$(<"${1}") + if [ -e "${bootfs_controller_props}" ] ; then + [ "${s}" != "$(<"${bootfs_controller_props}")" ] || return 0 + _bootfs_mount_rw + mv "${bootfs_controller_props}" "${bootfs_controller_props}~" + else + _bootfs_mount_rw + fi + + _write_file_and_set_permissions "${bootfs_controller_props}" "${s}" +} + +_reboot() { + if [ "${deployment_mode}" == "fabric" ]; then + echo "container reboot implementation pending" + elif ! _is_appliance ; then + _fatal2 66 "Not a real appliance. Reboot manually." + else + exec /sbin/reboot + _fatal "Failed to exec /sbin/reboot" + fi +} + +_poweroff() { + if [ "${deployment_mode}" == "fabric" ]; then + echo "container poweroff implementation pending" + elif ! _is_appliance ; then + _fatal2 66 "Not a real appliance. Poweroff manually." + else + exec /sbin/poweroff + _fatal "Failed to exec /sbin/poweroff" + fi +} + +_reconfig() { + if ! _is_appliance && [ "${deployment_mode}" != "fabric" ] ; then + _fatal2 66 "Not a real appliance. Reconfig manually." + else + exec /etc/genconfig <&2 + elif ! _is_appliance ; then + _fatal2 66 "Not a real appliance." + else + echo "Ok" >&2 + fi +} + +# This is only used for upgrade from 1.1.x to 2.x +_migrate_props() { + if [ -f "${old_props}" ] ; then + local oprops=$(_get_old_mutated_props) + _props_write "${tmp_mutated_file}" "${oprops}" + _set_override_props "${tmp_mutated_file}" + rm -f ${old_props} ${old_props}~ ${tmp_mutated_file} ${old_dflts_file} + fi +} + +# This is only used for data nodes +_extract_old_controller_ovf_props() { + #Print only relevant keys. Ignoring other properites stored in old files + sed -n 's/^\(network_.*_ipaddr\|network_vip\|network_vip6\|node_count\).*/\0/p' +} + +_initialize_datasvc_overrides() { + local override_props_cdrom_file=${cdrom_mnt}/${override_props} + if [ ! -f ${bootfs_override_props} -a -f ${override_props_cdrom_file} ] ; then + _set_override_props ${override_props_cdrom_file} + fi +} + +_initialize_datasvc_controller_props() { + local controller_ovf_cdrom_file=${cdrom_mnt}/${controller_props} + local old_controller_props_file=${cdrom_mnt}/ovf-env.defaults + if [ ! -f ${bootfs_controller_props} ] ; then + if [ -f ${controller_ovf_cdrom_file} ] ; then + _set_controller_props ${controller_ovf_cdrom_file} + elif [ -f ${old_controller_props_file} ] ; then + local tmp_ovf_props="/tmp/${controller_props}" + local old_ovf_props="$(_extract_old_controller_ovf_props <"${old_controller_props_file}")" + _props_write "${tmp_ovf_props}" "${old_ovf_props}" + _set_controller_props ${tmp_ovf_props} + fi + fi +} + +_initialize_datasvc() { + local cdrom_mnt='/.volumes/cdrom1' + if [ "${deployment_mode}" == "fabric" ]; then + local cdrom_dev=$(/etc/fabrictool --fabric-mount-loc)'/config.iso' + _mount -o loop -t iso9660 "${cdrom_dev}" "${cdrom_mnt}" + else + local cdrom_dev='/dev/sr1' + _probe "${cdrom_dev}" 2>/dev/null || return 0 + _mount -t iso9660 -o ro "${cdrom_dev}" "${cdrom_mnt}" + fi + _initialize_datasvc_controller_props + _initialize_datasvc_overrides +} + +_initialize_ovfenv_props() { + /etc/getovfproperties --readCDROM &>/dev/null +} + +_initialize_props() { + _migrate_props && + _initialize_datasvc && + _props_symlink && + _initialize_ovfenv_props + +} + +_get_old_mutated_props() { + local dflts=$(<"${old_dflts_file}") + local old_properties=$(<"${old_props}") + local ifs="${IFS}" + IFS="${nl}" + local -a dlines=( ${dflts} ) + local -a olines=( ${old_properties} ) + IFS="${ifs}" + while [ ${#olines[@]} -gt 0 -o ${#dlines[@]} -gt 0 ] ; do + local oline=${olines[0]} + local dline=${dlines[0]} + local okey=${oline%%=*} + local dkey=${dline%%=*} + if [[ "${okey}" == "${dkey}" ]] ; then + if [[ "${oline}" != "${dline}" ]] ; then + ulines+=( "${oline}" ) + fi + olines=( "${olines[@]:1}" ) + dlines=( "${dlines[@]:1}" ) + elif [[ -z "${okey}" || -z "${dkey}" ]] ; then + break + elif [[ "${okey}" < "${dkey}" ]] ; then + olines=( "${olines[@]:1}" ) + else + dlines=( "${dlines[@]:1}" ) + fi + done + local uline && for uline in "${ulines[@]}" ; do echo "${uline}" ; done +} + + +# Write the properties file with the write permissions +# +_props_write() { + rm -f "${1}" && cp /dev/null "${1}" && chmod 400 "${1}" && echo "${2}" >>"${1}" +} + +_props_trymerge() { + _debug() { + [ -n "${DEBUG}" ] || return 0 + local k=${1} && shift + local x && for x in "${@}" ; do echo "*** ${k} ${x}" >&2 ; done + } + + _merge() { + local -a rlines=() + while [ ${#olines[@]} -gt 0 -o ${#clines[@]} -gt 0 -o ${#dlines[@]} -gt 0 ] ; do + _debug "*" "o=${#olines[@]} c=${#clines[@]} d=${#dlines[@]}" + _debug "o" "${olines[@]}" + _debug "c" "${clines[@]}" + _debug "d" "${dlines[@]}" + _debug "r" "${rlines[@]}" + _debug "-" "-----------------------------------------" + local oline=${olines[0]} + local cline=${clines[0]} + local dline=${dlines[0]} + local okey=${oline%%=*} + local ckey=${cline%%=*} + local dkey=${dline%%=*} + local key= + if [[ ! -z "${okey}" ]] ; then + key=${okey} + elif [[ ! -z "${ckey}" ]] ; then + key=${ckey} + elif [[ ! -z "${dkey}" ]] ; then + key=${dkey} + else + break + fi + + if [[ "${ckey}" < "${key}" ]] ; then + if [[ ! -z "${ckey}" ]] ; then + key=${ckey} + fi + fi + if [[ "${dkey}" < "${key}" ]] ; then + if [[ ! -z "${dkey}" ]] ; then + key=${dkey} + fi + fi + + if [[ "${key}" == "${okey}" ]] ; then + rlines+=( "${oline}" ) + olines=( "${olines[@]:1}" ) + if [[ "${key}" == "${ckey}" ]] ; then + clines=( "${clines[@]:1}" ) + fi + if [[ "${key}" == "${dkey}" ]] ; then + dlines=( "${dlines[@]:1}" ) + fi + elif [[ "${key}" == "${ckey}" ]] ; then + rlines+=( "${cline}" ) + clines=( "${clines[@]:1}" ) + if [[ "${key}" == "${dkey}" ]] ; then + dlines=( "${dlines[@]:1}" ) + fi + else + rlines+=( "${dline}" ) + dlines=( "${dlines[@]:1}" ) + fi + done + local rline && for rline in "${rlines[@]}" ; do echo "${rline}" ; done + } + + # Three Way Merge of OVF Properties, Override Properties, and Defaults + # - Read the properties defaults into ${dflts}, OVF properties into ${ovf_props}, and Overrides into ${overrides} + # - The Overrides are simply cached properties that the user has mutated + # - The OVF props have priority 1, Overrides have priority 2, amd Defaults have priority 3 + # - Echo the result of the merge + # + if [ ! -f "${override_link}" ] ; then + echo >> "${override_link}" + fi + local dflts && dflts=$(<"${dflts_file}") && local ovf_props && ovf_props=$(<"${ovf_props_file}") && local overrides && overrides=$(<"${override_link}") && { + local ifs="${IFS}" + IFS="${nl}" + local -a dlines=( ${dflts} ) + local -a olines=( ${ovf_props} ) + local -a clines=( ${overrides} ) + IFS="${ifs}" + + echo "$(_merge)" + + if [ -f "${bootfs_vdc_props}" ] ; then + cat "${bootfs_vdc_props}" + fi + } +} + +# Install ${override_link} -> $(/etc/systool --getoverrideprops-path) +# - Get the bootfs target and the current ${override_link} target +# - If the correct symlink is already in place do nothing +# +_props_symlink() { + local old_target && old_target=$(readlink "${override_link}") || old_target="" + local new_target=${bootfs_override_props} + if ! new_target=$(_get_override_props_path 2>/dev/null) ; then + : + elif [ "${old_target}" = "${new_target}" ] ; then + return 0 + else + rm -f "${override_link}" && ln -s "${new_target}" "${override_link}" + fi +} + +# Defaults +bootfs_dev=${bootfs_dev:-'/dev/sda1'} +bootfs_mntp=${bootfs_mntp:-'/.volumes/bootfs'} +bootfs_vdc_props=${bootfs_props:-${bootfs_mntp}/etc/vdcconfig.properties} +override_props='config-override.properties' +bootfs_override_props=${bootfs_mntp}/etc/${override_props} +override_link='/etc/'${override_props} +bootfs_max_versions=${bootfs_max_versions:-3} +bootfs_default="default" +old_props='/.volumes/bootfs/etc/ovf-env.properties' +old_dflts_file='/etc/patch-props.defaults' +dflts_file='/etc/config.defaults' +ovf_props_file='/etc/ovfenv.properties' +props_temp='/tmp/config.properties' +tmp_mutated_file='/tmp/mutated.properties' +controller_props='controller-ovf.properties' +bootfs_controller_props='/.volumes/bootfs/etc/'${controller_props} +nl=' +' + +# These names must match mkrootfs.sh +bootfs_title="label" +bootfs_menuentry="boot" +bootfs_rootimg="rootimg" + +DO_NOT_INCLUDE="no" + +rc_reset + +# Parse flags and hacks +while [ $# -gt 0 ] ; do + case ${1} in + -x|--xtrace|--debug) + set -x ; shift ; continue ;; + --bootfs-dev=*) + bootfs_dev="${1#*=}" ; shift ; continue ;; + --bootfs-mntp=*) + bootfs_mntp="${1#*=}" ; shift ; continue ;; + --DO_NOT_INCLUDE=*) + DO_NOT_INCLUDE="${1#*=}" ; shift ; continue ;; + *) + break ;; + esac +done + +# Parse options +#_set_traps -E +case ${#} in + 1) case ${1} in + --test) _test_appliance ;; + --reboot) _reboot ;; + --poweroff) _poweroff ;; + --reconfig) _x _reconfig ;; + --list) _s _list_valid ;; + --get-default) _s _get_default ;; + --getprops) _s _get_props ;; + --getoverrides) _s _get_override_props ;; + --get-controller-ovfprops) _s _get_controller_props ;; + --getvdcprops) _s _get_vdc_props ;; + --initializeprops) _x _initialize_props ;; + --remount-rw) _x _bootfs_mount_rw "no" ;; + --remount-ro) _x true ;; + *) _usage + esac;; + 2) case ${1} in + --set-default) _x _set_default "${2}" ;; + --install) _x _install "${2}" ;; + --get-image) _s _get_image "${2}" ;; + --remove) _x _remove "${2}" ;; + --setoverrides) _x _set_override_props "${2}" ;; + --set-controller-ovfprops) _x _set_controller_props "${2}" ;; + --setvdcprops) _x _set_vdc_props "${2}" ;; + --restart) _x _restart "${2}" ;; + *) _usage + esac;; + 4) case ${1} in + --getprops) _s _get_props "${2}" "${3}" "${4}" ;; + *) + esac;; + *) _usage +esac + +rc_exit diff --git a/patches/2.2.1.1/transformsvc b/patches/2.2.1.1/transformsvc new file mode 100755 index 00000000..0d2a8bf6 --- /dev/null +++ b/patches/2.2.1.1/transformsvc @@ -0,0 +1,15 @@ +#!/bin/sh +LIB_DIR="/opt/storageos/lib" +export JAVA_HOME="/usr/lib64/jvm/java-1.8.0-oracle/jre" +export PATH="${JAVA_HOME}/bin:/opt/storageos/bin:/bin:/usr/bin" + +export CLASSPATH="/opt/storageos/conf:${LIB_DIR}:${LIB_DIR}/storageos-transformsvc.jar:${LIB_DIR}/rsa-bsafe-for-centera.jar:${LIB_DIR}/slf4j-api-1.7.5.jar:${LIB_DIR}/slf4j-log4j12-1.7.5.jar:${LIB_DIR}/jul-to-slf4j-1.7.5.jar:${LIB_DIR}/apache-log4j-extras-1.1.jar:${LIB_DIR}/joda-time-2.2.jar:${LIB_DIR}/super-csv-2.1.0.jar:${LIB_DIR}/antlr-runtime-3.2.jar:${LIB_DIR}/uuid-3.2.jar:${LIB_DIR}/cassandra-clientutil-2.0.10.jar:${LIB_DIR}/cassandra-thrift-2.0.10.jar:${LIB_DIR}/cassandra-all-2.0.10.jar:${LIB_DIR}/commons-lang3-3.1.jar:${LIB_DIR}/compress-lzf-0.8.4.jar:${LIB_DIR}/high-scale-lib-1.1.2.jar:${LIB_DIR}/jackson-mapper-asl-1.9.2.jar:${LIB_DIR}/jackson-core-asl-1.9.2.jar:${LIB_DIR}/jamm-0.2.5.jar:${LIB_DIR}/jbcrypt-0.3m.jar:${LIB_DIR}/jline-1.0.jar:${LIB_DIR}/json-simple-1.1.jar:${LIB_DIR}/lz4-1.2.0.jar:${LIB_DIR}/netty-3.6.6.Final.jar:${LIB_DIR}/metrics-core-2.2.0.jar:${LIB_DIR}/servlet-api-2.5.jar:${LIB_DIR}/snakeyaml-1.11.jar:${LIB_DIR}/snaptree-0.1.jar:${LIB_DIR}/antlr-3.2.jar:${LIB_DIR}/snappy-java-1.0.5.jar:${LIB_DIR}/concurrentlinkedhashmap-lru-1.3.jar:${LIB_DIR}/commons-cli-1.1.jar:${LIB_DIR}/libthrift-0.9.1.jar:${LIB_DIR}/astyanax-queue-1.56.49.jar:${LIB_DIR}/astyanax-recipes-1.56.49.jar:${LIB_DIR}/astyanax-cassandra-1.56.49.jar:${LIB_DIR}/astyanax-core-1.56.49.jar:${LIB_DIR}/astyanax-entity-mapper-1.56.49.jar:${LIB_DIR}/astyanax-thrift-1.56.49.jar:${LIB_DIR}/commons-lang-2.6.jar:${LIB_DIR}/aopalliance-1.0.jar:${LIB_DIR}/spring-aop-4.2.0.RELEASE.jar:${LIB_DIR}/spring-aspects-4.2.0.RELEASE.jar:${LIB_DIR}/spring-beans-4.2.0.RELEASE.jar:${LIB_DIR}/spring-context-4.2.0.RELEASE.jar:${LIB_DIR}/spring-context-support-4.2.0.RELEASE.jar:${LIB_DIR}/spring-core-4.2.0.RELEASE.jar:${LIB_DIR}/spring-expression-4.2.0.RELEASE.jar:${LIB_DIR}/spring-instrument-4.2.0.RELEASE.jar:${LIB_DIR}/spring-oxm-4.2.0.RELEASE.jar:${LIB_DIR}/spring-test-4.2.0.RELEASE.jar:${LIB_DIR}/spring-tx-4.2.0.RELEASE.jar:${LIB_DIR}/spring-web-4.2.0.RELEASE.jar:${LIB_DIR}/spring-webmvc-4.2.0.RELEASE.jar:${LIB_DIR}/javax.servlet-api-3.0.1.jar:${LIB_DIR}/spring-security-aspects-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-config-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-core-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-crypto-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-ldap-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-openid-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-remoting-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-taglibs-4.0.2.RELEASE.jar:${LIB_DIR}/spring-security-web-4.0.2.RELEASE.jar:${LIB_DIR}/spring-ldap-core-2.0.3.RELEASE.jar:${LIB_DIR}/netty-3.2.8.Final.jar:${LIB_DIR}/zookeeper-3.4.6-11-vipr.jar:${LIB_DIR}/curator-client-2.6.0.jar:${LIB_DIR}/curator-framework-2.6.0.jar:${LIB_DIR}/curator-recipes-2.6.0.jar:${LIB_DIR}/curator-test-2.6.0.jar:${LIB_DIR}/curator-x-discovery-2.6.0.jar:${LIB_DIR}/curator-x-discovery-server-2.6.0.jar:${LIB_DIR}/commons-logging-adapters-1.1.jar:${LIB_DIR}/commons-logging-api-1.1.jar:${LIB_DIR}/commons-httpclient-3.1.jar:${LIB_DIR}/asm-3.1.jar:${LIB_DIR}/jackson-jaxrs-1.9.2.jar:${LIB_DIR}/jackson-xc-1.9.2.jar:${LIB_DIR}/jersey-client-1.12.jar:${LIB_DIR}/jersey-core-1.12.jar:${LIB_DIR}/jersey-json-1.12.jar:${LIB_DIR}/jersey-server-1.12.jar:${LIB_DIR}/jersey-servlet-1.12.jar:${LIB_DIR}/jettison-1.1.jar:${LIB_DIR}/jsr311-api-1.1.1.jar:${LIB_DIR}/jersey-apache-client-1.12.jar:${LIB_DIR}/jersey-apache-client4-1.12.jar:${LIB_DIR}/jersey-multipart-1.12.jar:${LIB_DIR}/jetty-server-7.6.4.v20120524.jar:${LIB_DIR}/jetty-util-7.6.4.v20120524.jar:${LIB_DIR}/jetty-servlet-7.6.4.v20120524.jar:${LIB_DIR}/jetty-servlets-7.6.4.v20120524.jar:${LIB_DIR}/jetty-http-7.6.4.v20120524.jar:${LIB_DIR}/jetty-security-7.6.4.v20120524.jar:${LIB_DIR}/jetty-io-7.6.4.v20120524.jar:${LIB_DIR}/jetty-continuation-7.6.4.v20120524.jar:${LIB_DIR}/jetty-deploy-7.6.4.v20120524.jar:${LIB_DIR}/jetty-webapp-7.6.4.v20120524.jar:${LIB_DIR}/jetty-xml-7.6.4.v20120524.jar:${LIB_DIR}/commons-jexl-1.1.jar:${LIB_DIR}/perf4j-0.9.16.jar:${LIB_DIR}/aspectjweaver-1.7.0.jar:${LIB_DIR}/aspectjrt-1.7.0.jar:${LIB_DIR}/cglib-nodep-2.2.2.jar:${LIB_DIR}/httpcore-4.3.2.jar:${LIB_DIR}/httpclient-4.3.3.jar:${LIB_DIR}/jna-3.5.1.jar:${LIB_DIR}/platform-3.5.1.jar:${LIB_DIR}/netty-all-4.0.19.Final.jar:${LIB_DIR}/casnaming-2.1.0.2-832.jar:${LIB_DIR}/blitz4j-1.34.jar:${LIB_DIR}/archaius-core-0.6.0.jar:${LIB_DIR}/servo-core-0.7.2.jar:${LIB_DIR}/commons-configuration-1.10.jar:${LIB_DIR}/aws-java-sdk-core-1.9.30.jar:${LIB_DIR}/aws-java-sdk-s3-1.9.30.jar:${LIB_DIR}/storageos-xml.jar:${LIB_DIR}/storageos-common.jar:${LIB_DIR}/storageos-client.jar:${LIB_DIR}/storageos-controller.jar:${LIB_DIR}/storageos-objcontrolsvc.jar:${LIB_DIR}/storageos-provisionsvc.jar:${LIB_DIR}/storageos-directoryactions.jar:${LIB_DIR}/storageos-ownership.jar:${LIB_DIR}/storageos-devicescanner.jar:${LIB_DIR}/storageos-gc.jar:${LIB_DIR}/storageos-ssmclient.jar:${LIB_DIR}/storageos-sscommunicator.jar:${LIB_DIR}/storageos-shared.jar:${LIB_DIR}/storageos-faultinjection.jar:${LIB_DIR}/storageos-centeramapiclient.jar:${LIB_DIR}/storageos-blobclient.jar:${LIB_DIR}/storageos-vnest.jar:${LIB_DIR}/storageos-vnestclient.jar:${LIB_DIR}/storageos-transformclient.jar:${LIB_DIR}/storageos-cashead.jar:${LIB_DIR}/storageos-stat.jar:${LIB_DIR}/platforminterfaces-4.3.479.jar:${LIB_DIR}/protobuf-java-2.5.0.jar:${LIB_DIR}/storageos-logging.jar:${LIB_DIR}/fabric-agent-api-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-agent-client-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-base-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-lifecycle-api-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/fabric-lifecycle-client-1.2.0.1-2564.f3e9a9e.jar:${LIB_DIR}/cryptojce-6.1.2-FIPS-140.jar:${LIB_DIR}/cryptojcommon-6.1.2-FIPS-140.jar:${LIB_DIR}/jcmFIPS-6.1.2-FIPS-140.jar:${LIB_DIR}/certj-6.1.1-FIPS-140.jar:${LIB_DIR}/sslj-6.1.2-FIPS-140.jar:${LIB_DIR}/storageos-apisvc.jar:${LIB_DIR}/storageos-syssvc.jar:${LIB_DIR}/storageos-ec.jar:${LIB_DIR}/storageos-dynamicconfig.jar:${LIB_DIR}/storageos-daresecurity.jar:${LIB_DIR}/storageos-nfsclient.jar:${LIB_DIR}/FPLibrary-3.3.62.jar:${LIB_DIR}/commons-io-2.4.jar:${LIB_DIR}/storageos-datasecurity.jar:${LIB_DIR}/storageos-ipc.jar:${LIB_DIR}/storageos-netty.jar:${LIB_DIR}/storageos-keystone.jar:${LIB_DIR}/storageos-directoryclient.jar:${LIB_DIR}/storageos-casnaming.jar:${LIB_DIR}/storageos-resourceclient.jar:${LIB_DIR}/storageos-keypool.jar:${LIB_DIR}/storageos-metering-client.jar:${LIB_DIR}/storageos-statclient.jar:${LIB_DIR}/storageos-policy.jar:${LIB_DIR}/storageos-filesvcCommon.jar:${LIB_DIR}/storageos-directorytable.jar:${LIB_DIR}/storageos-zkstore.jar:${LIB_DIR}/storageos-monitoring.jar:${LIB_DIR}/commons-collections-3.2.1.jar:${LIB_DIR}/storageos-communication.jar:${LIB_DIR}/commons-pool2-2.2.jar:${LIB_DIR}/nile-apisvc_models-1.0.0.0.466.502508c.jar:${LIB_DIR}/storageos-fastmd5.jar:${LIB_DIR}/jaxen-1.1.1.jar:${LIB_DIR}/dom4j-1.6.1.jar:${LIB_DIR}/junit-4.11.jar:${LIB_DIR}/hamcrest-core-1.3.jar:${LIB_DIR}/hamcrest-library-1.3.jar:${LIB_DIR}/mapi-4.3.519.jar:${LIB_DIR}/storageos-cas_security.jar:${LIB_DIR}/storageos-cas_common.jar:${LIB_DIR}/storageos-blobclient_common.jar:${LIB_DIR}/storageos-btree.jar:${LIB_DIR}/storageos-cas-datastore.jar:${LIB_DIR}/storageos-statistics.jar:${LIB_DIR}/storageos-npacket.jar:${LIB_DIR}/storageos-blobaddress.jar:${LIB_DIR}/storageos-agent.jar:${LIB_DIR}/storageos-bytes.jar:${LIB_DIR}/storageos-utils.jar:${LIB_DIR}/storageos-config.jar:${LIB_DIR}/storageos-blobsvc.jar:${LIB_DIR}/concurrent-1.3.3.jar:${LIB_DIR}/sisu-guice-2.1.7.jar:${LIB_DIR}/jersey-spring-1.12.jar:${LIB_DIR}/storageos-ecs-client.jar:${LIB_DIR}/storageos-controllersvc.jar:${LIB_DIR}/storageos-security.jar:${LIB_DIR}/commons-compress-1.4.1.jar:${LIB_DIR}/xz-1.0.jar:${LIB_DIR}/jema-api-0.jar:${LIB_DIR}/xercesImpl-2.9.1.jar:${LIB_DIR}/eccpresso-all-2.8.jar:${LIB_DIR}/elmjava-3.3.0.jar:${LIB_DIR}/flexlm-11.11.1.jar:${LIB_DIR}/storageos-coordinatorsvc.jar:${LIB_DIR}/storageos-backup.jar:${LIB_DIR}/storageos-dbclient.jar:${LIB_DIR}/bcpkix-jdk15on-1.52.jar:${LIB_DIR}/bcprov-ext-jdk15on-1.52.jar:${LIB_DIR}/bcprov-jdk16-1.46.jar:${LIB_DIR}/javax.ws.rs-api-2.0.1.jar:${LIB_DIR}/storageos-paxos.jar:${LIB_DIR}/storageos-zkbtree.jar:${LIB_DIR}/storageos-md5.jar:${LIB_DIR}/storageos-georeplayer.jar:${LIB_DIR}/javax.inject-1.jar:${LIB_DIR}/gson-2.1.jar:${LIB_DIR}/jsch-0.1.51.jar:${LIB_DIR}/storageos-geomodels.jar:${LIB_DIR}/mail-1.4.3.jar:${LIB_DIR}/storageos-errorhandling.jar:${LIB_DIR}/storageos-models.jar:${LIB_DIR}/storageos-serviceutils.jar:${LIB_DIR}/javassist-3.18.0-GA.jar:${LIB_DIR}/storageos-jmx.jar:${LIB_DIR}/activation-1.1.jar:${LIB_DIR}/guava-15.0.jar:${LIB_DIR}/log4j-1.2.17.jar:${LIB_DIR}/jackson-core-2.3.5.jar:${LIB_DIR}/jackson-databind-2.3.5.jar:${LIB_DIR}/jackson-annotations-2.3.5.jar:${LIB_DIR}/commons-codec-1.8.jar:${LIB_DIR}/commons-logging-1.2.jar:${LIB_DIR}/tools.jar" + +# Save PID +echo $$ >/var/run/${0##*/}.pid + + +exec -a $0 ${JAVA_HOME}/bin/java -ea -server -d64 -Xmx512m -Dproduct.home="${PRODUCT_HOME:-/opt/storageos}" \ + -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/storageos/logs/transformsvc-$$.hprof -XX:+PrintGCDateStamps -XX:+PrintGCDetails \ + -Dlog4j.configuration=file:/opt/storageos/conf/transformsvc-log4j.properties -XX:NewSize=300m -XX:MaxNewSize=300m -Dsun.net.inetaddr.ttl=0 -XX:MaxPermSize=128m -XX:MaxTenuringThreshold=8 -XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent -XX:CMSInitiatingOccupancyFraction=60 -XX:+UseCMSInitiatingOccupancyOnly -XX:+PrintGCApplicationConcurrentTime -XX:+PrintGCApplicationStoppedTime -XX:+PrintTenuringDistribution -XX:+PrintGCDateStamps -Xloggc:/opt/storageos/logs/transformsvc-gc-$((($(ls /opt/storageos/logs/transformsvc-gc-*.log.0* -t 2>/dev/null | head -n1 | sed 's/.*-gc-\([0-9]\).*/\1/')+1)%10)).log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 -XX:GCLogFileSize=50M \ + com.emc.storageos.data.transformation.Main "${@}" diff --git a/patches/2.2.1.1/vnest.object.properties b/patches/2.2.1.1/vnest.object.properties new file mode 100644 index 00000000..accde9f6 --- /dev/null +++ b/patches/2.2.1.1/vnest.object.properties @@ -0,0 +1,121 @@ +# vnest cluster group size +object.QuorumSize=5 +# number of zk servers in the ensemble +# keep same as QuorumSize; it is a separate config so it can be adjusted for standalone +object.ZkEnsembleSize=5 +# ownership lease time +object.zkReconfigWaitTimeSecs=300 + +object.RetryInterval=10000 +# This retry limit is for heartbeat only +object.RetryLimit=0 +# retry limit for bootstrap +object.BootstrapRetryLimit=1 + +object.TcpConnTimeout=1000 +object.MembershipBroadcastIntervalSecs=60 +object.UpdateCoordConfigIntervalSecs=60 +#number of thread to start for bcast +object.BcastLoadPerThread=3 +#number of bcast retry +object.NumBcastRetry=1 +#bcast threshold for serial or parallel +object.BcastThreshold=100 + +# comm requests to other servers +object.PaxosClientTimeoutSecs=10 + +# Total number of pre-allocated files +object.NumOfFiles=10 +# Threshold: if worker crosses this threshold then a new maintenance task is triggered to create new journal files +object.TaskTriggerThreshold=6 +# max journal size +object.FileSizeBytes=52428800 + +#Configuration module parameters +object.GroupMembershipFileName=groupmembership.config +object.CoordServerFileName=coord-server +object.CoordClientFileName=coord-client + +# configurable root, base of all directories +object.VNestRoot=/data/vnest +# configurable immediate child of VNestRoot, supports multiple vnests on single node (standalone) +object.VNestId=vnest-main + +# children of /VNestRoot/VNestId +object.ConfigurationPath=configuration +object.JournalPreallocationPath=journal +object.VNestJournalDir=replay +object.VNestIndexDir=index +object.VNestLockBoxDir=lockbox +object.VNestIndexRootRecordDir=root +object.VNestTempWorkspaceDir=workspace +object.RecycleDir=recycle +object.ShadowDir=shadow +object.VNestBootstrapDir=bootstrap + +#Initial refresh timeout in sec +object.InitialRefreshTimeoutSec=5 + +# HeartBeat +object.WaitForInitSecs=900 +object.WaitForBootstrapSecs=3600 +object.UnreachableSecs=3600 +object.UnreachableLeaderSecs=300 +object.TempNodeDownSecs=120 +object.HeartBeatFrequencySecs=5 +object.HeartBeatStatusCheckFrequencySecs=5 + +# Note: this should be less than object.WaitForInitSecs +object.MaxTimeSpentInitializingSecs=600 + +# GC +object.PreviousIndexesToKeep=3 +object.IndexGCIntervalSecs=300 +object.ChunkGCIntervalSecs=500 +# delete (true) vs. move to 'recycle' (false) +object.SkipRecycleDir=false + +# retention period of stale btree pages +object.BTree.DaysToRetain=2 +object.BTree.RecycleBinDir=recycleBin +object.BTree.StalePageRetenionDays=15 +object.VNestStaleJournalRetentionDays=5 + +# index BFW +object.IndexMaxSizePerWrite=524288 + +object.WSScanIntervalSec=600 + +object.WSDeleteThresholdSec=3600 + +# provided by container +object.NetworkConfigPath=/host/data/network.json +object.NodeInfoPath=/host/data/topology.json + +# comm retry in vNest paxos layer, for things like DT not init, etc +object.vNestPaxosRetryCount=3 + + +object.ObjectLockMaxWaitSeconds=10 + +# time before key reconfiguration task scan +object.ReconfigScanIntervalSecs=60 +# wait time after key in transition +object.ReconfigScanTimeoutIntervalSecs=140 +object.ReconfigKeyPartitions=7 +object.ReconfigThreads=8 +object.ReconfigListMaxKeys=512 + +object.KeyPurgeInitialDelayMinutes=10 +object.KeyPurgeIntervalMinutes=360 + +object.OperationsToggledInitialDelayMinutes=5 +object.OperationsToggledIntervalMinutes=60 +object.OperationsToggledLengthSeconds=10 +object.OperationsToggleEnabled=true +object.DiagnosticsEnabled=false + +# Use separate thread pools to prevent deadlock in vnest init +object.UseSeparateThreadPools=true +