Set port numbers to the serverindex.xml file using scripting


Use wsadmin to modify the port numbers specified in the serverindex.xml file. The endpoints of the serverindex.xml file are part of different objects in the configuration.

There are multiple ways to complete this task. Complete the steps in this task to use the AdminConfig and AdminTask objects to configure ports in the environment. Alternatively, we can use the scripts in the AdminServerManagement script library to configure various ports in the configuration.

Before modifying ports using scripting, launch wsadmin.

 

  • Jython...

    AdminTask.modifyServerPort ('server1', '[-nodeName mynode -endPointName JMSSERVER_QUEUED_ADDRESS -host myhost -port 5560]')

    AdminTask.modifyServerPort ('server1', '[-nodeName mynode -endPointName JMSSERVER_DIRECT_ADDRESS -host myhost -port 5561]')

  • Use the AdminConfig object. To modify its endpoint, obtain the ID of the JMSServer object and issue a modify command, for example:

  • Modify the NODE_DISCOVERY_ADDRESS attribute of node agent process. The NODE_DISCOVERY_ADDRESS attribute is an attribute of the NodeAgent object that exists inside the server. The system uses this port to receive the incoming process discovery messages inside a node agent process.

    The following examples modify the NODE_DISCOVERY_ADDRESS attribute:

  • Modify the CELL_DISCOVERY_ADDRESS attribute of dmgr process.

    The CELL_DISCOVERY_ADDRESS attribute is an attribute of the deploymentManager object that exists inside the server. The system uses this port to receive the incoming process discovery messages inside a dmgr process. Use the following examples modify the CELL_DISCOVERY_ADDRESS attribute:

  • Modify the WC_defaulthost attribute of the server1 process.

    Use the following examples modify WC_defaulthost endpoint:

  • Modify the WC_defaulthost_secure attribute of the server1 process. Use the following examples to modify a WC_defaulthost_secure endpoint:

  • Modify the WC_adminhost attribute of the server1 process.

    To modify a WC_adminhost endpoint, use one of the following examples:

  • Modify the WC_adminhost_secure attribute of server1 process.

    To modify a WC_adminhost_secure endpoint, use one of the following examples:

     

    What to do next

    Save the configuration changes...

    AdminConfig.save()

    Use the syncActiveNode or syncNode scripts in the AdminNodeManagement script library to propagate the configuration changes to node or nodes.

     

    Related tasks


    Set port settings
    Use the AdminConfig object for scripted administration

     

    Related


    Ports settings
    Server settings configuration scripts
    Commands for the AdminConfig object