IBM Support

How to change hostname+ipaddress in purescale environment

Technical Blog Post


Abstract

How to change hostname+ipaddress in purescale environment

Body

I am sharing the experience of how to change hostname+ipaddress in existing purescale environment with db2iupdt -drop/-add options.

The current existing environment is as followings:

-----------------------------------------------------------------------------------------------------

db2sdin1@ps101:~> db2instance -list
ID        TYPE             STATE                HOME_HOST               CURRENT_HOST            ALERT   PARTITION_NUMBER        LOGICAL_PORT   NETNAME
--        ----             -----                ---------               ------------            -----   ----------------        ------------   -------
0       MEMBER           STARTED                    ps101                      ps101               NO                  0                   0     ps101
1       MEMBER           STARTED                    ps102                      ps102               NO                  0                   0     ps102
128     CF               PRIMARY                    ps103                      ps103               NO                  -                   0     ps103
129     CF               CATCHUP                    ps104                      ps104               NO                  -                   0     ps104

HOSTNAME                   STATE                INSTANCE_STOPPED        ALERT
--------                   -----                ----------------        -----
   ps104                  ACTIVE                              NO           NO
   ps103                  ACTIVE                              NO           NO
   ps102                  ACTIVE                              NO           NO
   ps101                  ACTIVE                              NO           NO

 

And the entries in /etc/hosts:

192.168.1.151   ps101.home ps101

192.168.1.152   ps102.home ps102
192.168.1.153   ps103.home ps103
192.168.1.154   ps104.home ps104

----------------------------------------------------------------------------------------------------------

The request is to change ps102-->ps105 and 192.168.1.152--> 192.168.1.155

To achieve this, would use following steps

1) stop the instance in purescale

db2sdin1@ps101:~> db2stop force
04/04/2017 13:21:22     0   0   SQL1064N  DB2STOP processing was successful.
04/04/2017 13:21:28     1   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.

 

2) With root user, run db2iupdt to drop member 1 from purescale environment

ps101:/opt/ibm/db2/V10.5/instance # ./db2iupdt -drop -m ps102 db2sdin1
 

3) Check purescale environment again

db2sdin1@ps101:/tmp> db2start
04/04/2017 14:01:30     0   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.


db2sdin1@ps103:/tmp> db2instance -list
ID        TYPE             STATE                HOME_HOST               CURRENT_HOST            ALERT   PARTITION_NUMBER        LOGICAL_PORT   NETNAME
--        ----             -----                ---------               ------------            -----   ----------------        ------------   -------
0       MEMBER           STARTED                    ps101                      ps101               NO                  0                   0     ps101
128     CF               PRIMARY                    ps103                      ps103               NO                  -                   0     ps103
129     CF               CATCHUP                    ps104                      ps104               NO                  -                   0     ps104

HOSTNAME                   STATE                INSTANCE_STOPPED        ALERT
--------                   -----                ----------------        -----
   ps104                  ACTIVE                              NO           NO
   ps103                  ACTIVE                              NO           NO
   ps101                  ACTIVE                              NO           NO

db2sdin1@ps101:~> db2stop force
04/04/2017 14:13:07     0   0   SQL1064N  DB2STOP processing was successful.
SQL1064N  DB2STOP processing was successful.

 

Here, we can see, ps102 is removed from purescale environment

 

4) Use OS command to change hostname+ipaddress, and after finished, make sure the entries in /etc/hosts are also manually changed on all the hosts in purescale

192.168.1.151   ps101.home ps101
192.168.1.153   ps103.home ps103
192.168.1.154   ps104.home ps104
192.168.1.155   ps105.home ps105

 

5) Make sure SSH work well between ps105 and all other hosts

 

6) Use db2iupdt to add ps105 into the existing purescale environment

ps101:/opt/ibm/db2/V10.5/instance # ./db2iupdt -add -m ps105 -mnet ps105 -mid 1 db2sdin1

 

7) Start db2 instance again to check is ps105 is added into purescale environment

db2sdin1@ps105:~> db2start
04/04/2017 15:00:55     0   0   SQL1063N  DB2START processing was successful.
04/04/2017 15:00:57     1   0   SQL1063N  DB2START processing was successful.
SQL1063N  DB2START processing was successful.


db2sdin1@ps105:~> db2instance -list
ID        TYPE             STATE                HOME_HOST               CURRENT_HOST            ALERT   PARTITION_NUMBER        LOGICAL_PORT   NETNAME
--        ----             -----                ---------               ------------            -----   ----------------        ------------   -------
0       MEMBER           STARTED                    ps101                      ps101               NO                  0                   0     ps101
1       MEMBER           STARTED                    ps105                      ps105               NO                  0                   0     ps105
128     CF               PRIMARY                    ps103                      ps103               NO                  -                   0     ps103
129     CF               CATCHUP                    ps104                      ps104               NO                  -                   0     ps104

HOSTNAME                   STATE                INSTANCE_STOPPED        ALERT
--------                   -----                ----------------        -----
   ps105                  ACTIVE                              NO           NO
   ps104                  ACTIVE                              NO           NO
   ps103                  ACTIVE                              NO           NO
   ps101                  ACTIVE                              NO           NO

 

Hope it helps!

 

 

[{"Business Unit":{"code":"BU029","label":"Data and AI"}, "Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11140586