3 Managing Nodes Using NMShell Command-Line Components

You can manage Oracle Communications Offline Mediation Controller nodes by using NMShell command-line components.

Topics in this document:

Logging Into NMShell

To log into the NMShell application:

  1. Start the Offline Mediation Controller Administration Server and Node Manager daemons.

    1. Go to the OMC_home/bin directory, where OMC_home is the directory in which you installed Offline Mediation Controller.

    2. Start the Administration Server daemon:

      ./adminsvr
    3. Start the Node Manager daemon:

      ./nodemgr
  2. Go to the OMC_home/bin/tools directory, and then enter the following command:

    ./NMShell

    The prompt changes to nmsh>.

  3. Enter the following command:

    login server_hostname port

    where:

    • server_hostname is the IP address or host name of the computer on which Administration Server is running.

    • port is the Administration Server port number.

  4. When prompted, enter your username and password.

    NMShell is connected to Administration Server.

You can now enter NMShell commands to start nodes, stop nodes, add node routes, and so on.

Starting Nodes

You can use NMShell to start all nodes in a mediation host, all nodes for a specific Node Manager, or a specific node. To do so, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort

    where adminSvrHost is the host name or IP address of the computer on which Administration Server is installed, and adminSvrPort is the port number for Administration Server.

  2. Enter one of these commands depending on which nodes you want to start.

    • To start all nodes in the currently running mediation host:

      startNodes
    • To start all nodes managed by a specific Node Manager:

      startNode -ip mediation_hostname -p port 

      where mediation_hostname is the mediation host's IP address or host name, and port is the mediation host port number.

    • To start a specific node:

      startNode node_id_1 node_id_2...

Stopping Nodes

You can use NMShell to stop all nodes in the currently running mediation host, all nodes for a specific mediation host, or a specific node. To do so, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter one of these commands depending on which nodes you want to stop.

    • To stop all nodes in the currently running mediation host:

      stopNodes
    • To stop all nodes in a specific mediation host:

      stopNode -ip mediation_hostname -p port 

      where mediation_hostname is the mediation host's IP address or host name, and port is the mediation host port number.

    • To stop a specific node:

      stopNode node_id_1 node_id_2...

Deleting Nodes

You can use NMShell to delete all nodes in a mediation host, all nodes for a specific Node Manager, or a specific node. To do so, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter one of these commands depending on which node you want to delete.

    • To delete all nodes in the currently running mediation host:

      deleteNodes
    • To delete all nodes managed by a specific Node Manager:

      deleteNode -ip mediation_hostname -p port 

      where mediation_hostname is the mediation host's IP address or host name, and port is the mediation host port number.

    • To delete a specific node:

      deleteNode node_id_1 node_id_2...

Adding Node Routes

You can use NMShell to add the following types of routes between nodes:

For more information, see "About Node Routing" in Offline Mediation Controller User's Guide.

Adding a Round-Robin Node Route

Round-robin routing allows you to branch a node chain to multiple instances of the same processing node type, such as from one CC node to three instances of the EP node, to improve performance. NAR files are routed by rotating through the different destination nodes. That is, the first NAR file is sent to destination node 1, the second NAR file is sent to destination node 2, and the third NAR file is sent to destination node 3. This routing process is repeated for all subsequent NAR files.

To add a round-robin route between two nodes, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the addRoute command:

    addRoute -o originNodeId -t targetNodeId -rFunc ROUND_ROBIN

    where:

    • originNodeId is the ID of the source node.

    • targetNodeId is the ID of the destination node.

    For example:

    addRoute -o rtvv91-16it-kzrxghq2 -t rtvv91-16it-kzrze10p -rFunc ROUND_ROBIN

Adding a Multicast Node Route

Multicast routing allows you to branch a node chain, such as from a source node to two destination nodes. All NAR files are routed in parallel to both destination nodes.

To add a multicast route between two nodes, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the addRoute command:

    addRoute -o originNodeId -t targetNodeId -rFunc MULTICAST

    where:

    • originNodeId is the ID of the source node.

    • targetNodeId is the ID of the destination node.

    For example:

    addRoute -o rtvumc-16it-l06o6w2p -t rtvumc-16it-y85f6e8d -rFunc MULTICAST

