WAS v8.5 > Set up the application serving environment > Configure port settingsUpdate ports in existing profiles
Use the updatePorts.ant script to change ports in an installed profile.
The updatePorts.ant script for application server profiles is in the directory...
app_server_root/profileTemplates/template_name/actions
To use the script, identify which profile to update.
Only run this script if the profile is unfederated and if the configuration is the same structure as it was when the profile was created.
Assign nonconflicting ports to the AppSrv01 profile
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.
- Create the Java properties file encoded in ISO8859-1 file encoding, to assign nonconflicting port values to the application server profile.
For this example, assume the system is a Linux operating system and that you create the following /TMP/was_props/appserver.props properties file.
WAS_HOME=/opt/IBM/WebSphere/AppServer
was.install.root=/opt/IBM/WebSphere/AppServer
profileName=AppSrv01
profilePath=/opt/IBM/WebSphere/AppServer/profiles/AppSrv01
templatePath=/opt/IBM/WebSphere/AppServer/profileTemplates/default
nodeName=appserver_node01
cellName=appserver_cell01
hostName=myserver.ibm.com
- Run...
cd /opt/IBM/WebSphere/AppServer/bin
./ws_ant.sh -propertyfile /TMP/was_props/appserver.props -file /opt/IBM/WebSphere/AppServer/profileTemplates/default/actions/updatePorts.ant
- Open the dmgr console and view the changed port assignments.
To view the port assignments, click...
Servers | Application servers | server_name | [Communications] Ports
- Run the script again and view the ports. Are they the same as before?
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.
Assign default ports to the AppSrv02 profile
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.
- Create the Java properties file encoded in ISO8859-1 file encoding, to assign default port values to the application server profile.
For this example, assume the system is a Windows operating system and that you create the following C:\temp\was_props\appserver.props properties file.
WAS_HOME="C:/IBM/WebSphere/AppServer"
was.install.root="C:/IBM/WebSphere/AppServer"
profileName=AppSrv02
profilePath="C:/IBM/WebSphere/AppServer/profiles/AppSrv02"
templatePath="C:/IBM/WebSphere/AppServer/profileTemplates/default"
nodeName=appserver_node02
cellName=appserver_cell02
hostName=myserver2.ibm.com
defaultPorts=trueUse double quotation marks around a Windows path name with spaces. Do not use quotation marks around the path name if there are no spaces in the path.
cd "C:\Program Files\IBM\WebSphere\AppServer\bin"
ws_ant.bat -propertyfile C:\temp\was_props\appserver.props -file "C:\IBM\WebSphere\AppServer\profileTemplates\default\actions\updatePorts.ant"- To view the port assignments, click Servers > Application servers > server_name > [Communications] Ports.
- Run the script again and view the ports. Are they the same as before?
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 file...
C:\IBM\WebSphere\AppServer\profiles\AppSrv02\config\cells\appserver_cell02\nodes\appserver_node02\serverindex.xml
Issue the netstat -a command to see all ports in use on the machine.
Assign ports starting at 2050 to the AppSrv03 profile
The ANT script assigns nonconflicting ports by default. The startingPort=2050 special argument is needed. Identify the fully qualified directory paths, profile name, unique node name, and unique cell name. Then issue the command.
- Create the Java properties file encoded in ISO8859-1 file encoding, to assign default port values to the application server profile.
For this example, assume the system is an AIX operating system and that you create the following /usr/tmp/was_props/appserver.props properties file.
WAS_HOME=/usr/IBM/WebSphere/AppServer
was.install.root=/usr/IBM/WebSphere/AppServer
profileName=AppSrv03
profilePath=/usr/IBM/WebSphere/AppServer/profiles/AppSrv03"
templatePath=/usr/IBM/WebSphere/AppServer/profileTemplates/default"
nodeName=appserver_node03
cellName=appserver_cell03
hostName=myserver3.ibm.com
startingPort=2050
- Run...
cd /usr/IBM/WebSphere/AppServer/bin
./ws_ant.sh -propertyfile /usr/tmp/was_props/appserver.props -file /usr/IBM/WebSphere/AppServer/profileTemplates/default/actions/updatePorts.ant
- Open the dmgr console and view the changed port assignments.
Servers | Application servers | server_name | [Communications] Ports
- Run the script again and view the ports. Are they the same as before?
After using the -startingPort option, the resulting dynamically assigned port values are not the same each time because the ANT script assigns nonconflicting port values starting from the startingPort number (port 2050 in this case). This method resolves conflicting port assignments.
Use a port definition property file to assign ports to the AppSrv04 profile. The ANT script assigns nonconflicting ports by default. The portsFile=/opt/was/portdefs.our_appsrv_ex.props special argument is needed. Identify the fully qualified directory paths, profile name, unique node name, and unique cell name. Then issue the command.
- Create the Java properties file encoded in ISO8859-1 file encoding, to assign nonconflicting port values to the application server profile.
Assume that you create the following /opt/was/portdefs.our_appsrv_ex.props properties file:
WC_defaulthost=19080
WC_adminhost=19060
WC_defaulthost_secure=19443
WC_adminhost_secure=19043
BOOTSTRAP_ADDRESS=22809
SOAP_CONNECTOR_ADDRESS=28880
IPC_CONNECTOR_ADDRESS=9633
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=45061The ports used in the port definition property file should reflect the template type.
The ports in this example are for the default template type, and they might vary for other template types. The management template has three different portdef.props files, one for each servertype.
They are adminagent.portdef.props, dmgr.portdef.props and jmgr.portdef.props. They can be modelled after the portdef.props file found in the template directory.
Assume that you create the following /TMP/was_props/appserver.props properties file:
WAS_HOME=/opt/IBM/WebSphere/AppServer
was.install.root=/opt/IBM/WebSphere/AppServer
profileName=AppSrv04
profilePath=/opt/IBM/WebSphere/AppServer/profiles/AppSrv04
templatePath=/opt/IBM/WebSphere/AppServer/profileTemplates/default
nodeName=appserver_node04
cellName=appserver_cell04
hostName=myserver4.ibm.com
portsFile=/opt/was/portdefs.our_appsrv_ex.props
- Run...
cd /opt/IBM/WebSphere/AppServer/bin
./ws_ant.sh -propertyfile /TMP/was_props/appserver.props -file /opt/IBM/WebSphere/AppServer/profileTemplates/default/actions/updatePorts.ant
- To view the port assignments, click...
Servers | Application servers | server_name | [Communications] Ports
- Run the script again and view the ports. Are they the same as before?
The resulting assigned port values are from a props file. Therefore, the values do not change. This method does not resolve conflicting port assignments.
Results
This procedure results in four different methods of port assignments with the updatePorts.ant script.