replication: MARIADB_DATABASE is required to setup a replication slave

This commit is contained in:
Sameer Naik
2015-09-10 14:53:13 +05:30
parent 587c76951b
commit e996d40828
2 changed files with 31 additions and 0 deletions

View File

@@ -77,6 +77,12 @@ configure_replication() {
REPLICATION_USER=${REPLICATION_USER:-$MARIADB_MASTER_ENV_REPLICATION_USER}
REPLICATION_PASSWORD=${REPLICATION_PASSWORD:-$MARIADB_MASTER_ENV_REPLICATION_PASSWORD}
if [ ! $MARIADB_DATABASE ]; then
echo "In order to setup a replication slave you need to provide the MARIADB_DATABASE as well"
echo ""
exit -1
fi
echo "==> Setting the master configuration..."
echo "CHANGE MASTER TO MASTER_HOST='$MASTER_HOST', MASTER_USER='$REPLICATION_USER', MASTER_PASSWORD='$REPLICATION_PASSWORD';" >> /tmp/init_mysql.sql