Node group configuration scripts
The scripting library provides multiple script procedures to automate your server configurations. Use the information in this topic to use scripts that query, configure, and manage your node configurations. You can run each script individually, or combine procedures to create custom automation scripts for your environment.
Use node groups to define groups of nodes can host members of the same cluster. An application that is deployed to a cluster must be capable of running on any of the cluster members. The node that hosts each of the cluster members must be configured with software and settings that are necessary to support the application.
By organizing nodes that satisfy your application requirements into a node group, you establish an administrative policy that governs which nodes can be used together to form a cluster. Those who define the cell configuration and those who create server clusters can operate with more independence from one another.
addNodeGroupMember
This script adds a node to a node group that exists in your configuration.
Argument | Description |
---|---|
nodeName | Specifies a logical name for the node group member. A node group member is a node. The name must be unique within the cell. A node group member name typically is identical to the host name for the computer. |
nodeGroupName | Specifies a logical name for the node group. The name must be unique within the cell. The name can start with a number. |
Syntax
AdminNodeGroupManagement.addNodeGroupMember(nodeName, discoveryProtocol)
Example usage
AdminNodeGroupManagement.addNodeGroupMember("myNode", "myNodeGroup")
checkIfNodeExists
This script displays whether the node of interest exists in a specific node group.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group to query. |
nodeName | Specifies the name of the node to query. |
Syntax
AdminNodeGroupManagement.checkIfNodeExists(nodeGroupName, nodeName)
Example usage
AdminNodeGroupManagement.checkIfNodeExists("myNodeGroup", "myNode")
checkIfNodeGroupExists
This script displays whether a specific node group exists in your configuration.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group to query. |
Syntax
AdminNodeGroupManagement.checkIfNodeGroupExists(nodeGroupName)
Example usage
AdminNodeGroupManagement.checkIfNodeGroupExists("myNodeGroup")
createNodeGroup
This script creates a new node group in your configuration.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group to create. |
Syntax
AdminNodeGroupManagement.createNodeGroup("nodeGroupName")
Example usage
AdminNodeGroupManagement.createNodeGroup("myNodeGroup")
createNodeGroupProperty
This script assigns custom properties to the node group of interest.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node of interest. |
customPropertyName | Specifies the name, or key, for the property. Each property name must be unique. If the same name is used for multiple properties, the value specified for the first property that has that name is used. Do not start your property names with was. because this prefix is reserved for properties that are predefined in the application server. |
customPropertyValue | Specifies the value to assign to the custom property name. |
customPropertyDesc | Optionally specifies a description for the custom property to create. |
isPropertyRequired | Optionally specifies whether the custom property is required in your configuration. Specify true to set the custom property as required in your configuration. |
Syntax
AdminNodeGroupManagement.createNodeGroupProperty(nodeGroupName, customPropertyName,
customPropertyValue, customPropertyDesc, isPropertyRequired)
Example usage
AdminNodeGroupManagement.createNodeGroupProperty("myNodeGroup", "myProp", "myPropValue",
"this is my prop", "true")
deleteNodeGroup
This script deletes a node group from your configuration.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group to delete. |
Syntax
AdminNodeGroupManagement.deleteNodeGroup(nodeGroupName)
Example usage
AdminNodeGroupManagement.deleteNodeGroup("myNodeGroup")
deleteNodeGroupMember
This script removes a node from a specific node group in your configuration.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group of interest. |
nodeName | Specifies the name of the node to remove from the node group. |
Syntax
AdminNodeGroupManagement.deleteNodeGroupMember(nodeGroupName, nodeName)
Example usage
AdminNodeGroupManagement.deleteNodeGroupMember("myNodeGroup", "myNode")
deleteNodeGroupProperty
This script removes a specific custom property from a node group.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group of interest. |
customPropertyName | Specifies the name of the custom property to remove from your node group configuration. |
Syntax
AdminNodeGroupManagement.deleteNodeGroupProperty(nodeGroupName, customPropertyName)
Example usage
AdminNodeGroupManagement.deleteNodeGroupProperty("myNodeGroup", "myProp")
help
Argument | Description |
---|---|
script | Specifies the name of the script of interest. |
Syntax
AdminServerManagement.help(script)
Example usage
AdminServerManagement.help("modifyNodeGroupProperty")
listNodeGroups
Argument | Description |
---|---|
nodeName | Optionally specifies the name of the node to use to query the node groups. |
Syntax
AdminNodeGroupManagement.listNodeGroups()
Example usage
AdminNodeGroupManagement.listNodeGroups()
listNodeGroupMembers
This script lists the name of each node that is configured within a specific node group.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group of interest. |
Syntax
AdminNodeGroupManagement.listNodeGroupMembers(nodeGroupName)
Example usage
AdminNodeGroupManagement.listNodeGroupMembers("myNodeGroup")
listNodeGroupProperties
This script lists the custom properties that are configured within a specific node group.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group of interest. |
Syntax
AdminNodeGroupManagement.listNodeGroupProperties(nodeGroupName)
Example usage
AdminNodeGroupManagement.listNodeGroupProperties("myNodeGroup")
modifyNodeGroup
This script modifies the short name and description of a node group.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group of interest. |
shortName | Specifies the short name of the node group of interest. |
description | Specifies a description of the node group. |
Syntax
AdminNodeGroupManagement.listNodeGroupProperties(nodeGroupName, shortName,
description)
Example usage
AdminNodeGroupManagement.listNodeGroupProperties("myNodeGroup", "NG1", "my first node group")
modifyNodeGroupProperty
This script modifies the value of a custom property assigned to a node group.
Argument | Description |
---|---|
nodeGroupName | Specifies the name of the node group of interest. |
customPropertyName | Specifies the name of the custom property to modify. |
customPropertyValue | Optionally specifies a new value for the custom property of interest. |
customPropertyDescription | Optionally specifies a description for the custom property. |
isPropertyRequired | Optionally specifies whether the custom property is required. |
Syntax
AdminNodeGroupManagement.modifyNodeGroupProperty(nodeGroupName, customPropertyName,
customPropertyValue, customPropertyDescription, isPropertyRequired)
Example usage
AdminNodeGroupManagement.modifyNodeGroupProperty("myNodeGroup", "customProp", "newValue",
"new description of property", "false")