-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ini
executable file
·130 lines (105 loc) · 6.27 KB
/
config.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
##########################################################
## Must set area ! Only thing you need to configure manually in most cases
##########################################################
# Set virtual IP address to use. It should an unused IP within the same subnet and set. If not specified, script will try to get a random free IP address
VIP="123.123.123.123" ## Virtual IP address to use. Again !! please change this with an appropriate one. Otherwise, it will skip creating VIP resource.
##########################################################
##### Optional changes if you like
##########################################################
INST_USER=db2inst1 # change the instance user if necessary
DBNAME=sample # dbname
PORT=60000 # change the port if necessary.
REMOTE_INST=db2inst1
HADR_PORT=61000 # change the HADR port if necessary
USERPW="passw0rd" # initial user password to set
##########################################################
##### Potentially need to change. See the explanation below.
##########################################################
# hostname lists : Important !!. See if you need to change or not.
# Set up host name lists based on the expected /etc/hsots entries when creating clusters on fyre.
# Let's say /etc/hosts has the following entries on all hosts.
#10.11.24.174 jspmtest1.fyre.ibm.com jspmtest1
#10.11.24.240 jspmtest2.fyre.ibm.com jspmtest2
#10.11.25.36 jspmtest3.fyre.ibm.com jspmtest3
#
# This logic sets values from real hostname and based on /etc/hosts. I expect there are 3 hostnames usually.
#hostname_convention=`hostname -s | tr -d '1'` # Get the short hostname of the headnode, then rmove trailing '1', then it becomes like 'pstest' <== this is bug, removing all '1'
hostname_convention=`hostname -s | sed 's/1$//'` # Get the short hostname of the headnode, then rmove trailing '1', then it becomes like 'pstest'
headhost=`hostname` # current 1st host
ALLHOST=`grep $hostname_convention /etc/hosts |grep -v "^#" |awk '{print $2;}'`
# host names except the current 1st host. This is mainly for doing something for other hosts only such as copying installation image.
HOST_OTHER=`grep $hostname_convention /etc/hosts |grep -v "^#" |awk '{print $2;}'|grep -v $headhost` ## Things to do against hosts except the 1st host
lasthost=`grep $hostname_convention /etc/hosts |grep -v "^#" |awk '{print $2;}' |sort -k 1 | tail -n 1` # last host to use as quorum host
db2hosts=`grep $hostname_convention /etc/hosts |grep -v "^#" |awk '{print $2;}'|grep -v $lasthost` #hostnames except the last host. For doing things for db2 hosts only
secondhost=`grep $hostname_convention /etc/hosts |grep -v "^#" |awk '{print $2;}'|grep -v $lasthost |grep -v $headhost` # if 3 hosts, this would be 2nd host.
#### Change the following lines as yours (Use short hostname by 'hostname -s' output from each host .
##### long host name may not matter. Preferred to use short hostname with db2cm command. ######
SSH_NO_BANNER="-q -o LogLevel=QUIET -o StrictHostKeyChecking=no"
PRIMARY_HOST=`ssh $SSH_NO_BANNER $headhost hostname -s`
STANDBY_HOST=`ssh $SSH_NO_BANNER $secondhost hostname -s`
QUORUM_HOST=`ssh $SSH_NO_BANNER $lasthost hostname -s`
# Or you may set the following lines manally and uncomment. (example)
#ALLHOST="jspmtest1.fyre.ibm.com jspmtest2.fyre.ibm.com jspmtest3.fyre.ibm.com"
#HOST_OTHER="jspmtest2.fyre.ibm.com jspmtest3.fyre.ibm.com"
#headhost="jspmtest1.fyre.ibm.com"
#lasthost="jspmtest3.fyre.ibm.com"
#db2hosts="jspmtest1.fyre.ibm.com jspmtest2.fyre.ibm.com"
#secondhost="jspmtest2.fyre.ibm.com"
#PRIMARY_HOST="jspmtest1"
#STANDBY_HOST="jspmtest2"
#QUORUM_HOST="jspmtest3"
###############
# number of hosts in the cluster
NUM_HOST=`echo $ALLHOST |wc -w` # this should be 3 usually. Exit if not.
if [ "$NUM_HOST" -ne 3 ]; then
echo "The number of hosts is not 3. I expect 2 DB2 hosts and 1 quorum host for this repo. Sorry!! Exiting..."
exit 1
fi
## Jun Su's web server for Db2 image download
DB2_IMAGE_DOWNLOAD_SERVER=jun1.fyre.ibm.com ## Jun Su's web server for Db2 image download
DB2_IMAGE_PATH_ON_SERVER="db2_image"
## By default, this repo uses 11.5.8.0, if you want other version, uncomment and comment the lines accordingly.
#However, check the compatibility with your OS level by yourself.
###################################
## DB2 version to install and path
###################################
V1156_IMAGE="v11.5.6_linuxx64_server_dec.tar.gz" # for v11.5.6.0
V1157_IMAGE="v11.5.7_linuxx64_server_dec.tar.gz" # for v11.5.7.0
V1158_IMAGE="v11.5.8_linuxx64_server_dec.tar.gz" # for v11.5.8.0
V1159_IMAGE="v11.5.9_linuxx64_server_dec.tar.gz" # for v11.5.9.0
V1156_INSTALL_PATH="/opt/ibm/db2/v1156" # for v11.5.6.0
V1157_INSTALL_PATH="/opt/ibm/db2/v1157" # for v11.5.7.0
V1158_INSTALL_PATH="/opt/ibm/db2/v1158" # for v11.5.8.0
V1159_INSTALL_PATH="/opt/ibm/db2/v1159" # for v11.5.8.0
#DB2_INSTALL_PATH="/opt/ibm/db2/V11.5_mod9" # for v11.5.9.0
## At the moment, only considering Redhat 7.9 and 8.8
if [ -f /etc/os-release ]; then
. /etc/os-release
if [[ "$ID" == "rhel" && "$VERSION_ID" == "7.9" ]]; then ## default v11.5.8 for Redhat 7.9
echo "$ID $VERSION_ID is not supported for . Exiting ... "
exit 1
elif [[ "$ID" == "rhel" && "$VERSION_ID" == "8.8" ]]; then ## ## default v11.5.8 for Redhat 8.8
DB2_IMAGE_FILE_NAME=$V1158_IMAGE
DB2_INSTALL_PATH=$V1158_INSTALL_PATH
elif [[ "$ID" == "rhel" && "$VERSION_ID" == "8.10" ]]; then ## ## default v11.5.8 for Redhat 8.8
DB2_IMAGE_FILE_NAME=$V1159_IMAGE
DB2_INSTALL_PATH=$V1159_INSTALL_PATH
else
echo "The current OS or version is not compatible for this script or not tested yet. Exiting ... "
exit 1
fi
else
echo "The current OS or version is not compatible for this script. Exiting ... "
exit 1
fi
## By default, it selects 11.5.8.0, if you want other version, uncomment and comment the lines accordingly.
#DB2_IMAGE_FILE_NAME=$V1159_IMAGE # for v11.5.9.0
#DB2_INSTALL_PATH=$V1159_INSTALL_PATH # for v11.5.9.0
## License file. Pacemaker is availablke for V11.5 only. So we only need license since V11.5
DB2115LICPATH="db2lic/v115lic"
DB2115LIC="db2aese_c.lic"
## default
DB2LICPATH=$DB2115LICPATH
DB2LIC=$DB2115LIC
############
PRODUCT_LOGFILE=hadr_pacemaker.log.$$