Wednesday, 19 September 2018

Aide Memoire - Auto-starting DB2 on RHEL 7

More fun with DB2 auto-starting on Linux: -

/opt/ibm/db2/V11.1/bin/db2level 

DB21085I  This instance or install (instance name, where applicable: 
"db2inst1") uses "64" bits and DB2 code release "SQL11012" with level 
identifier "0203010F".
Informational tokens are "DB2 v11.1.2.2", "s1706091900", "DYN1701310100AMD64", 
and Fix Pack "2".
Product is installed at "/opt/ibm/db2/V11.1".


cat /etc/redhat-release 

Red Hat Enterprise Linux Server release 7.5 (Maipo)

So the instances were not auto-starting …

I checked all of the following: -

As db2inst1

db2set DB2AUTOSTART=YES

db2greg -getinstrec instancename="db2inst1"

Retrieved record:
   Service      = |DB2|
   Version      = |11.1.2.2|
   InstanceName = |db2inst1|
   InstancePath = |/home/db2inst1/sqllib|
   Usage        = |N/A|
   StartAtBoot  = 1
   Maintenance  = 0
   InstallPath  = |/opt/ibm/db2/V11.1|
   RemoteProf   = |N/A|
   Comment      = |N/A|




As db2inst2

db2set DB2AUTOSTART=YES

db2greg -getinstrec instancename="db2inst2"

Retrieved record:
   Service      = |DB2|
   Version      = |11.1.2.2|
   InstanceName = |db2inst2|
   InstancePath = |/home/db2inst2/sqllib|
   Usage        = |N/A|
   StartAtBoot  = 1
   Maintenance  = 0
   InstallPath  = |/opt/ibm/db2/V11.1|
   RemoteProf   = |N/A|
   Comment      = |N/A|


As root

cat /etc/systemd/system/db2fmcd.service 

# DB2 fault monitor 
# Starts fmcd
# Note: any customizations to this file will be lost the next time this is updated

[Unit]
Description=DB2 v11.1.2.2

[Service]
ExecStart=/opt/ibm/db2/V11.1/bin/db2fmcd
Restart=always

[Install]
WantedBy=default.target

ls -al /opt/ibm/db2/V11.1/bin/db2fmcd

-r-xr-xr-x. 1 bin bin 176288 Sep 17 13:18 /opt/ibm/db2/V11.1/bin/db2fmcd

/opt/ibm/db2/V11.1/instance/db2iset -i db2inst1 -all

[i] DB2COMM=TCPIP
[i] DB2AUTOSTART=YES
[g] DB2SYSTEM=lt.uk.ibm.com
[g] DB2ADMINSERVER=dasusr1


/opt/ibm/db2/V11.1/instance/db2iset -i db2inst2 -all

[i] DB2COMM=TCPIP
[i] DB2AUTOSTART=YES
[g] DB2SYSTEM=lt.uk.ibm.com
[g] DB2ADMINSERVER=dasusr1


systemctl |grep -i db2

db2fmcd.service                                                    loaded active running   DB2 v11.1.2.2

ps -ef | grep db2fm

root        793      1  0 10:34 ?        00:00:00 /opt/ibm/db2/V11.1/bin/db2fmcd
dasusr1    1540      1  0 10:35 ?        00:00:00 /opt/ibm/db2/V11.1/das/bin/db2fmd -i dasusr1 -m /opt/ibm/db2/V11.1/das/lib/libdb2dasgcf.so.1


/opt/ibm/db2/V11.1/bin/db2fm -i db2inst1 -U
/opt/ibm/db2/V11.1/bin/db2fm -i db2inst1 -u

/opt/ibm/db2/V11.1/bin/db2fm -i db2inst2 -U
/opt/ibm/db2/V11.1/bin/db2fm -i db2inst2 -u


/opt/ibm/db2/V11.1/bin/db2fm -i db2inst1 -s

Gcf module '/opt/ibm/db2/V11.1/lib64/libdb2gcf.so' is INSTALLED PROPERLY but NOT ALIVE

/opt/ibm/db2/V11.1/bin/db2fm -i db2inst2 -s

Gcf module '/opt/ibm/db2/V11.1/lib64/libdb2gcf.so' is INSTALLED PROPERLY but NOT ALIVE

/opt/ibm/db2/V11.1/bin/db2fm -i db2inst1 -S

Gcf module 'fault monitor' is NOT operable

/opt/ibm/db2/V11.1/bin/db2fm -i db2inst2 -S

Gcf module 'fault monitor' is NOT operable

Finally …..

The following appeared to resolve things: -

/opt/ibm/db2/V11.1/bin/db2fm -i db2inst1 -f on

/opt/ibm/db2/V11.1/bin/db2fm -i db2inst2 -f on

in that both DB2 instances ( and thus the listeners ) now start on reboot :-) 

Yay!

No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...