Use the updatePorts.ant script to change ports in an installed profile.
Each profile template has its own updatePorts.ant script.
The updatePorts.ant script for application server profiles is in the app_server_root/profileTemplates/template_name/actions directory. To use the script, you have to identify which profile to update.
Use the following procedure to become familiar with using the updatePorts.ant script. Each step is an exercise that results in reassigning ports using a particular method that the updatePorts.ant script supports.
The ANT script assigns nonconflicting ports by default. No special arguments are needed. Identify the fully qualified directory paths, profile name, unique node name, and unique cell name. Then issue the command.
For this example, assume that you create the following /TMP/was_props/appserver.props properties file.
WAS_HOME=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
profileName=myprofile
profilePath=/QIBM/UserData/WebSphere/AppServer/V85/<edition>/profiles/myprofile
templatePath=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default
nodeName=MYISERIES_myprofile
cellName=MYISERIES_myprofile
hostName=MYISERIES.mycompany.com
STRQSH
cd /QIBM/ProdData/WebSphere/AppServer/V85/<edition>/bin
ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default/actions/updatePorts.ant
To view the port assignments, click Servers > Server Types > WebSphere application servers > server1 > [Communications] > Ports.
The resulting dynamically assigned port values apply to all of the ports currently assigned to the AppSrv01 profile, for every server listed in the serverindex.xml file for the profile node name. Each port receives a new nonconflicting value. None of the old port value assignments are used because the port values are in use at the time of the new assignment.
The ANT script assigns nonconflicting ports by default. The defaultPorts=true special argument is needed. Identify the fully qualified directory paths, profile name, unique node name, and unique cell name. Then issue the command.
For this example, assume that you create the following /TMP/was_props/appserver.props properties file.
WAS_HOME=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
profileName=AppSrv02
profilePath=/QIBM/UserData/WebSphere/AppServer/V85/<edition>/profiles/AppSvr02
templatePath=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default
nodeName=MYISERIES_AppSvr02
cellName=MYISERIES_AppSvr02
hostName=MYISERIES.mycompany.com
defaultPorts=true
STRQSH
cd /QIBM/ProdData/WebSphere/AppServer/V85/<edition>/bin
ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default/actions/updatePorts.ant
To view the port assignments, click Servers > Server Types > WebSphere application servers > server1 > [Communications] > Ports.
The resulting assigned port values are the same each time because the values are the default values. This method does not resolve conflicting port assignments. To view all port assignments for a profile, see the \serverindex.xml file. for your profile. Issue the netstat *cnn command from the IBM® i command line to see all ports in use on the machine.
On IBM i, the ANT script assigns ports starting at 20050 and does not attempt to determine port conflicts. The startingPort=20050 argument is needed. Identify the fully qualified directory paths, profile name, unique node name, and unique cell name. Then issue the command.
For this example, assume that you create the following /TMP/was_props/appserver.props properties file.
WAS_HOME=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
profileName=AppSrv03
profilePath=/QIBM/UserData/WebSphere/AppServer/V85/<edition>/profiles/AppSvr03
templatePath=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default
nodeName=MYISERIES_AppSvr03
cellName=MYISERIES_AppSvr03
hostName=MYISERIES.mycompany.com
startingPort=20050
STRQSH
cd /QIBM/ProdData/WebSphere/AppServer/V85/<edition>/bin
ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default/actions/updatePorts.ant
To view the port assignments, click Servers > Server Types > WebSphere application servers > server1 > [Communications] > Ports.
After using the -startingPort option, the resulting port values are the same each time because the ANT script assigns port values starting from the startingPort number (port 20050 in this case).
The portsFile=/opt/was/portdefs.our_appsrv_ex.props special argument allows you to assign specific ports for your profile. Port conflict resolution is not done for the specified ports. Identify the fully qualified directory paths, profile name, unique node name, and unique cell name. Then issue the command.
WC_defaulthost=19080
WC_adminhost=19060
WC_defaulthost_secure=19443
WC_adminhost_secure=19043
BOOTSTRAP_ADDRESS=22809
SOAP_CONNECTOR_ADDRESS=28880
SAS_SSL_SERVERAUTH_LISTENER_ADDRESS=29401
CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS=29403
CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS=29402
ORB_LISTENER_ADDRESS=39100
DCS_UNICAST_ADDRESS=39353
SIB_ENDPOINT_ADDRESS=37276
SIB_ENDPOINT_SECURE_ADDRESS=37286
SIB_MQ_ENDPOINT_ADDRESS=45558
SIB_MQ_ENDPOINT_SECURE_ADDRESS=45578
SIP_DEFAULTHOST=45060
SIP_DEFAULTHOST_SECURE=45061
Assume that you create the following /TMP/was_props/appserver.props properties file:
WAS_HOME=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>
profileName=AppSrv04
profilePath=/QIBM/UserData/WebSphere/AppServer/V85/<edition>/profiles/AppSvr04
templatePath=/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default
nodeName=MYISERIES_AppSvr04
cellName=MYISERIES_AppSvr04
hostName=MYISERIES.mycompany.com
portsFile=/TMP/was_props/portdefs.our_appsrv_ex.props
STRQSH
cd /QIBM/ProdData/WebSphere/AppServer/V85/<edition>/bin
(Or,
if the product is installed to a non-default directory, change directories
to the <install_root_directory>/bin directory.)ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V85/<edition>/profileTemplates/default/actions/updatePorts.ant
To view the port assignments, click Servers > Server Types > WebSphere application servers > server1 > [Communications] > Ports.
The resulting assigned port values are from a props file. Therefore, the values do not change. This method does not resolve conflicting port assignments.
This procedure results in four different methods of port assignments with the updatePorts.ant script.
Start or restart your server to use the new ports.