Tuesday, June 1, 2010

Changing cell names, node names, host names

how to change cell names, node names, and host names for a given WebSphere Application Server environment. It usually starts by someone asking me what configuration files they need to change when they want to update this information, and is followed by their surprise when I tell them none. The reason I say that is because it’s time consuming, hard, and unnecessary for you to figure this out. Instead, you can use three simple wsadmin commands. I’ll give you an example of those here (all written in Jython).

To change the cell name for a given environment, use the following wsadmin command:

AdminTask.renameCell(‘[-newCellName -regenCerts ]‘)

This updates your configuration with the new cell name you specify and will optionally regenerate the certificates in that environment.

To change the name of a given node, use the following wsadmin command:

AdminTask.renameNode(‘[-nodeName -newNodeName ]‘)

This updates the name of the node specified by the nodeName parameter to the name specified by the newNodeName parameter.

To change the host name for a given node, use the following wsadmin command:

AdminTask.changeHostName(‘[-nodeName -hostName ]‘)

This updates the host name for the node specified in the nodeName parameter to the value specified in the hostName parameter.

These commands update all of the necessary WAS configuration, but do keep in mind they do not update any shell or batch files in the environment. This means you need to update the setupCmdLine script included in your WAS installation, and you obviously need to update any of your custom scripts that have hard coded values for cell, node, and host names.