[c3-users] UPDATE: cconfig v0.99 (smart replacement for c3_conf_manager)

olivier.lahaye1 at free.fr olivier.lahaye1 at free.fr
Fri Apr 4 13:52:05 EDT 2014


New update: 

now cconfig is smarter in detecting that a node is alive. 
instead of using ping, it tries to check that remote command port is opened. 

Remote command port can be determined in the following ways by priority order. 
1/ --service <service name> any service from /etc/service, or a port number. (tcp only) 
ping, resolv or none can be specified as "fake" service. 
- ping: ping node instead of trying to check a port. 
- resolv: check only that the node can be resolved using gethostbyname() 
- none: no test on remote node. used to restring 'check' command to c3.conf syntax. 
2/ $C3_RSH. If set, cconfig will automatically check the associated service. 
Only supports for ssh or rsh for now. (ssh->'ssh' and rsh->'shell') 
3/ defaults to "ssh" 

Example of usage: 

cconfig check 
cconfig check --file /tmp/c3.conf 
cconfig check --service ping 
C3_RSH="rsh" cconfig check 
cconfig check --service 8649 # trick to check that nodes have a running gmond 

./cconfig update --file /tmp/c3.conf --refreshstatuses --service ssh # all nodes that have ssh port closed (or that no not resolv) are marked as dead. 

./cconfig update --file /tmp/c3.conf --refreshstatuses --service resolv # only hosts that do not resolv are marked as dead. 

cconfig check --service none # do not test nodes, only check c3.conf syntax 

You can get it here. 
wget http://svn.oscar.openclustergroup.org/oscar/trunk/bin/cconfig 

Best regards. 

Olivier. 
----- Mail original -----


De: "LAHAYE Olivier" <olivier.lahaye at cea.fr> 
À: "C3 Users List ‎[c3-users at email.ornl.gov]‎" <c3-users at email.ornl.gov> 
Cc: c3-devel at ornl.gov 
Envoyé: Jeudi 3 Avril 2014 20:07:33 
Objet: [c3-users] cconfig v0.99 (smart replacement for c3_conf_manager) 



Hi, 

After few days of development, I've finaly reached a step were cconfig the c3_conf_manager full replacement is ready for "release candidate". 
Feel free to test and report bugs. 

What is really cconfig? 

cconfig is a command line to to edit update and manage c3.conf file. 
it is able to: 
- Add or remove clusters 
- Add or remove nodes from clusters. can handle ranges with or without padding 
for example, range node[000-999] will end as node00[0-9] node0[10-99] node[100-999] in c3.conf 
- Enable or disable nodes can handle dead or excludes 
- Check that c3.conf is ok (also check for known hosts (head and nodes) and pingable nodes). 
- Sort nodes 
- list clusters 
- list nodes 
- set default cluster 
- handle or not the dead dummy node trick to avoid zero indexing 
- update nodes statuses (mak dead nodes that ping alive and alivenodes that do not resolv or ping as dead. Usefull in a crontab 

Many command can be restricted to a cluster or a subset of nodes within that cluster (update, disablenodes, enablenodes, ...) 

For more information, see the manual: 
=> pod2man cconfig |nroff -man |more 

To get cconfig: 
wget http://svn.oscar.openclustergroup.org/oscar/trunk/bin/cconfig 

To test, the --dry-run switch allows to avoid writing the result to c3.conf. 
alternate c3.conf file can be specified using the --file switch. 

Here are attached some example of what can be done. 
# Creating a cluster: 
./cconfig addcluster --cluster MegaCluster --nodes HeadHammer foo bar "test[02-09]" --noresolv --file /tmp/c3.conf 

# Creating a virtual cluster: 
./cconfig addcluster --cluster VirtualOne --nodes :remotehead --noresolv --file /tmp/c3.conf 

# Creating a third cluster with no dummy dead entry (use zero indexing) 
# The 1st node is a real node with name dummy 
./cconfig addcluster --cluster Zero --nodes local:private dummy wow[0-9] --zero --noresolv --file /tmp/c3.conf 

# disabling 1st node. this will result in a "dead dummy" entry as 1st node (index 0). 
# if --noresolv is used, then cconfig has no way to determine if node is a real node and will 
# ignore it if not specificaly specified with --nodes. 
./cconfig disablenodes --cluster Zero --nodes dummy wow[0-5] --file /tmp/c3.conf 

# Adding nodes: 
./cconfig addnodes --cluster MegaCluster --nodes node1 node2 node3 "ulys[31-34]" zzz test01 --sortnodes --noresolv --file /tmp/c3.conf 

# Removing nodes: 
./cconfig delnodes --cluster MegaCluster --nodes ulys[32-34] zzz --file /tmp/c3.conf 

# List known clusters: 
./cconfig listclusters --file /tmp/c3.conf 

# Enabling nodes in a cluster (sorting it at the same time) 
./cconfig enablenodes --cluster MegaCluster --sortnodes --noresolv --file /tmp/c3.conf 

# enabling all nodes in cluster Zero: ("dead dummy" is untouched this time) 
./cconfig enablenodes --cluster Zero --noresolv --file /tmp/c3.conf 

# But this time it is enabled.(in normal situation without --noresolv, if the "dummy" node 
# can be resolved (get ip), the command below wouldn't have been necessary). 
./cconfig enablenodes --cluster Zero --nodes dummy --noresolv --file /tmp/c3.conf 

# 
# Updating nodes status using ping. 
# Dead nodes that respond are enable 
# alive nodes that do not respond are disabled. 
# Update status of upper half nodes. 
./cconfig update --cluster MegaCluster --nodes test[05-09] --noresolv --file /tmp/c3.conf 

# Do a full update (all clusters). 
./cconfig update --noresolv --file /tmp/c3.conf 

# Disable some nodes for maintenance (e.g. power outage of a rack) 
./cconfig disablenodes --cluster MegaCluster --nodes foo test[01-03] test[06-08] --file /tmp/c3.conf 

# Deleting a cluster: (we do a dry-run this time, thus the output on stdout). 
./cconfig delcluster --cluster MegaCluster --dry-run --file /tmp/c3.conf 

# Now play with ranges and excludes. 
# 1st create a big cluster with padding. 
./cconfig addcluster --cluster oscar_cluster --nodes oscarnode[000-999] --file /tmp/c3.conf --noresolv --file /tmp/c3.conf 
# 2nd disable rack 5 that hosts nodes 090 to 120 to fix a PDU problem. 
./cconfig disablenodes --cluster oscar_cluster --nodes oscarnode[090-120] --file /tmp/c3.conf --file /tmp/c3.conf 
# 3rd after restart only a few nodes have power, reenable them 
./cconfig enablenodes --cluster oscar_cluster --nodes oscarnode[095-105] --file /tmp/c3.conf --noresolv --file /tmp/c3.conf 
# 4th everything fiwxed, reenable all nodes 
./cconfig enablenodes --cluster oscar_cluster --file /tmp/c3.conf --noresolv --file /tmp/c3.conf 

Best regards, 

Olivier. 





-- 
Olivier LAHAYE 
CEA DRT/LIST/DIR 

_______________________________________________ 
c3-users mailing list 
c3-users at elist.ornl.gov 
https://elist.ornl.gov/mailman/listinfo/c3-users 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://elist.ornl.gov/pipermail/c3-users/attachments/20140404/bcedfc45/attachment.html>


More information about the c3-users mailing list