Set port numbers kept in the serverindex.xml file using scripting
Overview
Before starting this task, the wsadmin tool must be running.
The end points of the serverindex.xml file are part of different objects in the configuration.
Use the following attributes to modify the end point information of the end point attributes for a process:
Procedure
- BOOTSTRAP_ADDRESS of server1 process
An attribute of the NameServer object that exists inside the server. It is used by the naming client to specify the naming server to look up the initial context. Use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort server1 {-nodeName mynode -endPointName BOOTSTRAP_ADDRESS -host myhost -port 2810}
- Use Jython:
AdminTask.modifyServerPort ('server1', '[-nodeName mynode -endPointName BOOTSTRAP_ADDRESS -host myhost -port 2810]')
- Use the AdminConfig object. To modify its end point, obtain the ID of the NameServer object and issue a modify command.
Use Jacl:
set s [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
set ns [$AdminConfig list NameServer $s]
$AdminConfig modify $ns {{BOOTSTRAP_ADDRESS {{port 2810} {host myhost}}}}
- Use Jython:
s = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
ns = AdminConfig.list('NameServer', s)
AdminConfig.modify(ns, [['BOOTSTRAP_ADDRESS', [['host', 'myhost'], ['port', 2810]]]])
- SOAP_CONNECTOR-ADDRESS of server1 process
An attribute of the SOAPConnector object that exists inside the server. It is the port that is used by HTTP transport for incoming SOAP requests. Use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort server1 {-nodeName mynode -endPointName SOAP_CONNECTOR_ADDRESS -host myhost -port 8881}
- Use Jython:
AdminTask.modifyServerPort ('server1', '[-nodeName mynode -endPointName SOAP_CONNECTOR_ADDRESS -host myhost -port 8881]')
- Use the AdminConfig object. To modify its end point, obtain the ID of the SOAPConnector object and issue a modify command...
Use Jacl:
set s [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
set soap [$AdminConfig list SOAPConnector $s]
$AdminConfig modify $soap {{SOAP_CONNECTOR_ADDRESS {{host myhost} {port 8881}}}}
- Use Jython:
s = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
soap = AdminConfig.list('SOAPConnector', s)
AdminConfig.modify(soap, [['SOAP_CONNECTOR_ADDRESS', [['host', 'myhost'], ['port', 8881]]]])
- DRS_CLIENT_ADDRESS of server1 process
An attribute of the SystemMessageServer object that exists inside the server. It is the port used to configure the Data Replication Service (DRS) which is a JMS-based message broker system for dynamic caching. The DRS_CLIENT_ADDRESS attribute is not available if a replication domain and a replicator entry have not been added to the server. Use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort server1 {-nodeName mynode -endPointName DRS_CLIENT_ADDRESS -host myhost -port 7874}
- Use Jython:
AdminTask.modifyServerPort ('server1', '[-nodeName mynode -endPointName DRS_CLIENT_ADDRESS -host myhost -port 7874]')
- Use the AdminConfig object. To modify the end point of the DRS_CLIENT_ADDRESS attribute, obtain the ID of the SystemMessageServer object and issue a modify command, for example:
Use Jacl:
set s [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
set sms [$AdminConfig list SystemMessageServer $s]
$AdminConfig modify $sms {{DRS_CLIENT_ADDRESS {{host myhost} {port 7874}}}}
- Use Jython:
s = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
sms = AdminConfig.list('SystemMessageServer', s)
AdminConfig.modify(sms, [['DRS_CLIENT_ADDRESS', [['host', 'myhost'], ['port', 7874]]]])
- JMSSERVER_QUEUED_ADDRESS and JMSSERVER_DIRECT_ADDRESS of server1 process
An attribute of the JMSServer object that exists inside the server. These are ports used to configure the WebSphere Application Server JMS provider topic connection factory settings. Use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$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 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 end point, obtain the ID of the JMSServer object and issue a modify command...
Use Jacl:
set s [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
set jmss [$AdminConfig list JMSServer $s]
$AdminConfig modify $jmss {{JMSSERVER_QUEUED_ADDRESS {{host myhost} {port 5560}}}}
$AdminConfig modify $jmss {{JMSSERVER_DIRECT_ADDRESS {{host myhost} {port 5561}}}}
- Use Jython:
s = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/')
jmss = AdminConfig.list('JMSServer', s)
AdminConfig.modify(jmss, [['JMSSERVER_QUEUED_ADDRESS', [['host', 'myhost'], ['port', 5560]]]])
AdminConfig.modify(jmss, [['JMSSERVER_DIRECT_ADDRESS', [['host', 'myhost'], ['port', 5561]]]])
- NODE_DISCOVERY_ADDRESS of nodeagent process An attribute of the NodeAgent object that exists inside the server. It is the port used to receive the incoming process discovery messages inside a node agent process. Use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort nodeagent {-nodeName mynode -endPointName NODE_DISCOVERY_ADDRESS -host myhost -port 7272}
- Use Jython:
AdminTask.modifyServerPort ('nodeagent', '[-nodeName mynode -endPointName NODE_DISCOVERY_ADDRESS -host myhost -port 7272]')
- Use the AdminConfig object. To modify its end point, obtain the ID of the NodeAgent object and issue a modify command...
Use Jacl:
set nodeAgentServer [$AdminConfig getid /Cell:mycell/Node:mynode/Server:nodeagent/] set nodeAgent [$AdminConfig list NodeAgent $nodeAgentServer]
$AdminConfig modify $nodeAgent {{NODE_DISCOVERY_ADDRESS {{host myhost} {port 7272}}}}
- Use Jython:
nodeAgentServer = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:nodeagent/') nodeAgent = AdminConfig.list('NodeAgent', nodeAgentServer)
AdminConfig.modify(nodeAgent, [['NODE_DISCOVERY_ADDRESS', [['host', 'myhost'], ['port', 7272]]]])
Use Jacl:
set nodeAgentServer [$AdminConfig getid /Cell:mycell/Node:mynode/Server:nodeagent/]
set nodeAgent [$AdminConfig list NodeAgent $nodeAgentServer]
$AdminConfig modify $nodeAgent {{NODE_DISCOVERY_ADDRESS {{host myhost} {port 7272}}}}
- Use Jython:
nodeAgentServer = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:nodeagent/') nodeAgent = AdminConfig.list('NodeAgent', nodeAgentServer)
AdminConfig.modify(nodeAgent, [['NODE_DISCOVERY_ADDRESS', [['host', 'myhost'], ['port', 7272]]]])
- CELL_DISCOVERY_ADDRESS of dmgr process An attribute of the deploymentManager object that exists inside the server. It is the port used to receive the incoming process discovery messages inside a deployment manager process. Use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort dmgr {-nodeName managernode -endPointName CELL_MULTICAST_DISCOVERY_ADDRESS -host myhost -port 7272}$AdminTask modifyServerPort dmgr {-nodeName managernode -endPointName CELL_DISCOVERY_ADDRESS -host myhost -port 7278}
- Use Jython:
AdminTask.modifyServerPort ('dmgr', '[-nodeName managernode -endPointName CELL_MULTICAST_DISCOVERY_ADDRESS -host myhost -port 7272]')AdminTask.modifyServerPort ('dmgr', '[-nodeName managernode -endPointName CELL_DISCOVERY_ADDRESS -host myhost -port 7278]')
- Use the AdminConfig object. To modify its end point, obtain the ID of the deploymentManager object and issue a modify command...
Use Jacl:
set netmgr [$AdminConfig getid /Cell:mycell/Node:managernode/Server:dmgr/]
set deploymentManager [$AdminConfig list CellManager $netmgr]
$AdminConfig modify $deploymentManager {{CELL_MULTICAST_DISCOVERY_ADDRESS {{host myhost} {port 7272}}}}
$AdminConfig modify $deploymentManager {{CELL_DISCOVERY_ADDRESS {{host myhost} {port 7278}}}}
- Use Jython:
netmgr = AdminConfig.getid('/Cell:mycell/Node:managernode/Server:dmgr/')
deploymentManager = AdminConfig.list('CellManager', netmgr)
AdminConfig.modify(deploymentManager, [['CELL_MULTICAST_DISCOVERY_ADDRESS', [['host', 'myhost'], ['port', 7272]]]])
AdminConfig.modify(deploymentManager, [['CELL_DISCOVERY_ADDRESS', [['host', 'myhost'], ['port', 7278]]]])
- WC_defaulthost of server1 process To modify a WC_defaulthost end point use one of the following examples:
- Use the AdminConfig object:
Use Jacl:
set serverName server1 set node [$AdminConfig getid /Node:myNode/] set serverEntries [$AdminConfig list ServerEntry $node] foreach serverEntry $serverEntries { set sName [$AdminConfig showAttribute $serverEntry serverName] if {$sName == $serverName} { set specialEndPoints [lindex [$AdminConfig showAttribute $serverEntry specialEndpoints] 0] foreach specialEndPoint $specialEndPoints { set endPointNm [$AdminConfig showAttribute $specialEndPoint endPointName] if {$endPointNm == "WC_defaulthost"} { set ePoint [$AdminConfig showAttribute $specialEndPoint endPoint] $AdminConfig modify $ePoint [list [list host myhost] [list port 5555]] break } } } }
- Use Jython:
serverName = "server1" node = AdminConfig.getid('/Node:myNode/') serverEntries = AdminConfig.list('ServerEntry', node).split(java.lang.System.getProperty('line.separator')) for serverEntry in serverEntries: sName = AdminConfig.showAttribute(serverEntry, "serverName") if sName == serverName: sepString = AdminConfig.showAttribute(serverEntry, "specialEndpoints") sepList = sepString[1:len(sepString)-1].split(" ") for specialEndPoint in sepList: endPointNm = AdminConfig.showAttribute(specialEndPoint, "endPointName") if endPointNm == "WC_defaulthost": ePoint = AdminConfig.showAttribute(specialEndPoint, "endPoint") AdminConfig.modify(ePoint, [["host", "myhost"], ["port", 5555]]) break
- WC_defaulthost_secure of server1 process To modify a WC_defaulthost_secure end point use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort server1 {-nodeName myNode -endPointName WC_defaulthost_secure -host myhost -port 5544}
- Use Jython:
AdminTask.modifyServerPort ('server1', '[-nodeName myNode -endPointName WC_defaulthost_secure -host myhost -port 5544]')
- Use the AdminConfig object:
Use Jacl:
set serverName server1 set node [$AdminConfig getid /Node:myNode/] set serverEntries [$AdminConfig list ServerEntry $node] foreach serverEntry $serverEntries { set sName [$AdminConfig showAttribute $serverEntry serverName] if {$sName == $serverName} { set specialEndPoints [lindex [$AdminConfig showAttribute $serverEntry specialEndpoints] 0] foreach specialEndPoint $specialEndPoints { set endPointNm [$AdminConfig showAttribute $specialEndPoint endPointName] if {$endPointNm == "WC_defaulthost_secure"} { set ePoint [$AdminConfig showAttribute $specialEndPoint endPoint] $AdminConfig modify $ePoint [list [list host myhost] [list port 5544]] break } } } }
- Use Jython:
serverName = "server1" node = AdminConfig.getid('/Node:myNode/') serverEntries = AdminConfig.list('ServerEntry', node).split(java.lang.System.getProperty('line.separator')) for serverEntry in serverEntries: sName = AdminConfig.showAttribute(serverEntry, "serverName") if sName == serverName: sepString = AdminConfig.showAttribute(serverEntry, "specialEndpoints") sepList = sepString[1:len(sepString)-1].split(" ") for specialEndPoint in sepList: endPointNm = AdminConfig.showAttribute(specialEndPoint, "endPointName") if endPointNm == "WC_defaulthost_secure": ePoint = AdminConfig.showAttribute(specialEndPoint, "endPoint") AdminConfig.modify(ePoint, [["host", "myhost"], ["port", 5544]]) break
WC_adminhost of server1 process To modify a WC_adminhost end point use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort server1 {-nodeName myNode -endPointName WC_adminhost -host myhost -port 6666}
- Use Jython:
AdminTask.modifyServerPort ('server1', '[-nodeName myNode -endPointName WC_adminhost -host myhost -port 6666]')
Use the AdminConfig object:
Use Jacl:
set serverName server1 set node [$AdminConfig getid /Node:myNode/] set serverEntries [$AdminConfig list ServerEntry $node] foreach serverEntry $serverEntries { set sName [$AdminConfig showAttribute $serverEntry serverName] if {$sName == $serverName} { set specialEndPoints [lindex [$AdminConfig showAttribute $serverEntry specialEndpoints] 0] foreach specialEndPoint $specialEndPoints { set endPointNm [$AdminConfig showAttribute $specialEndPoint endPointName] if {$endPointNm == "WC_adminhost"} { set ePoint [$AdminConfig showAttribute $specialEndPoint endPoint] $AdminConfig modify $ePoint [list [list host myhost] [list port 6666]] break } } } }
Use Jython: serverName = "server1" node = AdminConfig.getid('/Node:myNode/') serverEntries = AdminConfig.list('ServerEntry', node).split(java.lang.System.getProperty('line.separator')) for serverEntry in serverEntries: sName = AdminConfig.showAttribute(serverEntry, "serverName") if sName == serverName: sepString = AdminConfig.showAttribute(serverEntry, "specialEndpoints") sepList = sepString[1:len(sepString)-1].split(" ") for specialEndPoint in sepList: endPointNm = AdminConfig.showAttribute(specialEndPoint, "endPointName") if endPointNm == "WC_adminhost": ePoint = AdminConfig.showAttribute(specialEndPoint, "endPoint") AdminConfig.modify(ePoint, [["host", "myhost"], ["port", 6666]]) break
WC_adminhost_secure of server1 process To modify a WC_adminhost_secure end point use one of the following examples:
- Use the AdminTask object:
Use Jacl:
$AdminTask modifyServerPort server1 {-nodeName myNode -endPointName WC_adminhost_secure -host myhost -port 5566}
- Use Jython:
AdminTask.modifyServerPort ('server1', '[-nodeName myNode -endPointName WC_adminhost_secure -host myhost -port 5566]')
Use the AdminConfig object:
Use Jacl:
set serverName server1 set node [$AdminConfig getid /Node:myNode/] set serverEntries [$AdminConfig list ServerEntry $node] foreach serverEntry $serverEntries { set sName [$AdminConfig showAttribute $serverEntry serverName] if {$sName == $serverName} { set specialEndPoints [lindex [$AdminConfig showAttribute $serverEntry specialEndpoints] 0] foreach specialEndPoint $specialEndPoints { set endPointNm [$AdminConfig showAttribute $specialEndPoint endPointName] if {$endPointNm == "WC_adminhost_secure"} { set ePoint [$AdminConfig showAttribute $specialEndPoint endPoint] $AdminConfig modify $ePoint [list [list host myhost] [list port 5566]] break } } } }
Use Jython: serverName = "server1" node = AdminConfig.getid('/Node:myNode/') serverEntries = AdminConfig.list('ServerEntry', node).split(java.lang.System.getProperty('line.separator')) for serverEntry in serverEntries: sName = AdminConfig.showAttribute(serverEntry, "serverName") if sName == serverName: sepString = AdminConfig.showAttribute(serverEntry, "specialEndpoints") sepList = sepString[1:len(sepString)-1].split(" ") for specialEndPoint in sepList: endPointNm = AdminConfig.showAttribute(specialEndPoint, "endPointName") if endPointNm == "WC_adminhost_secure": ePoint = AdminConfig.showAttribute(specialEndPoint, "endPoint") AdminConfig.modify(ePoint, [["host", "myhost"], ["port", 5566]]) break
Save the configuration changes.
In a network deployment environment only, synchronize the node.
Use the AdminConfig object for scripted administration
Related Reference
Commands for the AdminConfig object