Merge "Percona Xtradb Cluster image building scripts"
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -22,3 +22,4 @@ options.rc
|
|||||||
*.log
|
*.log
|
||||||
.local.conf
|
.local.conf
|
||||||
scripts/local.conf.d/local.conf.d
|
scripts/local.conf.d/local.conf.d
|
||||||
|
*.config/
|
||||||
|
|||||||
14
scripts/files/elements/ubuntu-pxc/install.d/30-mysql
Executable file
14
scripts/files/elements/ubuntu-pxc/install.d/30-mysql
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# CONTEXT: GUEST during CONSTRUCTION as ROOT
|
||||||
|
# PURPOSE: Install controller base required packages
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get -y install percona-xtradb-cluster-server percona-xtrabackup
|
||||||
|
|
||||||
|
# Don't auto start mysql (we'll start it up in guest)
|
||||||
|
update-rc.d mysql defaults
|
||||||
|
update-rc.d mysql disable
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
|
# CONTEXT: GUEST during PRE-CONSTRUCTION as ROOT
|
||||||
|
# PURPOSE: Force a repo update
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
apt-get update
|
||||||
11
scripts/files/elements/ubuntu-pxc/pre-install.d/20-apparmor-mysql-local
Executable file
11
scripts/files/elements/ubuntu-pxc/pre-install.d/20-apparmor-mysql-local
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
#CONTEXT: chroot on host
|
||||||
|
#PURPOSE: Allows mysqld to create temporary files when restoring backups
|
||||||
|
|
||||||
|
cat <<EOF >>/etc/apparmor.d/local/usr.sbin.mysqld
|
||||||
|
/tmp/ rw,
|
||||||
|
/tmp/** rwk,
|
||||||
|
EOF
|
||||||
@@ -58,7 +58,7 @@ function build_guest_image() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
SERVICE_TYPE=$1
|
SERVICE_TYPE=$1
|
||||||
VALID_SERVICES='mysql percona redis cassandra couchbase mongodb postgresql couchdb vertica db2'
|
VALID_SERVICES='mysql percona redis cassandra couchbase mongodb postgresql couchdb vertica db2 pxc'
|
||||||
if ! [[ " $VALID_SERVICES " =~ " $SERVICE_TYPE " ]]; then
|
if ! [[ " $VALID_SERVICES " =~ " $SERVICE_TYPE " ]]; then
|
||||||
exclaim "You did not pass in a valid image type. Valid types are:" $VALID_SERVICES
|
exclaim "You did not pass in a valid image type. Valid types are:" $VALID_SERVICES
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -485,6 +485,9 @@ function cmd_set_datastore() {
|
|||||||
elif [ "$DATASTORE_TYPE" == "percona" ]; then
|
elif [ "$DATASTORE_TYPE" == "percona" ]; then
|
||||||
PACKAGES=${PACKAGES:-"percona-server-server-5.5"}
|
PACKAGES=${PACKAGES:-"percona-server-server-5.5"}
|
||||||
VERSION="5.5"
|
VERSION="5.5"
|
||||||
|
elif [ "$DATASTORE_TYPE" == "pxc" ]; then
|
||||||
|
PACKAGES=${PACKAGES:-"percona-xtradb-cluster-server"}
|
||||||
|
VERSION="5.5"
|
||||||
elif [ "$DATASTORE_TYPE" == "mongodb" ]; then
|
elif [ "$DATASTORE_TYPE" == "mongodb" ]; then
|
||||||
PACKAGES=${PACKAGES:-"mongodb-org"}
|
PACKAGES=${PACKAGES:-"mongodb-org"}
|
||||||
VERSION="3.0"
|
VERSION="3.0"
|
||||||
@@ -638,22 +641,29 @@ function mod_confs() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$DATASTORE_TYPE" = "vertica" ]; then
|
if [ "$DATASTORE_TYPE" = "vertica" ]; then
|
||||||
# Setting cluster_member_count to 2 to decrease cluster spawn time.
|
|
||||||
iniset $TROVE_CONF vertica cluster_member_count 2
|
|
||||||
|
|
||||||
# Vertica needs more time than mysql for its boot/start/stop operations.
|
# Vertica needs more time than mysql for its boot/start/stop operations.
|
||||||
iniset $TROVE_TASKMANAGER_CONF DEFAULT agent_call_high_timeout 300
|
setup_cluster_configs
|
||||||
iniset $TROVE_TASKMANAGER_CONF DEFAULT cluster_usage_timeout 2000
|
|
||||||
iniset $TROVE_TASKMANAGER_CONF DEFAULT resize_time_out 900
|
|
||||||
iniset $TROVE_TASKMANAGER_CONF DEFAULT usage_timeout 1500
|
|
||||||
|
|
||||||
# Setting flavor to be >= 2GB RAM for Vertica guest instances in test.conf.
|
# Setting flavor to be >= 2GB RAM for Vertica guest instances in test.conf.
|
||||||
sed -i "s/m1.rd-tiny/m1.small/g" $TEST_CONF
|
sed -i "s/m1.rd-tiny/m1.small/g" $TEST_CONF
|
||||||
sed -i "s/m1.rd-smaller/m1.medium/g" $TEST_CONF
|
sed -i "s/m1.rd-smaller/m1.medium/g" $TEST_CONF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$DATASTORE_TYPE" = "pxc" ]; then
|
||||||
|
setup_cluster_configs
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setup_cluster_configs() {
|
||||||
|
# Setting cluster_member_count to 2 to decrease cluster spawn time.
|
||||||
|
iniset $TROVE_CONF $DATASTORE_TYPE cluster_member_count 2
|
||||||
|
# Setting cluster configs
|
||||||
|
iniset $TROVE_TASKMANAGER_CONF DEFAULT agent_call_high_timeout 300
|
||||||
|
iniset $TROVE_TASKMANAGER_CONF DEFAULT cluster_usage_timeout 2000
|
||||||
|
iniset $TROVE_TASKMANAGER_CONF DEFAULT resize_time_out 900
|
||||||
|
iniset $TROVE_TASKMANAGER_CONF DEFAULT usage_timeout 1500
|
||||||
|
}
|
||||||
|
|
||||||
function add_test_flavors() {
|
function add_test_flavors() {
|
||||||
add_flavor 'tinier' 6 506 10 1 0
|
add_flavor 'tinier' 6 506 10 1 0
|
||||||
|
|||||||
Reference in New Issue
Block a user