Update ports in an existing profile

 

+

Search Tips   |   Advanced Search

 

 

Overview

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 appserver profiles is in...

app_server_root/profileTemplates/template_name/actions

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.

Look at steps for all of the operating systems mentioned. The differences are mainly in the extension of the script file and the direction of the directory delimiters. For example, Linux shell scripts (*.sh) and other commands require a ./ before the command to tell the operating system that the command is in the current working directory.

 

Assign nonconflicting ports to the AppSrv01 profile.

The ANT script assigns nonconflicting ports by default. No special arguments are needed. Identify...

Then issue the command.

  1. Create the Java properties file encoded in ISO-8895-1 file encoding, to assign nonconflicting port values to the appserver profile.

    For this example, assume that the system is a Linux operating system and that you create the following properties file...

    /tmp/appserver.props

     WAS_HOME=/opt/IBM/WAS/AppServer  was.install.root=/opt/IBM/WAS/AppServer profileName=AppSrv01 profilePath=/opt/IBM/WAS/AppServer/profiles/AppSrv01 templatePath=/opt/IBM/WAS/AppServer/profileTemplates/default nodeName=appserver_node01 cellName=appserver_cell01 hostName=myserver.ibm.com
    
    

  2. Open a command shell window.

  3. Change directories to...

    app_server_root/AppServer/bin

  4. Issue the command.

    ./ws_ant.sh -propertyfile /tmp/appserver.props -file /IBM/WAS7/AppServer/profileTemplates/default/actions/updatePorts.ant

    ws_ant.bat -propertyfile c:\tmp\appserver.props -file c:\IBM/WAS7\AppServer\profileTemplates\default\actions\updatePorts.ant

  5. Open the console and view the changed port assignments.

    To view the port assignments, click...

    Servers | Application servers | server_name | [Communications] Ports

  6. 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.

  1. Create the Java properties file encoded in ISO-8895-1 file encoding, to assign default port values to the appserver profile.

    For this example, assume that the system is a Windows operating system and that you create the following properties file...

    C:\temp\was_props\appserver.props

    ...which contains...

    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=true

    Use 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.

  2. Open a DOS command window.

  3. Change directories to...

    cd app_server_root/bin

  4. Issue the command.

     ws_ant.bat -propertyfile C:\temp\was_props\appserver.props 
               -file C:\IBM\WebSphere\AppServer\profileTemplates\default\actions\updatePorts.ant
    
    

  5. Open the console and view the changed port assignments.

    To view the port assignments, click...

    Servers | Application servers | server_name | [Communications] Ports

  6. 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.

 

For AIX, 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.

  1. Create the Java properties file encoded in ISO-8895-1 file encoding, to assign default port values to the appserver profile.

    For this example, assume that 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/WAS/AppServer  was.install.root=/usr/IBM/WAS/AppServer profileName=AppSrv03 profilePath=/usr/IBM/WAS/AppServer/profiles/AppSrv03" templatePath=/usr/IBM/WAS/AppServer/profileTemplates/default" nodeName=appserver_node03 cellName=appserver_cell03 hostName=myserver3.ibm.com startingPort=2050
    
    

  2. Open a command shell window.

  3. Change directories to the /usr/IBM/WAS/AppServer/bin directory.

    cd /usr/IBM/WAS/AppServer/bin
    
    (Or, if the product is installed to a non-default directory, change directories to the app_server_root/bin directory.)

  4. Issue the command.

    ./ws_ant.sh -propertyfile /usr/tmp/was_props/appserver.props \
                -file /usr/IBM/WAS/AppServer/profileTemplates/default/actions/updatePorts.ant
    
    

  5. Open the console and view the changed port assignments.

    To view the port assignments, click...

    Servers | Application servers | server_name | [Communications] Ports

  6. 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.

  • [HP-UX] [Solaris] 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.

    1. Create the Java properties file encoded in ISO-8895-1 file encoding, to assign nonconflicting port values to the appserver 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
      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
      

      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=/opt/IBM/WAS/AppServer  was.install.root=/opt/IBM/WAS/AppServer profileName=AppSrv04 profilePath=/opt/IBM/WAS/AppServer/profiles/AppSrv04 templatePath=/opt/IBM/WAS/AppServer/profileTemplates/default nodeName=appserver_node04 cellName=appserver_cell04 hostName=myserver4.ibm.com portsFile=/opt/was/portdefs.our_appsrv_ex.props
      
      

    2. Open a command shell window.

    3. Change directories to the /opt/IBM/WAS/AppServer/bin directory.

      cd /opt/IBM/WAS/AppServer/bin
      
      (Or, if the product is installed to a non-default directory, change directories to the app_server_root/bin directory.)

    4. Issue the command.

      ./ws_ant.sh -propertyfile /tmp/was_props/appserver.props \
                  -file /opt/IBM/WAS/AppServer/profileTemplates/default/actions/updatePorts.ant
      
      

    5. Open the console and view the changed port assignments.

      To view the port assignments, click Servers > Application servers > server_name > [Communications] Ports.

    6. 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.

     

    What to do next

    You can change port values in a variety of ways. The install command and the silent installation response file also support setting port values in the same manner as described in this article. In fact, the two installation methods use the same options:

    • -OPT PROF_defaultPorts=

      No value is required. The equal sign is a standardization misnomer.

    • -OPT PROF_startingPort="nnnn"

    • -OPT PROF_portsFile="path_to_portsdef.props file"

    • If you omit one of the preceding arguments when calling the install command or leave one of the preceding arguments out of your silent response file, the default action is to assign nonconflicting port values.

    The use of the exact same options for a graphical user interface installation and a silent installation is no coincidence. Most WAS component installation programs are implementations of the Common Install Engine for WAS. The use of the exact same actions for the ANT script is also because of the same pervading design theme, which is to simplify your installation experience.



    Port number settings in WAS versions
    install command
    responsefile.nd.txt