Sha256: a3d2d308ed7e30091b3a261dbc97a6a957630989fd4735fe455621654802659f

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

#!/bin/sh

#
# Set up master slave cluster for lhm specs
#

set -e
set -u

source .config

#
# Main
#

mkdir -p "$basedir/master/data" "$basedir/slave/data"

cat <<-CNF > $basedir/master/my.cnf
[mysqld]
pid-file = $basedir/master/mysqld.pid
socket = $basedir/master/mysqld.sock
port = $master_port
log_output = FILE
log-error = $basedir/master/error.log
datadir = $basedir/master/data
log-bin = master-bin
log-bin-index = master-bin.index
server-id = 1
CNF

cat <<-CNF > $basedir/slave/my.cnf
[mysqld]
pid-file = $basedir/slave/mysqld.pid
socket = $basedir/slave/mysqld.sock
port = $slave_port
log_output = FILE
log-error = $basedir/slave/error.log
datadir = $basedir/slave/data
relay-log = slave-relay-bin
relay-log-index = slave-relay-bin.index
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.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
CNF

# build system tables

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

)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lhm-1.0.0.rc4 spec/config/setup-cluster