Run devstack zookeeper on tmpfs

We've seen connection losses to zookeeper during functional testing on
some cloud regions. Move zookeepers data dir to tmpfs to avoid io to the
disk costs.

Change-Id: If45d5cd7a2b63dbe7f20e7ef528b65ba41af7117
This commit is contained in:
Clark Boylan 2018-12-18 15:20:47 -08:00
parent 713de6c711
commit 0d17a2527d
1 changed files with 11 additions and 0 deletions

View File

@ -651,6 +651,14 @@ EOF
mkdir -p $HOME/.cache/openstack/
}
function nodepool_zk_on_tmpfs {
local datadir
datadir=$(sed -n -e 's/^dataDir=//p' /etc/zookeeper/conf/zoo.cfg)
sudo service zookeeper stop
sudo mount -t tmpfs -o nodev,nosuid,size=500M none $datadir
sudo service zookeeper start
}
# Create configs
# Setup custom flavor
function configure_nodepool {
@ -694,6 +702,9 @@ function start_nodepool {
export STATSD_PORT=8125
run_process statsd "/usr/bin/socat -u udp-recv:$STATSD_PORT -"
# Restart nodepool's zk on a tmpfs
nodepool_zk_on_tmpfs
# Ensure our configuration is valid.
$NODEPOOL_INSTALL/bin/nodepool -c $NODEPOOL_CONFIG config-validate