Adding a Modulus Node Route

Modulus routing allows you to branch a node chain to multiple instances of the same processing node, such as from one CC node to three instances of the EP node, to improve performance. NAR files are routed to a destination node based on an attribute value in the file, such as the starting time.

To add a modulus route between two nodes, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the addRoute command:

    addRoute -o originNodeId -t targetNodeId -rFunc MODULUS -rField RoutingAttribute

    where:

    • originNodeId is the ID of the source node.

    • targetNodeId is the ID of the destination node.

    • RoutingAttribute is an attribute from the NPL file, such as calling_number, session_id, start_time, end_time, or seq_no.

    For example:

    addRoute -o rtvumc-16it-l06o6w2p -t rtvumc-16it-y85f6e8d -rFunc MODULUS -rField seq_no

Adding a Directed Node Route

Directed routing allows you to branch a node chain, such as from a source node to two destination nodes. NAR files are routed to a destination node based on an attribute value in the file. For example, NAR files with sequence numbers 1 through 1000 are sent to destination node A, and NAR files with sequence numbers 1001 through 2000 are sent to destination node B.

To add a directed route between two nodes, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the addRoute command:

    addRoute -o originNodeId -t targetNodeId -rFunc DIRECTED -rField RoutingAttribute -rOperator RoutingOperator -rOperand1 CommaSeparatedValues [-rOperand2 CommaSeparatedValues]

    where:

    • originNodeId is the ID of the source node.

    • targetNodeId is the ID of the destination node.

    • RoutingAttribute is an attribute from the NPL file, such as calling_number, session_id, start_time, end_time, or seq_no.

    • RoutingOperator is the operator type: EQUALS, NOT_EQUALS, LESS_THAN, GREATER_THAN, IN_BETWEEN, LIST_EQUALS, LIST_NOT_EQUALS, SUBSET_OF, or NOT_SUBSET_OF.

    • CommaSeparatedValues is a comma-separated list of all operands.

    For example:

    addRoute -o rtvumc-16it-l06o6w2p -t rtvumc-16it-y85f6e8d -rFunc DIRECTED -rField seq_no -rOperator IN_BETWEEN -rOperand1 20,60 -rOperand2 30,70

    In this example, the output of rtvumc-16it-l06o6w2p is routed to rtvumc-16it-y85f6e8d when an NPL file contains a sequence number from 20 through 30, or from 60 through 70.

Deleting an Existing Node Route

To delete an existing route between two nodes, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the removeRoute command:

    removeRoute -o originNodeId -t targetNodeId

    where:

    • originNodeId is the ID of the source node.

    • targetNodeId is the ID of the destination node.

    For example:

    removeRoute -o rtvv91-16it-kzrxghq2 -t rtvv91-16it-kzrze10p

Adding Mediation Hosts to Node Manager

Before you import the node configuration or customization into a mediation host, you must first add the mediation host to Node Manager.

To add a mediation host to Node Manager, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the addhost command:

    addhost -n mediation_name -ip node_mgr_hostname -p port

    where:

    • mediation_name is the name of the mediation host you are adding to Node Manager.

    • node_mgr_hostname is the IP address or host name of the computer on which Node Manager is running.

    • port is the port number at which the mediation host communicates with Node Manager.

The mediation host is added to Node Manager.

Compiling the NPL Rule File

To compile the NPL rule file, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the compileNpl command:

    compileNpl -f npl_file_name -d complied_npl_class  -majorType major_type_of_the_node -minorType minor_type_of_the_node -id node_id

    where:

    • -f npl_file_name specifies the absolute path of the NPL file that you want to compile.

    • -d complied_npl_class specifies the absolute path of the compiled NPL class after running the command.

    • -majorType major_type_of_the_node specifies the major type of the node for which the NPL rule file is compiled. This parameter is not applicable if node ID is defined using the ID argument.

    • -minorType minor_type_of_the_node specifies the minor type of the node for which the NPL rule file is compiled. This parameter is not applicable if node ID is defined using the ID argument.

    • -id node_id specifies the unique ID assigned to the node for which the NPL rule file is compiled. This parameter is not applicable if -majorType and -minorType are specified.

The NPL rule file is compiled. If the compilation fails, update the rule file and recompile.

