. rdqmCommon.sh

basehostname=$(cat /etc/hostname | sed 's/[[:digit:]]\.fyre\.ibm\.com//')
echoBig "Base Hostname is: $basehostname"

initRDQMSetup

echoBig "User: $user | node1: $node1 | node2: $node2 | node3: $node3 | sshCommand: $sshCommand"

############################
# Create drbdpool VG       #
############################

echoBig "Creating drbdpool Volume Group on nodes"

############################
# Create drbdpool VG N1    #
############################

createVGdrbdpool $node1

if [ $? != 0 ]
then
  echoBig "Failed creating drbdpool VG on $node1"
  exit 1
fi

createVGdrbdpool $node2

if [ $? != 0 ]
then
  echoBig "Failed creating drbdpool VG on $node2"
  exit 1
fi

createVGdrbdpool $node3

if [ $? != 0 ]
then
  echoBig "Failed creating drbdpool VG on $node3"
  exit 1
fi

############################
# Populate rdqm.ini file   #
############################
echoBig "Populate rdqm.ini file"
echo "Node:
  HA_Replication=$(hostname -I | cut -f1 -d\ )
Node:
  HA_Replication=$($sshCommand root@$node2 hostname -I | cut -f1 -d\\ )
Node:
  HA_Replication=$($sshCommand root@$node3 hostname -I | cut -f1 -d\\ )" > /var/mqm/rdqm.ini

