summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-22 17:59:36 +0000
committerGerrit Code Review <review@openstack.org>2016-09-22 17:59:36 +0000
commitd313c7ea260f1e18c7e12d19ce04a4fad5b3f75a (patch)
tree137261a071c942de95e02ff9e5e58dd75a4dd82e
parent6216a4d48f7414b7c224347828133964e7566d75 (diff)
parentcd435a1254231b86885e54b3c2f1e6f43bb1b526 (diff)
downloadtrove-integration-d313c7ea260f1e18c7e12d19ce04a4fad5b3f75a.tar.gz
Merge "Change MongoDB to version 3.2"
-rwxr-xr-xscripts/files/elements/ubuntu-mongodb/install.d/10-mongodb65
-rwxr-xr-xscripts/files/elements/ubuntu-mongodb/install.d/10-mongodb-thp42
-rwxr-xr-xscripts/files/elements/ubuntu-mongodb/install.d/20-mongodb8
-rwxr-xr-xscripts/files/elements/ubuntu-mongodb/install.d/30-mongodb-conf26
-rwxr-xr-xscripts/files/elements/ubuntu-mongodb/install.d/41-mongod-init46
-rwxr-xr-xscripts/files/elements/ubuntu-mongodb/install.d/42-mongos-init30
-rwxr-xr-xscripts/files/elements/ubuntu-mongodb/pre-install.d/10-mongodb-apt-key14
-rwxr-xr-xscripts/redstack2
8 files changed, 167 insertions, 66 deletions
diff --git a/scripts/files/elements/ubuntu-mongodb/install.d/10-mongodb b/scripts/files/elements/ubuntu-mongodb/install.d/10-mongodb
deleted file mode 100755
index 184d0ae..0000000
--- a/scripts/files/elements/ubuntu-mongodb/install.d/10-mongodb
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/sh
-
-# CONTEXT: GUEST during CONSTRUCTION as ROOT
-# PURPOSE: Install controller base required packages
-
-set -e
-set -o xtrace
-
-export DEBIAN_FRONTEND=noninteractive
-
-cat > "/etc/rc.local" << _EOF_
-# Make sure to disable Linux kernel feature transparent huge pages,
-# it will affect greatly both memory usage and latency in a negative way.
-# See: http://docs.mongodb.org/manual/tutorial/transparent-huge-pages/
-if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
- echo never > /sys/kernel/mm/transparent_hugepage/defrag
-fi
-if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
- echo never > /sys/kernel/mm/transparent_hugepage/enabled
-fi
-
-exit \$?
-
-_EOF_
-
-# see http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
-apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
-echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" \
- | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
-apt-get update
-apt-get install -y mongodb-org
-
-# MongoDB configuration settings
-# use the default bindIP
-sed -i '/bindIp/d' /etc/mongod.conf
-# need to use smallFiles until the device is mounted
-sed -i 's/# mmapv1:/ mmapv1:\n smallFiles: true/' /etc/mongod.conf
-
-cat > "/etc/init/mongos.conf" << '_EOF_'
-limit fsize unlimited unlimited # (file size)
-limit cpu unlimited unlimited # (cpu time)
-limit as unlimited unlimited # (virtual memory size)
-limit nofile 64000 64000 # (open files)
-limit nproc 64000 64000 # (processes/threads)
-
-pre-start script
- mkdir -p /var/log/mongodb/
-end script
-
-start on runlevel [2345]
-stop on runlevel [06]
-
-script
- ENABLE_MONGOS="yes"
- if [ -f /etc/default/mongos ]
- then
- . /etc/default/mongos
- fi
- if [ "x$ENABLE_MONGOS" = "xyes" ]
- then
- exec start-stop-daemon --start --quiet --chuid mongodb \
- --exec /usr/bin/mongos -- --config /etc/mongod.conf
- fi
-end script
-_EOF_
diff --git a/scripts/files/elements/ubuntu-mongodb/install.d/10-mongodb-thp b/scripts/files/elements/ubuntu-mongodb/install.d/10-mongodb-thp
new file mode 100755
index 0000000..48d6c8b
--- /dev/null
+++ b/scripts/files/elements/ubuntu-mongodb/install.d/10-mongodb-thp
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+set -o xtrace
+
+export DEBIAN_FRONTEND=noninteractive
+
+cat > /etc/init.d/disable-transparent-hugepages << '_EOF_'
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: disable-transparent-hugepages
+# Required-Start: $local_fs
+# Required-Stop:
+# X-Start-Before: mongod mongodb-mms-automation-agent
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Disable Linux transparent huge pages
+# Description: Disable Linux transparent huge pages, to improve
+# database performance.
+### END INIT INFO
+
+case $1 in
+ start)
+ if [ -d /sys/kernel/mm/transparent_hugepage ]; then
+ thp_path=/sys/kernel/mm/transparent_hugepage
+ elif [ -d /sys/kernel/mm/redhat_transparent_hugepage ]; then
+ thp_path=/sys/kernel/mm/redhat_transparent_hugepage
+ else
+ return 0
+ fi
+
+ echo 'never' > ${thp_path}/enabled
+ echo 'never' > ${thp_path}/defrag
+
+ unset thp_path
+ ;;
+esac
+_EOF_
+
+chmod 755 /etc/init.d/disable-transparent-hugepages
+
+update-rc.d disable-transparent-hugepages defaults
diff --git a/scripts/files/elements/ubuntu-mongodb/install.d/20-mongodb b/scripts/files/elements/ubuntu-mongodb/install.d/20-mongodb
new file mode 100755
index 0000000..6a95d2f
--- /dev/null
+++ b/scripts/files/elements/ubuntu-mongodb/install.d/20-mongodb
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+set -o xtrace
+
+export DEBIAN_FRONTEND=noninteractive
+
+apt-get -y install mongodb-org=3.2.6
diff --git a/scripts/files/elements/ubuntu-mongodb/install.d/30-mongodb-conf b/scripts/files/elements/ubuntu-mongodb/install.d/30-mongodb-conf
new file mode 100755
index 0000000..afb5828
--- /dev/null
+++ b/scripts/files/elements/ubuntu-mongodb/install.d/30-mongodb-conf
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+set -o xtrace
+
+# Remove the default pid file
+rm -f /var/run/mongodb.pid
+
+
+cat > /etc/mongod.conf << '_EOF_'
+storage.dbPath: /var/lib/mongodb
+security.authorization: enabled
+storage.engine: wiredTiger
+storage.journal.enabled: true
+systemLog.destination: file
+systemLog.logAppend: true
+systemLog.path: /var/log/mongodb/mongod.log
+_EOF_
+
+
+cat > /etc/mongos.conf << '_EOF_'
+security.authorization: enabled
+systemLog.destination: file
+systemLog.logAppend: true
+systemLog.path: /var/log/mongodb/mongos.log
+_EOF_
diff --git a/scripts/files/elements/ubuntu-mongodb/install.d/41-mongod-init b/scripts/files/elements/ubuntu-mongodb/install.d/41-mongod-init
new file mode 100755
index 0000000..77a1292
--- /dev/null
+++ b/scripts/files/elements/ubuntu-mongodb/install.d/41-mongod-init
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+set -e
+set -o xtrace
+
+cat > /etc/init/mongod.conf << '_EOF_'
+limit fsize unlimited unlimited
+limit cpu unlimited unlimited
+limit as unlimited unlimited
+limit nofile 64000 64000
+limit rss unlimited unlimited
+limit nproc 64000 64000
+
+kill timeout 300 # wait 300s between SIGTERM and SIGKILL.
+
+pre-start script
+ mkdir -p /var/run/mongodb/
+ touch /var/run/mongodb/mongod.pid
+ chown mongodb -R /var/run/mongodb/
+end script
+
+start on runlevel [2345]
+stop on runlevel [06]
+
+script
+ CONF=/etc/mongod.conf
+
+ # Handle NUMA access to CPUs (SERVER-3574)
+ # This verifies the existence of numactl as well as testing that the command works
+ NUMACTL_ARGS="--interleave=all"
+ if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / >/dev/null 2>/dev/null
+ then
+ NUMACTL="$(which numactl) -- $NUMACTL_ARGS"
+ DAEMON_OPTS=${DAEMON_OPTS:-"--config $CONF"}
+ else
+ NUMACTL=""
+ DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"}
+ fi
+
+ exec start-stop-daemon --start \
+ --chuid mongodb \
+ --pidfile /var/run/mongod.pid \
+ --make-pidfile \
+ --exec $NUMACTL /usr/bin/mongod $DAEMON_OPTS
+end script
+_EOF_
diff --git a/scripts/files/elements/ubuntu-mongodb/install.d/42-mongos-init b/scripts/files/elements/ubuntu-mongodb/install.d/42-mongos-init
new file mode 100755
index 0000000..dc91fdb
--- /dev/null
+++ b/scripts/files/elements/ubuntu-mongodb/install.d/42-mongos-init
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+set -o xtrace
+
+cat > /etc/init/mongos.conf << '_EOF_'
+limit fsize unlimited unlimited
+limit cpu unlimited unlimited
+limit as unlimited unlimited
+limit nofile 64000 64000
+limit rss unlimited unlimited
+limit nproc 64000 64000
+
+pre-start script
+ mkdir -p /var/run/mongodb/
+ touch /var/run/mongodb/mongos.pid
+ chown mongodb -R /var/run/mongodb/
+end script
+
+start on runlevel [2345]
+stop on runlevel [06]
+
+script
+ exec start-stop-daemon --start \
+ --chuid mongodb \
+ --pidfile /var/run/mongos.pid \
+ --make-pidfile \
+ --exec /usr/bin/mongos -- --config /etc/mongos.conf
+end script
+_EOF_
diff --git a/scripts/files/elements/ubuntu-mongodb/pre-install.d/10-mongodb-apt-key b/scripts/files/elements/ubuntu-mongodb/pre-install.d/10-mongodb-apt-key
new file mode 100755
index 0000000..1538d61
--- /dev/null
+++ b/scripts/files/elements/ubuntu-mongodb/pre-install.d/10-mongodb-apt-key
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+set -o xtrace
+
+[ -n "${RELEASE}" ] || die "RELEASE must be set to either Precise or Quantal"
+
+apt-get -y install software-properties-common
+
+apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
+
+echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
+
+apt-get -y update
diff --git a/scripts/redstack b/scripts/redstack
index 3b5f691..5b20af4 100755
--- a/scripts/redstack
+++ b/scripts/redstack
@@ -564,7 +564,7 @@ function cmd_set_datastore() {
VERSION="10.1"
elif [ "$DATASTORE_TYPE" == "mongodb" ]; then
PACKAGES=${PACKAGES:-"mongodb-org"}
- VERSION="3.0"
+ VERSION="3.2"
elif [ "$DATASTORE_TYPE" == "redis" ]; then
PACKAGES=${PACKAGES:-"redis-server"}
VERSION="3.0"