Skip to content

Commit

Permalink
configurable test cluster version
Browse files Browse the repository at this point in the history
  • Loading branch information
Rany Keddo committed Jan 23, 2012
1 parent 2eeeb3a commit a78c7c1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .config

This file was deleted.

1 change: 1 addition & 0 deletions spec/config/.config
@@ -1,3 +1,4 @@
mysqldir=/usr/local/mysql
basedir=/opt/lhm-cluster
master_port=3306
slave_port=3307
6 changes: 3 additions & 3 deletions spec/config/clobber
Expand Up @@ -12,7 +12,7 @@ lhmkill() {

echo stopping other running mysql instance
launchctl remove com.mysql.mysqld || { echo launchctl did not remove mysqld; }
mysqladmin shutdown || { echo mysqladmin did not shut down anything; }
"$mysqldir"/bin/mysqladmin shutdown || { echo mysqladmin did not shut down anything; }

echo killing lhm-cluster
lhmkill
Expand All @@ -24,8 +24,8 @@ echo setting up cluster
spec/config/setup-cluster

echo staring instances
mysqld --defaults-file="$basedir/master/my.cnf" 2>&1 >$basedir/master/lhm.log &
mysqld --defaults-file="$basedir/slave/my.cnf" 2>&1 >$basedir/slave/lhm.log &
"$mysqldir"/bin/mysqld --defaults-file="$basedir/master/my.cnf" 2>&1 >$basedir/master/lhm.log &
"$mysqldir"/bin/mysqld --defaults-file="$basedir/slave/my.cnf" 2>&1 >$basedir/slave/lhm.log &
sleep 5

echo running grants
Expand Down
6 changes: 3 additions & 3 deletions spec/config/grants
Expand Up @@ -2,8 +2,8 @@

source .config

master() { mysql --protocol=TCP -P $master_port -uroot; }
slave() { mysql --protocol=TCP -P $slave_port -uroot; }
master() { "$mysqldir"/bin/mysql --protocol=TCP -P $master_port -uroot; }
slave() { "$mysqldir"/bin/mysql --protocol=TCP -P $slave_port -uroot; }

# set up master

Expand All @@ -22,4 +22,4 @@ echo "grant all privileges on *.* to ''@'localhost'" | master
echo "grant all privileges on *.* to ''@'localhost'" | slave

echo "create database lhm" | master
echo "create database lhm" | slave
echo "create database if not exists lhm" | slave
26 changes: 15 additions & 11 deletions spec/config/setup-cluster
Expand Up @@ -42,20 +42,24 @@ server-id = 2
# replication (optional filters)
replicate-do-table = lhm.users
replicate-do-table = lhm.lhmn_users
replicate-wild-do-table = lhm.lhma_%_users
# replicate-do-table = lhm.users
# replicate-do-table = lhm.lhmn_users
# replicate-wild-do-table = lhm.lhma_%_users
replicate-do-table = lhm.origin
replicate-do-table = lhm.lhmn_origin
replicate-wild-do-table = lhm.lhma_%_origin
# replicate-do-table = lhm.origin
# replicate-do-table = lhm.lhmn_origin
# replicate-wild-do-table = lhm.lhma_%_origin
replicate-do-table = lhm.destination
replicate-do-table = lhm.lhmn_destination
replicate-wild-do-table = lhm.lhma_%_destination
# replicate-do-table = lhm.destination
# replicate-do-table = lhm.lhmn_destination
# replicate-wild-do-table = lhm.lhma_%_destination
CNF

# build system tables

mysql_install_db --datadir="$basedir/master/data"
mysql_install_db --datadir="$basedir/slave/data"
(
cd "$mysqldir"
./scripts/mysql_install_db --datadir="$basedir/master/data"
./scripts/mysql_install_db --datadir="$basedir/slave/data"

)

0 comments on commit a78c7c1

Please sign in to comment.