File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ set +o xtrace
2727ETCD_DATA_DIR=" $DATA_DIR /etcd"
2828ETCD_SYSTEMD_SERVICE=" devstack@etcd.service"
2929ETCD_BIN_DIR=" $DEST /bin"
30+ # Option below will mount ETCD_DATA_DIR as ramdisk, which is useful to run
31+ # etcd-heavy services in the gate VM's, e.g. Kubernetes.
32+ ETCD_USE_RAMDISK=$( trueorfalse False ETCD_USE_RAMDISK)
33+ ETCD_RAMDISK_MB=${ETCD_RAMDISK_MB:- 512}
3034
3135if is_ubuntu ; then
3236 UBUNTU_RELEASE_BASE_NUM=` lsb_release -r | awk ' {print $2}' | cut -d ' .' -f 1`
@@ -89,6 +93,9 @@ function cleanup_etcd3 {
8993
9094 $SYSTEMCTL daemon-reload
9195
96+ if [[ " $ETCD_USE_RAMDISK " == " True" ]]; then
97+ sudo umount $ETCD_DATA_DIR
98+ fi
9299 sudo rm -rf $ETCD_DATA_DIR
93100}
94101
@@ -98,6 +105,9 @@ function install_etcd3 {
98105 # Create the necessary directories
99106 sudo mkdir -p $ETCD_BIN_DIR
100107 sudo mkdir -p $ETCD_DATA_DIR
108+ if [[ " $ETCD_USE_RAMDISK " == " True" ]]; then
109+ sudo mount -t tmpfs -o nodev,nosuid,size=${ETCD_RAMDISK_MB} M tmpfs $ETCD_DATA_DIR
110+ fi
101111
102112 # Download and cache the etcd tgz for subsequent use
103113 local etcd_file
You can’t perform that action at this time.
0 commit comments