Websphere : How to change HOSTNAME using ws_ant scripts

Posted By Sagar Patil

Today I have a new_server which I need to build to my websphere old_server.  The first thing to do is rename Hostname from old_server to new_server. Here is a script I used  to just do that.

Download “Configuration management scripts for V6 ConfigScripts.zip” from  http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html

Sample exportImport.xml attached here http://www.oracledbasupport.co.uk/wp-content/uploads/2010/08/exportImport.xml

[websphere@new_server config_management]$ /opt/IBM/WebSphere/AppServer/bin/ws_ant.sh -profileName dmgr -buildfile exportImport.xml -DstartManager=yes -DoldHostName=old_server -DnewHostName=new_server change  HostName
Buildfile: exportImport.xml

checkRelease:
[wsadmin] WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
[wsadmin] Executing ValidateRelease.jacl script
[wsadmin] List of Node is new_server_Manager(cells/old_server_Cell/nodes/old_server_Manager|node.xml#Node_1)
[wsadmin] old_server_Node01(cells/old_server_Cell/nodes/old_server_Node01|node.xml#Node_1)

checkNewHost:
checkOldHost:

changeHostName:
[echo] Was Home is /opt/IBM/WebSphere/AppServer
[echo] User Install Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr
[echo] Config Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/config
[echo] Cell name is old_server_Cell
[echo] Node name is old_server_Manager

changeServerIndexConfig:
[echo] Modifying serverindex.xml from old_server to new_server

changeHNServerConfig:
[echo] Modifying server.xml from old_server to new_server

changeWsadminProp:
[echo] Modifying wsadmin.properties from old_server to new_server

startManager:

doStartManager:
[exec] ADMU0116I: Tool information is being logged in file
[exec]            /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/logs/dmgr/startServer.log
[exec] ADMU0128I: Starting tool with the dmgr profile
[exec] ADMU3100I: Reading configuration for server: dmgr
[exec] ADMU3200I: Server launched. Waiting for initialization status.
[exec] ADMU3000I: Server dmgr open for e-business; process id is 22554

BUILD SUCCESSFUL
Total time: 28 seconds
[websphere@new_server config_management]$ ps -ef | grep java

Now let’s connect to the new DMGR using URL  https://new_node:9043/ibm/console/ . I could connect successfully with username /pwd as of old_server

Leave a Reply

You must be logged in to post a comment.

2 Responses to “ WebSphere Security: Switch off username/password prompt while shutting down services ”

  1. Encrypt Websphere password for startServer.sh and stopServer.sh

    The soap.client.props file is located at Dmgr as well as Node directories under clustered environment

    vi /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/properties/soap.client.props
    vi /opt/IBM/WebSphere/AppServer/profiles/Profile01/Node/properties/soap.client.props
    fill in entries for ‘com.ibm.SOAP.loginUserid’ and ‘com.ibm.SOAP.loginPassword’.

    Run Command :
    PropFilePasswordEncoder.sh soap.client.props com.ibm.SOAP.loginPassword

    [was61@properties]$ /opt/IBM/WebSphere/AppServer/profiles/Profile01/Node/bin/PropFilePasswordEncoder.sh /opt/IBM/WebSphere/AppServer/profiles/Profile01/Node/properties/soap.client.props com.ibm.SOAP.loginPassword
    Create a backup file of the original properties file which contains unencoded passwords? (y/n)
    y
    NOTE: Backup file /opt/IBM/WebSphere/AppServer/profiles/Profile01/Node/properties/soap.client.props.bak contains unencoded passwords

    I can see files :
    soap.client.props.bak : Plain Passwords
    soap.client.props : Encrypted Passwords

    vi soap.client.props updated with encrypted password :
    com.ibm.SOAP.loginUserid=user1
    com.ibm.SOAP.loginPassword={xor}KCw+OzI2MQ==

    vi soap.client.props.bak:
    com.ibm.SOAP.loginUserid=user1
    com.ibm.SOAP.loginPassword=password1

  2. In the very first line it was startManager.sh that was triggered.Not after this attempt it was triggered again,per your content.Why so ?Also,what is the need to run startManager.sh while we have “startServer.sh Dmgr ” ?

Top of Page

Top menu