hi everybody!<br><br> I have some questions about
corosync-cfgtool<br> <br> 1. What should I
do when "corosync-cfgtool -s" return "Could not initialize corosync
configuration API error" ? Restart corosync ?(I don't think it's a good
idea)<br><br> 2. How can the process happen automatically when
network problems is repaired, instead of using "corosync-cfgtool -r"
manually?<br><br><br><br> My testing environment is :
<br> 2 PC (on virtualbox-3.2.12)<br> Double
network card and double heart-beat link(eth0 and eth1)<br> OS:
RHEL 5.3 x86<br> primary rpms: corosync-1.3.0 and
pacemaker-1.0.10<br> corosync.conf:(relevant
portion)<br> <br>
compatibility: whitetank<br><br> totem
{<br>
version: 2<br>
secauth:
off<br>
threads: 0<br>
rrp_mode:
active<br>
interface{<br>
ringnumber:0<br>
bindnetaddr:10.10.10.0<br>
mcastaddr:235.3.4.5<br>
mcastport:9876<br>
}<br>
interface{<br>
ringnumber:1<br>
bindnetaddr:20.20.20.0<br>
mcastaddr:235.3.4.6<br>
mcastport:9877<br>
}
<br> }<br><br><br><br>
<br> When something bad happen on one of the
double-heart-beat-link<br> --------just like: ifdown eth0, or
pull out one of the netting twine-----<br><br> I use:(ifdown
eth1 before)<br> corosync-cfgtool -s
<br> found that:<br>
Printing ring status.<br> Local node ID
185207306<br> RING ID
0<br> id =
10.10.10.11<br> status =
ring 0 active with no faults<br> RING ID
1<br> id =
20.20.20.11<br> status =
Marking seqid 14089 ringid 1 interface 20.20.20.11 FAULTY - adminisrtative
intervention required.<br> then:<br>
ifup eth1<br> and:<br>
corosync-cfgtool -r<br><br> The problem is
repaired.<br><br> BUT, I want this process happen
automatically when network problems is repaired, I write this shell, and start
it when service corosync start:
<br><br> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<br> #!/bin/bash<br>
local_is_down=0<br> ip_res=`corosync-cfgtool -s|grep id|awk
'{print $3}'`<br> while [ -z "$ip_res" ]<br>
do<br> sleep
5<br>
ip_res=`corosync-cfgtool -s|grep id|awk '{print $3}'`<br>
done<br><br> ip_num=`corosync-cfgtool -s|grep "no faults"|wc
-l`<br><br> while true<br>
do<br> sleep
10<br>
res=`corosync-cfgtool -s`<br>
echo "$res" |grep FAULTY &>
/dev/null<br> if [
"$?" -ne 0 ];then<br>
tmp_num=`echo "$res"|grep "no faults"|wc -l`<br>
if [ "$tmp_num" -eq "$ip_num" ];then<br>
local_is_down=0<br>
else<br>
continue<br>
fi<br>
else<br>
mii-tool |grep "no link" &> /dev/null
<br>
if [ $? -eq 0
];then<br>
local_is_down=1 #pull out one of
the netting
twine<br>
else<br>
for IP in
$ip_res<br>
do<br>
ifconfig|grep "$IP" &>
/dev/null
<br>
if [ $? -ne 0
];then<br>
local_is_down=1
#ifdown<br>
fi<br>
done<br>
fi<br><br>
if [
$local_is_down -eq 1
];then<br>
corosync-cfgtool -r &>
/dev/null<br>
fi<br>
fi<br> done
&<br> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br><br>
The shell works well mostly, however, it does not work sometimes because command
"corosync-cfgtool -s" return <br> "Could not initialize
corosync configuration API error 6"<br><br>and the pacemaker process seems also
done.<br><br><br> THANKS!<br><div id="cs2cSignature"></div>