[ClusterLabs] IPaddr2 file couldn't execute external binaries

Akaraphan Janetheerapong jackschariot at gmail.com
Wed Apr 6 07:03:10 EDT 2022


I have been continuing further studying
https://www.ateam-oracle.com/post/isv-implementation-details-part-4a-linux-clustering-with-pacemaker-and-corosync


Right now, I got pacemaker and corosync up and running. However, I am stuck
in one part: it seems IPaddr2 couldn't execute external binary:

##### OCI vNIC variables
server="`hostname -s`"
nat1_vnic="ocid1.vnic.oc1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
nat2_vnic="ocid1.vnic.oc1.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
vnicip="10.0.0.10"

...
...


#
#        Add an interface
#
add_interface () {

        currentDate=`date`
        echo $currentDate >> /home/user1/mylog
        echo "Added Interface" >> /home/user1/mylog

        ##### OCI/IPaddr Integration
        if [ $server = "z2-server-nat1" ]; then

                echo $nat1_vnic >> /home/user1/mylog
                echo $vnicip >> /home/user1/mylog

                oocciivv=`/root/bin/oci -v`
                echo $oocciivv >> /home/user1/mylog

                oouutt1=`/root/bin/oci network vnic assign-private-ip
--unassign-if-already-assigned --vnic-id $nat1_vnic  --ip-address $vnicip`
oouutt2=`/bin/systemctl network restart`

echo $oouutt1 >> /home/user1/mylog
                echo $oouutt2 >> /home/user1/mylog

                echo "z2-server-nat1" >> /home/user1/mylog
        else
                /root/bin/oci network vnic assign-private-ip
--unassign-if-already-assigned --vnic-id $nat2_vnic  --ip-address $vnicip
>> /home/user1/mylog
                /bin/systemctl network restart >> /home/user1/mylog
                echo "z2-server-nat2" >> /home/user1/mylog
        fi

        echo "----------" >> /home/user1/mylog

        local cmd msg ipaddr netmask broadcast iface label

...
...

After doing some resource moving via:

pcs resource move Cluster_VIP z2-server-nat2
pcs resource move Cluster_VIP z2-server-nat1

I got some results in my /home/user1/mylog file, and it turned out I
/root/bin/oci and /bin/systemctl have no output whatsoever. The log file
got the date, the string "Added Interface", the variable nat1_vnic, the
variable vnicip, a few blank lines (which supposed to be the output of oci
and systemctl) and the string "z2-server-nat1".

In this case, I see that the script is executed, but it seems it cannot run
oci and systemctl for some reasons.

I have also tried creating a testOCI.sh file housing:

echo `/root/bin/oci network vnic assign-private-ip
--unassign-if-already-assigned --vnic-id
ocid1.vnic.oc1.xxxxxxxxxxxxxxxxxxxxxxxxxx --ip-address 10.0.0.10` >>
/home/user1/myLogForSimpleSH
echo `/bin/systemctl network restart` >> /home/user1/myLogForSimpleSH

Here, if I run it directly from the terminal with ./testOCI.sh, I see that
I got the data from oci correctly.

Am I missing something in this case? What is needed for the IPaddr2 file to
run external binaries?

Thank you,
Chariot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20220406/6c9038e8/attachment.htm>


More information about the Users mailing list