You can store the compiled NPL rule file in the classpath directory in the config folder of the node and update the general.cfg file to use the compiled NPL rule file.

Note:

After compiling the NPL rule file, you must start and stop nodes only by using NMShell command-line components. Using the GUI to start or stop nodes uses only the attributes and NPL that are defined in GUI components.

Changing Existing Node-Level Configuration

You can change the value of an existing configuration at the node level. To do so, log into NMShell and then do the following:

  1. Change to the Node Manager context:

    cd nodemgrHost nodeMgrPort

    where nodeMgrHost is the host name or IP address of the computer on which Node Manager is installed, and nodeMgrPort is the port number for Node Manager.

  2. Enter one of these commands depending on whether the configuration key is a password or not.

    • If the configuration key is not a password:

      change NodeID configKey configValue

      where:

      • NodeID is the unique ID assigned to the node.

      • configKey is the name of the configuration key.

      • configValue is the value of the configuration key.

    • If the configuration key is for an encoded password:

      change NodeID passwordKey encodedPassword

      where passwordKey is either the password of the FTP user (ftppasswd) or the password of the database user (dbpassword), and encodedPassword is the password in Base64 encoded format.

    • If the configuration key is for a password that is not encoded:

      change NodeID passwordKey
      password: password

Adding Back-End Only Configurations at Node Level

To add back-end only configurations at the node level, log into NMShell and then do the following:

  1. Change to the Node Manager context:

    cd nodemgrHost nodeMgrPort

    where nodeMgrHost is the host name or IP address of the computer on which Node Manager is installed, and nodeMgrPort is the port number for Node Manager.

  2. Enter the addAttribute command:

    addAttribute NodeID configKey configValue

    where:

    • NodeID is the unique ID assigned to the node.

    • configKey is the name of the configuration key, such as Idle Write Time.

    • configValue is the value of the configuration key, such as 60.

Checking Node Status

You can use NMShell to check the status of all nodes in a mediation host, all nodes for a specific Node Manager, or a specific node. To do so, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter one of these commands.

    • To check the status of all nodes for the currently running mediation host:

      status
    • To check the status of all nodes managed by a specific Node Manager:

      status -ip mediation_hostname -p port 

      where mediation_hostname is the mediation host's IP address or host name, and port is the mediation host port number.

    • To check the status of a specific node:

      status node_id_1 node_id_2...

Listing Node ID and Type

To list the node ID and type of all nodes having a specified name, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the lsNodesWithName command:

    lsNodesWithName [nodeName]

    where nodeName is the name of the node.

    For example:

    lsNodesWithName testNode

Checking NMShell Command Status

To check whether the last NMShell command was successful or failed, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter this command:

    cmd -status

One of the following results is returned:

  • -1 specifies that the last run command failed or there are no commands run before.

  • 0 specifies that the last run command was successful.

Note:

When multiple nodes are started or stopped by using NMShell, the status of the command can be retrieved only by running the status command. See "Checking Node Status" for more information.

Importing and Exporting Node Configuration

You can import or export node configuration and customization from:

  • All mediation hosts configured in Node Manager

  • One or more node chains under the Node Manager

See the following topics:

Note:

If you stop the export or import process, the system fails, or an error occurs repeatedly, intermediate files, data files, and folders are created in the nodes directory in OMC_home. If this occurs, create an offline copy of these files and then delete the nodes before running the command again.

Importing Node Configuration and Node Customization

To import the node configuration and node customization from all mediation hosts configured in Node Manager, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the import command:

    import -n mediation_name@mediation_hostname:port -f filename -c value

    where:

    • mediation_name is the mediation host's name configured in Node Manager.

    • mediation_hostname is the IP address or host name of the mediation host.

    • port is the port number of the mediation host.

    • filename specifies the name and path of the input file. Use filename.xml file to import the node configuration and use filename.nmx file to import the node customization.

    • value is one of the following:

      • Y specifies to import only the node customization. Use this value with the filename.nmx file.

      • N specifies to import only the node configuration. Use this value with the filename.xml file.

    For example:

    import -n linux1@10.10.10.111:55109 -f import.xml -c N

    The node configuration is imported from the import.xml file into the specified mediation hosts (linux1@10.10.10.111:55109).

