7.4. Operation With CLI

In this section, it is covered how to use CLI to administrate your clustered systems. The cluster environment that will use is based on following setting, which is the same as chapter "Installing ShaoLin InfiniCluster".

Current Setting of Cluster Environment

Cluster Key: cluster1_key1

Node ID: cluster1_node1

Description: This is SIC cluster1, key is cluster1_key1, node is cluster1_node2, public IP is 192.168.3.132

IP Address (NIC) -- Communication Channels (Type)

192.168.3.131 (eth0) -- clusterwide (eth)

192.168.111.131 (eth1) -- cluster1_ccid1 (udp)

192.168.112.131 (eth2) -- cluster1_ccid2 (udp)

Node ID: cluster1_node2

IP Address (NIC) -- Communication Channels (Type)

192.168.3.132 (eth0) -- clusterwide (eth)

192.168.111.132 (eth1) -- cluster1_ccid1 (udp)

192.168.112.132 (eth2) -- cluster1_ccid2 (udp)

7.4.1. Verifying Cluster Environment

Each time when you need to add, change, or edit your current clustering environment through CLI, you Will need to login to a node of the cluster, and verify before performing any task. Following list of commands would be helpful;


[Node01 root]# "sliccli showmem" - display the details of the communication channels within the cluster.
[Node01 root]# "sliccli showcc" - display the communication channels configuration
[Node01 root]# "sliccli showrg [group id] - display all the resource groups within cluster

You can use these listed commands to verify your current setting to minimize the chance of incorrect configuration.

7.4.2. Add a Communication Channel to Cluster

Save it as a text file with the name "cluster1_ccid3.txt". Actually, you can save the file with a name that you can remember it easily.

Step2. Add communication channel into cluster

Step3. Add a node to a newly created communication channel (cluster1_ccid3)

sliccli addccmem "channel_id' "node_id" [ip_address|tty_dev_file|mac_address]

[Node01 root]# sliccli addccmem cluster1_ccid3 cluster1_node1 00:b2:a3:5a:ef:a1
[Node01 root]# sliccli addccmem cluster1_ccid3 cluster1_node2 00:ea:34:3e:5a:f1

Step4. Verify the newly added communication channel

Use "sliccli showcc" to display current heartbeat configuration.

Then use "sliccli showmem" to display the entire cluster environment.

7.4.3. Add Resource Group

Step1. Checking (execute "sliccli showmem" to get the node information)

Step2. Create a new resource group for Apache by using "addrg" command.

Use command - sliccli addrg group_id desc [auto_start|manual_start] [auto_failover|manual_switchover] [auto_failback|manual_failback] [load_balancing|no_load_balancing] max_owner min_owner max_retry monitor_cycletime


[Node01 root]# sliccli addrg "Web Service" "Web Service" auto_failover auto_failback 1 1 10 cluster1_node1

Step3. Add resource into the "Web Service" resource group by using "addres" command.

Use command - sliccli addres {group_id} {res_id} type [local|global] {priority} where type can be found by using "sliccli listrestype".


[Node01 root]# sliccli addres "Web Service" httpd "Application" global 1

Step4. Add more resources into resource group

In most cases, you would need to have more then one resource under the same resource group.

Use command - sliccli addres {group_id} {res_id} type [local|global] {priority}


[Node01 root]# sliccli addres "Web Service" "Virtual IP Address for httpd" "IP Address" local 2

Step5. Configure each resource in the resource group

You will also need to configure the resource with related operations.

For "Application"

Use command - sliccli setresattr {group_id} {res_id key value (for global resource)


[Node01 root]# sliccli setresattr "Web Service" "httpd" start "/etc/init.d/httpd start"
[Node01 root]# sliccli setresattr "Web Service" "httpd" stop "/etc/init.d/httpd stop"
[Node01 root]# sliccli setresattr "Web Service" "httpd" restart "/etc/init.d/httpd restart"
[Node01 root]# sliccli setresattr "Web Service" "httpd" status "/etc/init.d/httpd status"

For "IP Address"

Use command - sliccli setresattr {group_id} {res_id} key value (for global resource)


[Node01 root]# sliccli setresattr "Web Service" "Virtual IP Address for httpd" ipaddr "192.168.3.110"
[Node01 root]# sliccli setresattr "Web Service" "Virtual IP Address for httpd" netmask "255.255.255.0"
[Node01 root]# sliccli setresattr "Web Service" "Virtual IP Address for httpd" broadcast "192.168.3.255"
[Node01 root]# sliccli setresattr "Web Service" "Virtual IP Address for httpd" interface "eth0:1"

Step6. Add node into the resource group failover domain

Use command - sliccli addfodnode {group_id} {node_id} {priority}


[root@SIC_Node01 root]# sliccli addfodnode "Web Service" "cluster1_node1" 1
[root@SIC_Node01 root]# sliccli addfodnode "Web Service" "cluster1_node2" 2

Step7. Enable the resource group

Use command - sliccli ctlrg [enable|disable|suspend] {group_id}


[root@SIC_Node01 root]# sliccli ctlrg enable "Web Service"

Step8. Verify the new added resource group running status by running;


[root@SIC_Node01 root]# sliccli rgstatus

7.4.4. Manual Takeover

Step1. Verify the existing resource group information by executing "sliccli rgstatus"

Step2. Suppose resource group "Web Services" is running in node id "cluster1_node1"

Step3. Failover resource group "Web Service" to node id "cluster1_node2";

Use command - sliccli switchover {group_id} {node_id} {from_node_id}


[root@SIC_Node01 root]# sliccli switchover "Web Service" "cluster1_node2"

Step4. Execute the command "sliccli rgstatus" to check that "Web Service" is now running on "cluster1_node2"