heartbeat)
#setPgpoolParam heartbeat_device0 "NIC device name of NIC to send/receive heartbeat signal" eth0
#setPgpoolParam heartbeat_destination0 "host name or IP address to which device 0's heartbeat destinates" "'$NODE1_HOST'"
+ writePgpoolParam heartbeat_device0 "'eth0'"
writePgpoolParam heartbeat_destination0 "'$DEST_HOST'"
+ writePgpoolParam heartbeat_destination_port0 "9694"
;;
query)
return
fi
- local _STEPS=5
+ local _STEPS=6
echo
echo $BOLD"----------------------------------------------------------------------"$SPAN_END
function doConfigPostgres()
{
- local _STEPS=4
+ local _STEPS=5
cp templates/postgresql.conf editted/postgresql.conf
ynQuestion "Do you edit postgresql.conf now?"
# -------------------------------------------------------------------
# licence agreement
+echo "================================================================="
cat COPYING
+echo "================================================================="
ynQuestion "Do you accept the end user software license agreement?"
if [ $? -ne 0 ]; then exit 1; fi
fi
fi
+echo
+echo "* Node information"
echo
echo "Two-node cluster (node 0 and node 1) is assumed."
fixNodes
echo
echo "Which node is this?"
echo "If this is node 0, a database cluster is created by initdb after installation."
-echo "Otherwise if this is node 1, you can use the configurations on node 0."
+echo "Otherwise if this is node 1, the configurations on node 0 is reused."
ynQuestion "Is this node 0?"
if [ $? -eq 0 ]; then
NODE_NO=0
echo
# postgres user check
+echo "* Check $PG_SUPER_USER user"
+echo
id $PG_SUPER_USER >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$PG_SUPER_USER user doesn't exist on $THIS_HOST. Creating ..."
# -------------------------------------------------------------------
# passwordless access over ssh
-
echo
-echo "Setup passwordless access over ssh from $PG_SUPER_USER@$THIS_HOST to $PG_SUPER_USER@$DEST_HOST"
+echo "* Setup passwordless access over ssh"
+echo
+echo "... from $PG_SUPER_USER@$THIS_HOST to $PG_SUPER_USER@$DEST_HOST"
sshWithoutPass $PG_SUPER_USER
if [ $? -ne 0 ]; then
echo "Failed to ssh $PG_SUPER_USER@$DEST_HOST."
fi
echo
-echo "Setup passwordless access over ssh from $APACHE_USER@$THIS_HOST to $PG_SUPER_USER@$DEST_HOST"
+echo "... from $APACHE_USER@$THIS_HOST to $PG_SUPER_USER@$DEST_HOST"
makeApacheLoginable
if [ $? -ne 0 ]; then
echo "Failed to make apache loginable. For configuring apache user, httpd must be stopped."
echo "OK."
fi
echo
+echo "* Configuration"
+echo
# create temporary config files in editted directory
rm -rf editted/
cp templates/pgpool_remote_start editted/
echo
- echo "- save configuration information for installation on node 1..."
+ echo "save configuration information for installation on node 1"
writeValList
rm -rf $TEMP_CONF
mkdir $TEMP_CONF
chmod 700 $TEMP_CONF
chmod 600 $TEMP_CONF/*
else
- echo "- copy configuration information from node 0..."
+ echo
+ echo "copy configuration information from node 0"
su $PG_SUPER_USER -c "mkdir $TEMP_CONF; scp $PG_SUPER_USER@$DEST_HOST:$TEMP_CONF/* $TEMP_CONF"
cp $TEMP_CONF/* editted
rm -rf $TEMP_CONF
# [3] install RPMs
# -------------------------------------------------------------------
+echo
+echo "* Installation"
ynQuestion "Do you install pgpool really?"
if [ $? -ne 0 ]; then
return
# pgpoolAdmin
echo
-echo -n "* Setup pgpoolAdmin"
+echo "* Setup pgpoolAdmin"
echo -n "- rewrite pgmgt.conf.php ... "
cp editted/pgmgt.conf.php $ADMIN_DIR/conf/
if [ $NODE_NO -eq 0 ]; then
echo
echo "* Create node 0 (localhost) 's database cluster"
+ echo
echo -n "- initdb ... "
fi
fi
+echo
+echo "* Setup database"
+echo
+
echo "- put scripts for failover ... OK"
cp editted/config_for_script $PGPOOL_CONF_DIR
if [ $MODE = "stream" ]; then
doQueries
fi
-echo "- remove configuration information on node 0..."
if [ $NODE_NO -eq 1 ]; then
+ echo
+ echo "remove configuration information on node 0"
su $PG_SUPER_USER -c "ssh $PG_SUPER_USER@$DEST_HOST rm -rf $TEMP_CONF"
fi