Exporting Node Configuration and Node Customization

You can use NMShell to export the node configuration and customization details from all mediation hosts configured in Node Manager, or from a specified mediation host. To do so, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter one of these export commands:

    • To export from all mediation hosts configured in Node Manager:

      export -n ALL -f filename [-c value]
    • To export from a specified mediation host:

      export -n mediation_name@mediation_hostname:port -f filename [-c value]

      where:

      • mediation_name is the mediation host's name configured in Node Manager.

      • mediation_hostname is the mediation host's IP address or host name. To export multiple hosts, enter the mediation hosts separated by a comma (,).

      • port is the port number at which the mediation host communicates with Node Manager.

      • filename is the name and path of the output files. Do not include the file extension.

      • value is one of the following:

        • Y specifies to export both the node configuration and node customization. Two files are generated: filename.xml with the node configuration, and filename.nmx with the node customization. This is default.

        • N specifies to export only the node configuration. One file named filename.xml file is generated.

For example:

export -n linux1@10.10.10.111:55109,linux2@10.10.10.112:55110 -f export -c N

Only the node configuration from the mediation hosts (linux1@10.10.10.111:55109 and linux2@10.10.10.112:55110) is exported to the export.xml file.

Incrementally Import Node Chain Configurations and Customizations

Note:

Before you incrementally import node change configurations and customizations:

  • Ensure that Administration Server and Node Manager are available in the same OMC_home directory. If Node Manager is in a different directory, the node IDs are regenerated during the import by default and a backup of the old node chain is not created.

  • Ensure that you stop the nodes for which you want to import the customization or configuration before importing the node chain configuration or customization. See "Stopping Nodes" for more information.

To incrementally import one or more node chain configurations and customizations, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the import command:

    import [-n mediation_name@mediation_hostname:port] -f filename [-c value -nc y -r y]

    where:

    • mediation_name is the mediation host's name configured in Node Manager.

    • mediation_hostname is the IP address or host name of the mediation host.

    • port is the port number of the mediation host.

    • filename specifies the name and path of the input file. Use filename.xml file to import the node configuration and use filename.nmx file to import the node customization.

    • value is one of the following:

      • Y specifies to import only the node customization. Use this value with the filename.nmx file.

      • N specifies to import only the node configuration. Use this value with the filename.xml file.

    • -nc y specifies to import only the node chain customization or configuration.

    • -r y specifies to regenerate the node_id of the nodes for which the configuration or customization is imported. This value must be set if you importing node chain configuration or customization.

The node chain configuration or customization is imported into the specified mediation host. After the import, a backup of the existing nodes is created in the OMC_home/importbackup directory.

For example:

import -n linux1@10.10.10.111:55109 -f import.xml -c N -nc y -r y

The node chain configuration is imported from the import.xml file into the specified mediation host (linux1@10.10.10.111:55109).

After importing the node chain configuration or customization, you need to manually map the nodes that are not part of the imported node chain and delete undesired nodes.

Incrementally Export Node Chain Configurations and Customizations

To incrementally export one or more node chain configurations and customizations, log into NMShell and then do the following:

  1. Change to the Administration Server context:

    cd adminSvrHost adminSvrPort
  2. Enter the export command:

    export -n mediation_name@host_name:port -f filename -c value -nc y -id node_id

    where:

    • mediation_name is the mediation host's name configured in Node Manager.

    • mediation_hostname is the IP address or host name of the mediation host.

    • port is the port number of the mediation host.

    • -f filename specifies the name and path of the output files. Do not include the file extension.

    • -c value is one of the following:

      • Y specifies to export both the node configuration and node customization. Two files are generated: filename.xml with the node configuration, and filename.nmx with the node customization. This is default.

      • N specifies to export only the node configuration. One file named filename.xml file is generated.

    • -nc y specifies to export only the node chain configuration and customization.

    • -id node_id specifies to export the node chain configuration and customization from the specified node. To export from multiple nodes, separate the node IDs by commas.

For example:

export -n abc@localhost:55109 -f .../testnodechain/test/exportfile -c y -nc y -id 31a80o-16it-jrzysls9

The node configuration and customization from the 31a80o-16it-jrzysls9 node chain in the mediation host (abc@localhost:55109) are exported successfully to the specified file.