.GenaSYS.sh
+next.gapines.org_genasys.conf
custom/
ssl_cert/
config/
+TODO
+.GenaSYS.sh-old
SYNOPSIS_="$NAME_"
REQUIRES_="standard GNU commands, apt, dpkg"
VERSION_="0.96"
- DATE_="2010-09-18; last update: 2012-11-10"
+ DATE_="2010-09-18; last update: 2012-11-14"
AUTHOR_="Andy Witter <awitter@georgialibraries.org>"
URL_="http://evergreen-ils.org"
CATEGORY_="devel"
DB_USERNAME="evergreen"
#DRONECOUNT="2"
TMPHOSTS="/tmp/tmphost.txt"
+TMPZONEFILE="/tmp/tmpzonefile.txt"
TMPOSRFNODES="/tmp/tmposrfnodes"
TMPOPENSRF_XML="/tmp/tmpopensrf.xml"
PSQL_VERSION="9.1"
# else
# REPORTS_NFS_HOSTNAME="${CHOSEN_REPORTS_NFS_HOSTNAME}"
#fi
-echo;echo -e $COL_BR_BLUE"Setting up reports output NFS share on"$COL_RESET $COL_BR_GREEN"${REPORTS_NFS_HOSTNAME}.${CLUSTERDOMAINNAME}"$COL_RESET
+echo;echo -e $COL_BR_BLUE"Setting up reports output NFS share on"$COL_RESET $COL_BR_GREEN"${CHOSEN_REPORTS_NFS_HOSTNAME}.${CLUSTERDOMAINNAME}"$COL_RESET
sleep 2
}
then
Get_Hostname_Prefix
fi
+Write_Config_File USE_HOSTNAME_PREFIX
Write_Config_File HOSTNAME_PREFIX
if [ -z $USE_CA_CERT ] || [ "$USE_CONFIG_FILE" == "0" ]
done
-### Start hosts file configuration.
+### Start hosts and DNS zone file configuration.
if [ "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]
then
cp $TEMPLATEDIR/hosts-footer-prefixed /tmp/hosts-footer
+ cp "$TEMPLATEDIR/lvs/bind/zonefile-footer-prefixed" /tmp/zonefile-footer
sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" /tmp/hosts-footer
+ sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" /tmp/zonefile-footer
else
cp $TEMPLATEDIR/hosts-footer /tmp
+ cp "$TEMPLATEDIR/lvs/bind/zonefile-footer" /tmp
fi
sed -i "s^Priv_NET^${PRIVATENET}^g" /tmp/hosts-footer
sed -i "s^ClusterDomainName^${CLUSTERDOMAINNAME}^g" /tmp/hosts-footer
+sed -i "s^Priv_NET^${PRIVATENET}^g" /tmp/zonefile-footer
### Start reports output configuration.
echo
ADD_REPORTS_SHARE="1"
REPORTS_NFS_HOSTNAME_IP="${PRIVATENET}.161"
sed -i "9a\\${PRIVATENET}.161\t${REPORTS_NFS_HOSTNAME}.${CLUSTERDOMAINNAME} ${REPORTS_NFS_HOSTNAME}" /tmp/hosts-footer
+ sed -i "9a\\${REPORTS_NFS_HOSTNAME}\tA\t${PRIVATENET}.161" /tmp/zonefile-footer
fi
fi
######## Create Output Tree #########
######## ------------------ #########
-### Prepare global hosts temp file.
+### Prepare global hosts temp file and DNS zone file.
[ -e "$TMPHOSTS" ] && rm -f "$TMPHOSTS"
+[ -e "$TMPZONEFILE" ] && rm -f "$TMPZONEFILE"
[ -e "$TMPOSRFNODES" ] && rm -f "$TMPOSRFNODES"
if [ "$USE_HOSTNAME_PREFIX" = "y" ] || [ "$USE_HOSTNAME_PREFIX" = "Y" ]
then
- cat $TEMPLATEDIR/hosts-header-prefixed > "$TMPHOSTS"
+ cat "$TEMPLATEDIR/hosts-header-prefixed" > "$TMPHOSTS"
+ cat "$TEMPLATEDIR/lvs/bind/zonefile-header-prefixed" > "$TMPZONEFILE"
sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$TMPHOSTS"
+ sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$TMPZONEFILE"
else
cat $TEMPLATEDIR/hosts-header > "$TMPHOSTS"
+ cat "$TEMPLATEDIR/lvs/bind/zonefile-header" > "$TMPZONEFILE"
fi
-### Add lvs servers entry to the global hosts file
+### Add lvs servers entry to the global hosts file and DNS zone file.
NUM=0
for LVS_SERVERS in $MACHINES_LVS_ONLY
do
((NUM++))
#echo "$LVS01_PRIVATE_IP $LVS_SERVERS.${CLUSTERDOMAINNAME} $LVS_SERVERS " >> "$TMPHOSTS"
eval echo "\$LVS0${NUM}_PRIVATE_IP $LVS_SERVERS.${CLUSTERDOMAINNAME} $LVS_SERVERS " >> "$TMPHOSTS"
+ eval echo "$LVS_SERVERS A \$LVS0${NUM}_PRIVATE_IP" >> "$TMPZONEFILE"
done
+
### set the name of the network config file.
NETCFGFILE="$OUTDIR/${CLUSTERDOMAINNAME}_network_config.txt"
eval echo "\$BRICKHOSTNAME${BRICK}-head" > ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hostname
eval echo "\$BRICKHOSTNAME${BRICK}-head" >> $TMPOSRFNODES
eval echo "\$BRICKHOSTNAME${BRICK}_HEAD_IP \$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME} public.\$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME} private.\$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME} \$BRICKHOSTNAME${BRICK}-head" >> $TMPHOSTS
+ eval echo "\$BRICKHOSTNAME${BRICK}-head A \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> $TMPZONEFILE
+ eval echo "public.\$BRICKHOSTNAME${BRICK}-head A \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> $TMPZONEFILE
+ eval echo "private.\$BRICKHOSTNAME${BRICK}-head A \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> $TMPZONEFILE
eval echo "/openils/var/data/offline \$BRICKHOSTNAME${BRICK}_HEAD_IP\(rw,sync,no_subtree_check\)" >> /tmp/exports
eval echo "/storage/reports-output \$BRICKHOSTNAME${BRICK}_HEAD_IP\(ro,sync,no_subtree_check\)" >> /tmp/exports_reporter
printf ")\n" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/openils/conf/.oils_brick.cfg
eval echo "\$BRICKHOSTNAME${BRICK}-head" > ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/etc/hostname
eval echo "\$BRICKHOSTNAME${BRICK}-head" >> $TMPOSRFNODES
eval echo "\$BRICKHOSTNAME${BRICK}_HEAD_IP \$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME} public.\$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME} private.\$BRICKHOSTNAME${BRICK}-head.${CLUSTERDOMAINNAME} \$BRICKHOSTNAME${BRICK}-head" >> $TMPHOSTS
+ eval echo "\$BRICKHOSTNAME${BRICK}-head A \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> $TMPZONEFILE
+ eval echo "public.\$BRICKHOSTNAME${BRICK}-head A \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> $TMPZONEFILE
+ eval echo "private.\$BRICKHOSTNAME${BRICK}-head A \$BRICKHOSTNAME${BRICK}_HEAD_IP" >> $TMPZONEFILE
for DRONE in $(seq $DRONECOUNT)
do
typeset TMPBRICKDRONES="$(eval echo \$BRICKHOSTNAME${BRICK}-head)_drones.txt"
### eval echo "\$BRICKHOSTNAME${BRICK}_DRONE${DRONE}" >> $TMPBRICKDRONES
eval echo -e "\$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}.${CLUSTERDOMAINNAME} \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}" \
>> $TMPHOSTS
+ eval echo -e "\$BRICKHOSTNAME${BRICK}_DRONE${DRONE} A \$BRICKHOSTNAME${BRICK}_DRONE${DRONE}_IP" >> $TMPZONEFILE
done
#echo
printf ")\n" >> ${OUTDIR}/$(eval echo \$BRICKHOSTNAME${BRICK})/$(eval echo \$BRICKHOSTNAME${BRICK})-head/openils/conf/.oils_brick.cfg
echo "done!"
fi
+### Complete DNS zonefile configuration
+cat /tmp/zonefile-footer >> "$TMPZONEFILE"
+sed -i "s^domain.org^$CLUSTERDOMAINNAME^g" "$TMPZONEFILE"
+sed -i "s^Priv_NET^$PRIVATENET^g" "$TMPZONEFILE"
+
+
+
### Add reporter01 to reporter exports share
-### it is not the one exporting reports output
+### if it is not the one exporting reports output
### to the network. (heads)
if [ "${REPORTS_NFS_HOSTNAME}" != "reporter01" ]
cp -f $LVSCONFIGFILE $OUTDIR/$LVS/etc/ha.d
done
-### Setup hosts file for LVS
+### Setup hosts file for LVS and DNS zonefiles on LVS servers.
for LVS_SERVER in $MACHINES_LVS_ONLY
do
cp -f "$TMPHOSTS" "$OUTDIR/$LVS_SERVER/etc/hosts" && sed -i "s^thishost^$LVS_SERVER^g" "$OUTDIR/$LVS_SERVER/etc/hosts"
[ -z $HOSTNAME_PREFIX ] || sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$OUTDIR/$LVS_SERVER/etc/hosts"
[ -z "$HOSTNAME_PREFIX" ] || sed -i "s^${HOSTNAME_PREFIX}-${HOSTNAME_PREFIX}^${HOSTNAME_PREFIX}^g" "$OUTDIR/$LVS_SERVER/etc/hosts"
-
+ mkdir -p "$OUTDIR/$LVS_SERVER/etc/bind"
+ cp -f "$TMPZONEFILE" "$OUTDIR/$LVS_SERVER/etc/bind/${CLUSTERDOMAINNAME}-zone"
+done
+
+### setup named.conf for bind DNS server on LVS servers
+NUM=0
+for LVS_SERVERS in $MACHINES_LVS_ONLY
+ do
+ ((NUM++))
+ if ! echo "$LVS_SERVERS" | grep "lvs01"
+ then
+ cp -f "$TEMPLATEDIR/lvs/bind/named.conf.local-slave" "$OUTDIR/$LVS_SERVERS/etc/bind/named.conf.local"
+ sed -i "s^_LVS01_PRIVATE_IP^$LVS01_PRIVATE_IP^g" "$OUTDIR/$LVS_SERVERS/etc/bind/named.conf.local"
+ else
+ cp -f "$TEMPLATEDIR/lvs/bind/named.conf.local-master" "$OUTDIR/$LVS_SERVERS/etc/bind/named.conf.local"
+ sed -i "s^_LVS02_PRIVATE_IP^$LVS02_PRIVATE_IP^g" "$OUTDIR/$LVS_SERVERS/etc/bind/named.conf.local"
+ fi
+ eval sed -i "s^_MY_IP^\$LVS0${NUM}_PRIVATE_IP^g" "$OUTDIR/$LVS_SERVERS/etc/bind/named.conf.local"
+ sed -i "s^Priv_NET^$PRIVATENET^g" "$OUTDIR/$LVS_SERVERS/etc/bind/named.conf.local"
+ sed -i "s^domain.com^$CLUSTERDOMAINNAME^g" "$OUTDIR/$LVS_SERVERS/etc/bind/named.conf.local"
+
done
+
+# eval echo "\$LVS0${NUM}_PRIVATE_IP
+
#cp -f "$TMPHOSTS" "$OUTDIR/lvs01/etc/hosts" && sed -i "s^thishost^lvs01^g" "$OUTDIR/lvs01/etc/hosts"
#[ -z $HOSTNAME_PREFIX ] && sed -i "s^PREFIX^$HOSTNAME_PREFIX^g" "$OUTDIR/lvs01/etc/hosts"
#cp -f "$TMPHOSTS" "$OUTDIR/lvs02/etc/hosts" && sed -i "s^thishost^lvs02^g" "$OUTDIR/lvs02/etc/hosts"
-Installation Notes:
-===================
+== Installation Via GenaSYS
-LVS failover with Heartbeat:
-For heartbeat to work properly between
-both LVS servers you should have a null-modem serial
-cable connected to functioning serial ports /dev/ttyS1
-between both servers.
+Copyright (C) Georgia Public Library Service
-Library IP based redirction:
+GenaSYS is an Evergreen cluster installation program developed by the Georgia Public Library Service and its contractors.
+
+=== Assumptions
+
+GenaSYS makes the following assumptions about the hardware setup Evergreen is being installed upon:
+
+Network:
+
+* 3 public IP addresses available
+* a DNS-addressable domain name (e.g., "gapines.org")
+
+Hardware (actual or virtual):
+
+* 2 LVS machines
+* 2 or more brick head machines (drone machines are optional)
+* 1 utility server
+* 2 SIP2 servers
+* 2 memcached servers
+* 3 database servers
+* 1 reports server
+* 1 logger server
+* 1 backup server
+* 1 monitoring server
+* 1 administration server
+
+Software:
+
+* base installation of Debian squeeze on each server
+
+=== Usage
+
+==== Custom Files
+
+*Library IP based redirection:*
If you are going be using Library based redirection then
-copy a preconfigured lib_ips.txt file to the custom folder
-before running GenaSYS.sh.
+copy a preconfigured lib_ips.txt
+file to the /home/gpls/GenaSYS-2.1.1/custom folder
+before continuing.
+
+Note: this is the file that allows in-library OPAC stations to default to their location as opposed to all of PINES.
-Zip Codes for libraries:
+*Zip Codes for libraries:*
If you are using mutliple zip codes for libraries copy
-a preconfigured zips.txt file to the custom folder
-before running GenaSYS.sh.
+a preconfigured zips.txt
+file to the /home/gpls/GenaSYS-2.1.1/custom folder
+before continuing.
-Action Trigger Filters:
+Note: this file allows the staff client to automatically populate the city, county, and state fields once the ZIP code is entered in the Evergreen User Editor.
+
+*Action Trigger Filters:*
If you are using customized action trigger filters then copy
-the custom action_trigger_filters.json file to the custom folder
-before running GenaSYS.sh.
+the custom action_trigger_filters.json
+file to the /home/gpls/GenaSYS-2.1.1/custom folder
+before continuing.
+
+Note: this file is required for any custom action/trigger event setups that are configured.
-Custom Maintenance Page:
+*Custom Maintenance Page:*
If you are using a customized maintenance page
-then copy the custom index.html or index.php
-file and any image files .jpg or .png to the custom folder
-before running GenaSYS.sh.
+then copy the custom index.html or index.php
+file and any image files .jpg or .png
+to the /home/gpls/GenaSYS-2.1.1/custom folder
+before continuing.
+
+Note: the maintenance page appears when you detach all bricks from the cluster.
+
+==== Global Configuration
+
+This is where the DNS name for your cluster is entered.
+
+==== SSL Certificate Configuration
+
+An SSL Certificate is required for Evergreen to function correctly.
+If you have purchased a certificate from a CA then please copy
+the certificate files (server.crt, server.key and ca.crt if applicable)
+to /home/gpls/GenaSYS-2.1.1/ssl_cert.
+If you do not have a purchased certificate from a CA, GenaSYS will generate
+a self-signed certificate automatically.
+
+==== Evergreen Brick Configuration
+
+Where you define the number and configuration of [[Application Bricks]]. GenaSYS automatically sets up brick clustering and management scripts.
+
+==== Evergreen Reporter Configuration
+
+This step defines on which server the NFS share for reports outputs resides. The reports process itself is located on reporter01.
+
+==== Evergreen OpenSRF Configuration
+
+This step creates the Linux "opensrf" user, which is used by the system to run all OpenSRF processes, including Apache.
+
+==== Evergreen Database Configuration
+
+This step creates the password for the PostgreSQL "evergreen" user.
+
+==== Evergreen Admin User Configuration
+
+This step creates the Evergreen administrative user, which is able to log into the staff client with these credentials and administer the system from the GUI.
+
+==== Private Network Configuration
+
+Default is 10.0.1.0/24, but can be anything within the private network IP range.
+
+==== LVS Director Configuration
+
+===== Cluster IP Address
+
+The public IP address for the cluster will be used for LVS Director and Heartbeat. This address is the "virtual" address and will be *shared* between two LVS machines in the cluster. Enter the public IP address for the cluster, its netmask and its gateway address.
+
+===== LVS Physical Ethernet Interface Configuration
+
+The LVS servers must have a physical public addresses assigned to each server independent of the shared address entered above. Enter the public IP addresses for lvs01 and lvs02
+
+==== GenaSYS Configuration Summary
+
+You will then be shown a summary of the configuration options that you've chosen as they are entered into the genasys.conf file. If any values need correcting, you can start over by selecting (R)etry.
+
+==== GenaSYS Cluster Creation
+
+Messages will appear on the screen as the files are processed.
+
+
+==== Human-Readable Summary and Installation Instructions
+
+After the files are processed and packaged, you will be shown a summary of the full cluster configuration, including installation instructions. This information will be stored in a file named [cluster name]_network_config.txt. As it contains the entered passwords in clear text, you will want to secure this file.\
+
+Copy the setup tar.gz files one at a time to the respective nodes in the cluster, extract and run the installation and reboot each one before starting on the next one. Install in the order listed below.
+
+. lvs
+. logger
+. db
+. brick01-head
+. other-bricks
+. reporter
+. utility
+. sip
+
+
+
iface lo inet loopback
# The primary network interface
-allow-hotplug eth0
+auto eth0
iface eth0 inet static
address Priv_IP
netmask 255.255.255.0
gateway Priv_NET.1
# dns-* options are implemented by the resolvconf package, if installed
+ dns-servers Cluster_Private_IP LVS01_Private_IP LVS02_Private_IP
+ dns-search CLUSTER_DOMAINNAME
--- /dev/null
+//
+// Do any local configuration here
+//
+
+// Consider adding the 1918 zones here, if they are not used in your
+// organization
+//include "/etc/bind/zones.rfc1918";
+
+zone "domain.com" {
+ type master;
+ file "/etc/bind/domain.com-zone";
+ // allow-update { key "rndc-key"; Priv_NET.0/24; };
+ allow-transfer {
+ 127.0.0.1;
+ _MY_IP;
+ _LVS02_PRIVATE_IP;
+ };
+ notify yes;
+ };
--- /dev/null
+//
+// Do any local configuration here
+//
+
+// Consider adding the 1918 zones here, if they are not used in your
+// organization
+//include "/etc/bind/zones.rfc1918";
+
+zone "domain.com" {
+ type slave;
+ masters { _LVS01_PRIVATE_IP; };
+ file "/etc/bind/domain.com-zone";
+ // allow-update { key "rndc-key"; Priv_NET.0/24; };
+ allow-transfer {
+ 127.0.0.1;
+ _MY_IP;
+ };
+ notify yes;
+ };
--- /dev/null
+db01 A Priv_NET.101
+db02 A Priv_NET.102
+db03 A Priv_NET.103
+utility01 A Priv_NET.111
+public.utility01 A Priv_NET.111
+private.utility01 A Priv_NET.111
+logger01 A Priv_NET.121
+sip01 A Priv_NET.131
+public.sip01 A Priv_NET.131
+private.sip01 A Priv_NET.131
+sip02 A Priv_NET.132
+public.sip02 A Priv_NET.132
+private.sip02 A Priv_NET.132
+reporter01 A Priv_NET.141
+memcache01 A Priv_NET.151
+memcache02 A Priv_NET.152
+backup01 A Priv_NET.171
+monitor01 A Priv_NET.201
+admin01 A Priv_NET.211
--- /dev/null
+PREFIX-db01 A Priv_NET.101
+PREFIX-db02 A Priv_NET.102
+PREFIX-db03 A Priv_NET.103
+PREFIX-utility01 A Priv_NET.111
+PREFIX-public.utility01 A Priv_NET.111
+PREFIX-private.utility01 A Priv_NET.111
+PREFIX-logger01 A Priv_NET.121
+PREFIX-sip01 A Priv_NET.131
+PREFIX-public.sip01 A Priv_NET.131
+PREFIX-private.sip01 A Priv_NET.131
+PREFIX-sip02 A Priv_NET.132
+PREFIX-public.sip02 A Priv_NET.132
+PREFIX-private.sip02 A Priv_NET.132
+PREFIX-reporter01 A Priv_NET.141
+PREFIX-memcache01 A Priv_NET.151
+PREFIX-memcache02 A Priv_NET.152
+PREFIX-backup01 A Priv_NET.171
+PREFIX-monitor01 A Priv_NET.201
+PREFIX-admin01 A Priv_NET.211
--- /dev/null
+$ORIGIN .
+$TTL 38400 ; 10 hours 40 minutes
+domain.org IN SOA host.domain.org. root.domain.org. (
+ 1172935440 ; serial
+ 10800 ; refresh (3 hours)
+ 3600 ; retry (1 hour)
+ 604800 ; expire (1 week)
+ 38400 ; minimum (10 hours 40 minutes)
+ )
+ NS lvs01.domain.org.
+ NS lvs02.domain.org.
+ A Priv_NET.1
+ MX 5 lvs01.domain.org.
+ MX 7 lvs02.domain.org.
+$ORIGIN domain.org.
+
+
--- /dev/null
+$ORIGIN .
+$TTL 38400 ; 10 hours 40 minutes
+domain.org IN SOA PREFIX-lvshost.domain.org. root.domain.org. (
+ 1172935440 ; serial
+ 10800 ; refresh (3 hours)
+ 3600 ; retry (1 hour)
+ 604800 ; expire (1 week)
+ 38400 ; minimum (10 hours 40 minutes)
+ )
+ NS PREFIX-lvs01.domain.org.
+ NS PREFIX-lvs02.domain.org.
+ A Priv_NET.1
+ MX 5 PREFIX-lvs01.domain.org.
+ MX 7 PREFIX-lvs02.domain.org.
+$ORIGIN domain.org.
+
+
iface lo inet loopback
# The primary network interface
-allow-hotplug eth0
+auto eth1
iface eth0 inet static
name Public Address
address Pub_IP
netmask Pub_NETMASK
gateway Pub_GATEWAY
# dns-* options are implemented by the resolvconf package, if installed
+ dns-servers Cluster_Private_IP LVS01_Private_IP LVS02_Private_IP
+ dns-search CLUSTER_DOMAINNAME
-#auto eth0:0
-iface eth0:0 inet static
+auto eth1:0
+iface eth1:0 inet static
name LVS Public Shared Address
address Cluster_Public_IP
netmask Pub_NETMASK
-auto eth1
-iface eth1 inet static
+auto eth0
+iface eth0 inet static
name Private Address
address Priv_Physical_Address
netmask 255.255.255.0
-#auto eth1:0
-iface eth1:0 inet static
+auto eth0:0
+iface eth0:0 inet static
name LVS Private Shared Address
address Priv_NET.1
netmask 255.255.255.0