Asponte Labs > Blog Detail

Web Content Viewer- Asponte Custom Skin

Actions

Changing Hostname for a system running a Portal 8.5 cluster

  • Created By: Ryan Mullett
  • Updated: October 28, 2016

I recently came across the need to change a hostname on a system running its own self-contained Portal 8.5 cluster (dmgr/db2/portal). When initially looking at changing the hostname it can seem like quite a daunting task since there are a good amount of steps required and the hostname itself must be changed while specific components are started and others are stopped and before/after specific steps have been completed. This guide will provide a solid base of exactly what needs to be done on a Linux system in order to change a hostname on a system running its own dmgr/db2/portal 8.5 instances.

I have actually turned much of this process into my own script in order to simplify the process and ensure I do not have to go through the process manually in the future, not everything can be included however most of the process can be automated quite simply. To keep this simple I will have everything numbered as a list. In this particular case I am running CentOS 7 on the target system which should only matter for several commands, the rest will be the same across all Linux systems. All commands should be run with sudo/root privileges unless otherwise specified.

1) Ensure DMGR is started
2) Navigate to /bin and run ./wsadmin.sh -user -password -lang jython
>AdminConfig.list('ServerIndex') - will show locations of all serverindex.xml files
>AdminConfig.show('(cells/dmgrCell01/nodes/dmgrNode01|serverindex.xml#ServerIndex_1)','hostName') - cells....should be output from previous for the profile you want to modify hostname on
>AdminConfig.modify('(cells/dmgrCell01/nodes/dmgrNode01|serverindex.xml#ServerIndex_1)', "[[hostName new.hostname]]")  - note the crazy formatting here, a lot of brackets, etc. so make sure you get it right
>AdminConfig.save()
>AdminConfig.show('(cells/dmgrCell01/nodes/dmgrNode01|serverindex.xml#ServerIndex_1)','hostName') - check hostname again to confirm it is updated
>exit

3) Shutdown DMGR
4) Stop DB2 admin server as the database admin user with the following command - db2admin stop
5) Stop DB2 instances as the instance owner - db2stop
6) Change the hostname on the system itself - in CentOS I normally run hostnamectl set-hostname
7) Update /etc/hosts to reflect the new hostname
8) Go to /sqllib/ and edit db2nodes.cfg to remove and insert   - db2instance home directory is usually the home directory of the instance owner on the system
9) Run db2start as the DB2 instance owner
10) As root run the following command to source the db2 profile, please note the space between the . and the / here - . //sqllib/db2profile
11) Now we need to update the DB2SYSTEM registry variable with the following - db2set -g DB2SYSTEM=
12) To confirm this took effect run the following command to check the "DB2SYSTEM" variable - db2set -all | grep g
13) Start the DMGR
14) Login to DMGR and navigate to Environment -> WebSphere Variables
15) Edit the WCM_HOST variable value to reflect your new hostname
16) On the WebSphere Portal node we now need to edit some of the wkplc.properties files, these can be found in /ConfigEngine/properties/
17) Within wkplc.properties we need to update any instances of the old hostname to the new hostname
18) Within wkplc_dbdomain.properties we also need to modify all instances of the old hostname to reflect the new hostname
19) In order to make sure than any scheduled tasks to not have the old hostname cached we will need to run a ConfigEngine task
20) /ConfigEngine/ConfigEngine.sh action-clean-scheduled-tasks -DWasAdminId=user -DWasPassword=password -DPortalAdminUser=user -DPortalAdminPwd=password
If this ConfigEngine task shows Build Failed check the logs and resolve the issue prior to rerunning the task. (In my case I did not have the dbpassword filled out in wkplc_dbdomain.properties)
21) Start the Portal Node and do a full resynchronize in DMGR from System Administration>Node Agents
22) Start the Portal server and ensure it starts correctly and is accessible!

Complementary Content
${loading}