Node: A VM in the cluster
NodeGroup: A group of VMs with same functionality and spec
Cluster: A group of NodeGroups working together
Distro: A Hadoop distribution version
CLI supports shell mode, command line mode, and execution of script file. After compile, you can find the jar file under cli/target directory.
- Shell mode: java -jar serengeti-cli-*.jar. It supports tab key based command hint and completion. It supports history by up/down arrows.
- Command line mode: java -jar serengeti-cli-*.jar "command1;command2..."
- Execution of script file: in shell mode or command line mode, execute "script --file scriptFileName". The shell history file named cli.history will help to generate the script file.
CLI commands are built on spring shell(https://github.com/SpringSource/spring-shell), so its syntax follows spring shell command syntax below:
Command ::= serengeti <command-category> <command-name> <required-command-key-values>* [<optional-command-key-values>]*
required-command-key-values ::= <command-key-value-fullsize>
optional-command-key-values ::= <command-key-value-fullsize>
required-command-key-values-fullsize ::= <command-key-value-fullsize>
optional-command-key-value-fullsize ::= <command-key-value-fullsize>
command-key-value-fullsize ::= '--'<command-key-full> [<value>]
- Command-category is the type of object that the command will operate on.
- Command-name is the operation to do.
- Required-command-key-values are parameters that required for the operation.
- Optional-command-key-values are parameters that are optional for the operation.
- Shell level Help: user can get shell level help by using "help" in command line mode or help command in shell mode. A list of objects will be displayed with operations and short descriptions.
- Command category level help: to get help for a particular class of object, user can enter help followed by an object. CLI will display all operations defined for the object.
- Command level help: to get help for a particular operation, user can enter help followed by an object and an operation. This will display all parameters.
command-category |
command-name |
Parameters |
descriptions |
connect |
|
Mandatory --host <Serengeti server host>:8080 Options --username <serengeti user name> --password <serengeti password> |
Function Connect a Serengeti server. Remark The Serengeti host with optional port number, e.g. hostname:port . Connect command requires username and password interactively. If connect failed, the other Serengeti command is not allowed to execute. |
resource pool |
add |
Mandatory --name <resource pool name> --vcrp < VC rp name > --vccluster < vsphere cluster name > Options --username |
Function Add a new resource pool. Remark User must add a resource pool before create a cluster.
|
list |
Mandatory None Options --name <resource pool name> --detail <flag to show node information> |
Function Show resource pool information. |
|
delete |
Mandatory --name <resource pool name> Options None |
Function Delete an unused resource pool. Remark User cannot delete a resource pool which is in use. |
|
datastore |
add |
Mandatory --name <data store name> --spec <datastore name(s) in the vsphere> Options --type <specify the type for storage: SHARED or LOCAL> |
Function Add new datastore(s) . Remark When the spec parameter include some datastore names, users need to use "," to separate them. Users may also specify multiple data stores by a wildcard. |
list |
Mandatory None Options --name <data store name> --detail < flag to show datastore detail information > |
Function Show datastore information. |
|
delete |
Mandatory --name <data store name> Options None |
Function Delete an unused datastore .
|
|
network |
add |
Mandatory --name <network name> --portGroup<vsphere port group name> Options Combination 1 -- dhcp < mark as dhcp type> Combination 2 -- ip <ip range information> -- dns< first dns information > -- secondDNS <second dns information> -- gateway <gateway information> -- mask<mask information> |
Function Add a network to Serengeti. Remark Users must enter either ip range or dhcp, but not both. Example network add --name ipNetwork --ip 192.168.1.1-100,192.168.1.256-300 --portGroup pg1 --dns 202.112.0.1 --gateway 192.168.1.255 --mask 255.255.255.1 network add --name dhcpNetwork --dhcp |
list |
Mandatory None Options --name <network name> --detail <flag to show network detail information > |
Function Show network information. |
|
delete |
Mandatory --name <network name> Options None |
Function Delete an unused network. Remark User cannot delete a network which is in use. |
|
cluster |
create |
Mandatory --name <cluster name> Options --distro < hadoop distro name> --specFile <spec file pathname> --rpNames < resource pools for the cluster > --dsNames < datastores for the cluster> --networkName <network name> --resume < flag to resume cluster creation > --topology < Specify which topology type will be used for rack awareness: HVE, RACK_AS_RACK, or HOST_AS_RACK. > --skipConfigValidation < flag to skip cluster configuration validation > --yes < flag to answer 'yes' to all Y/N questions > |
Function Create a Hadoop cluster Remark The specFile is defined in json format. Example cluster create --name testCluster |
config |
Mandatory --name <cluster name> --specFile <spec file pathname> Options --skipConfigValidation < flag to skip cluster configuration validation > --yes < flag to answer 'yes' to all Y/N questions > |
Function Config an existing cluster. Remark The specFile is defined in json format. |
|
delete |
Mandatory --name <cluster name> Options None |
Function Delete an unused cluster.
|
|
resize |
Mandatory --name <cluster name> --nodeGroup < node group name> --instanceNum <instance number> Options None |
Function Change the number of nodes in a node group. Parameter Definition instance number ::= <final number> Remark The instanceNum should be larger than the existing instance numbers in the node group. Example cluster resize --name testCluster --nodeGroup slave -- instanceNum 10 |
|
start |
Mandatory --name <cluster name> Options --nodeGroupName <node group name> --nodeName <node name> |
Function Start VMs in a cluster.
|
|
stop |
Mandatory --name <cluster name> Options --nodeGroupName <node group name> --nodeName <node name> |
Function Stop VMs in a cluster.
|
|
limit |
Mandatory --name <cluster name>: Name of the Hadoop cluster in Serengeti --activeComputeNodeNum <active node number>: Number of active compute nodes for the specified Hadoop cluster or node group within that cluster. Options --nodeGroupName <node group name>: Name of a node group in the specified Hadoop cluster in Serengeti (only supports node groups with task tracker role) |
Function Enable or disable provisioned compute nodes in the specified Hadoop cluster or node group in Serengeti to reach the limit specified by activeComputeNodeNum. Compute nodes are re-commissioned and powered-on or decommissioned and powered-off to reach the specified number of active compute nodes.
|
|
unlimit |
Mandatory --name <cluster name>: Name of the Hadoop cluster in Serengeti Options --nodeGroupName <node group name>: Name of a node group in the specified Hadoop cluster in Serengeti (only supports node groups with task tracker role) |
Function Remove cluster limit restriction for provisioned compute nodes in the specified Hadoop cluster or node group in Serengeti. All compute nodes in specified cluster or node group are all re-commissioned and powered-on.
|
|
list |
Mandatory None Options --name <cluster name> --detail <flag to show node information> |
Function Show cluster information. Note: with this option specified, Serengeti will query from vCenter server to get latest node status. That operation may take some time, for example, longer than 7 seconds for each cluster. Please be patient. |
|
export |
Mandatory --spec <falg to export cluster specification> --name <cluster name> Options --output <output file name> |
Function Export cluster specification. |
|
target |
Mandatory None Options --name <cluster name> --info <flag to show target information> |
Function Set or query target cluster to run hadoop commands. |
|
distro |
list |
Mandatory None Options --name <distro name> --detail < flag to show distro detail information> |
Function Show distro information. |
topology |
list |
Mandatory None Options None |
Function Show the rack->hosts mapping topology. |
upload |
Mandatory --fileName <topology file name> Options --yes <answer 'yes' to all Y/N questions.> |
Function Upload a rack-->hosts mapping topology file. |
|
disconnect |
|
|
Function Disconnect the Serengeti server. |