Before you begin
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.
Avoid trouble: You should 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. For example, this
script is ideal for changing ports for an unfederated application
server profile after you created the profile but before you altered
its configuration. For all other situations, use the techniques described
in the topic "Setting port numbers to the serverindex.xml file using
scripting".
gotcha
- Assign
nonconflicting ports to profile myprofile.
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 CCSID 819 (ASCII), to assign nonconflicting port values
to the application server profile.
For this example,
assume that you create the following /TMP/was_props/appserver.props properties
file.
WAS_HOME=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
profileName=myprofile
profilePath=/QIBM/UserData/WebSphere/AppServer/V8/<edition>/profiles/myprofile
templatePath=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default
nodeName=MYISERIES_myprofile
cellName=MYISERIES_myprofile
hostName=MYISERIES.mycompany.com
- Start a Qshell session
STRQSH
- Change
directories to the app_server_root/bin directory.
cd /QIBM/ProdData/WebSphere/AppServer/V8/<edition>/bin
- Issue the command.
ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default/actions/updatePorts.ant
- Open the administrative
console and view the changed
port assignments.
To view the port assignments, click Servers >
Server Types > WebSphere application servers > server1 >
[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 CCSID 819 (ASCII), to assign default port values to
the application server profile.
For this example, assume
that you create the following /TMP/was_props/appserver.props properties
file.
WAS_HOME=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
profileName=AppSrv02
profilePath=/QIBM/UserData/WebSphere/AppServer/V8/<edition>/profiles/AppSvr02
templatePath=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default
nodeName=MYISERIES_AppSvr02
cellName=MYISERIES_AppSvr02
hostName=MYISERIES.mycompany.com
defaultPorts=true
- Start a Qshell session
STRQSH
- Change
directories to the app_server_root/bin directory.
cd /QIBM/ProdData/WebSphere/AppServer/V8/<edition>/bin
- Issue the command.
ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default/actions/updatePorts.ant
- Open the administrative
console and view the changed
port assignments.
To view the port assignments, click Servers >
Server Types > WebSphere application servers > server1 >
[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 \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.
- Assign ports starting at 20050 to the AppSrv03 profile.
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.
- Create the Java properties
file encoded in CCSID 819 (ASCII), to assign default port values to
the application server profile.
For this example, assume
that you create the following /TMP/was_props/appserver.props properties
file.
WAS_HOME=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
profileName=AppSrv03
profilePath=/QIBM/UserData/WebSphere/AppServer/V8/<edition>/profiles/AppSvr03
templatePath=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default
nodeName=MYISERIES_AppSvr03
cellName=MYISERIES_AppSvr03
hostName=MYISERIES.mycompany.com
startingPort=20050
- Start a Qshell session
STRQSH
- Change
directories to the app_server_root/bin directory.
cd /QIBM/ProdData/WebSphere/AppServer/V8/<edition>/bin
- Issue the command.
ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default/actions/updatePorts.ant
- Open the administrative
console and view the changed
port assignments.
To view the port assignments, click Servers >
Server Types > WebSphere application servers > server1 >
[Communications] > Ports.
-
Run the script again and view the ports. Are they the
same as before?
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).
- Use a port definition
property file to assign
ports to the AppSrv04 profile.
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.
- Create the Java properties
file encoded in CCSID 819 (ASCII), to assign nonconflicting port values
to the application server profile.
Assume that you create
the following
/TMP/was_props/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
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
Note: The 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. 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=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
was.install.root=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>
profileName=AppSrv04
profilePath=/QIBM/UserData/WebSphere/AppServer/V8/<edition>/profiles/AppSvr04
templatePath=/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default
nodeName=MYISERIES_AppSvr04
cellName=MYISERIES_AppSvr04
hostName=MYISERIES.mycompany.com
portsFile=/TMP/was_props/portdefs.our_appsrv_ex.props
- Start a Qshell session
STRQSH
- Change
directories to the app_server_root/bin directory.
cd /QIBM/ProdData/WebSphere/AppServer/V8/<edition>/bin
(Or,
if the product is installed to a non-default directory, change directories
to the <install_root_directory>/bin directory.)
- Issue the command.
ws_ant -propertyfile /TMP/was_props/appserver.props -file
/QIBM/ProdData/WebSphere/AppServer/V8/<edition>/profileTemplates/default/actions/updatePorts.ant
- Open the administrative
console and view the changed
port assignments.
To view the port assignments, click Servers >
Server Types > WebSphere application servers > server1 >
[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.