Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Users

tuning of ocf script exportfs

 

 

Linux-HA users RSS feed   Index | Next | Previous | View Threaded


alain.moulle at bull

Jul 26, 2012, 7:48 AM

Post #1 of 3 (170 views)
Permalink
tuning of ocf script exportfs

Hi Dejan

a little contribution on the script exportfs , last release found here
(delivered 16 days ago):
https://github.com/ClusterLabs/resource-agents/tree/master/heartbeat

two things except if I'm mistaking:

1/ little typo : I think the "." is missing for .ocf-shellfuncs

2/ the script does not work if we set the OCF_RESKEY_clientspec="*" in
params of the exportfs resource,

due to the exportfs_monitor function :
when using * instead of hostname, the exportfs is displaying for example :
/alain <world>
and the line :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t;
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' | grep -q -x -F
"${OCF_RESKEY_directory} ${OCF_RESKEY_clientspec}"
returns 1 and then $OCF_NOT_RUNNING

So I don't know if it is the more elegant manner to fix this little issue,
but I've added at the begining of exportfs_monitor :

exportfs_monitor ()
{
# exportfs output wraps lines for long export directory names.
# We unwrap here with sed.
# We then do a literal match on the full line (grep -x -F)
if [ "${OCF_RESKEY_clientspec}" == "*" ]; then
CLIENTSPEC="<world>"
else
CLIENTSPEC=${OCF_RESKEY_clientspec}
fi

and use $CLIENTSPEC on the grep :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t;
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' | grep -q -x -F
"${OCF_RESKEY_directory} ${CLIENTSPEC}

With this tuning, it works fine.

Regards
Alain
_______________________________________________
Linux-HA mailing list
Linux-HA [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems


alain.moulle at bull

Jul 26, 2012, 8:33 AM

Post #2 of 3 (163 views)
Permalink
Re: tuning of ocf script exportfs [In reply to]

For the first point, in fact I've modified :
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
as
: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat}
. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs
because on my system (RH) , there is only one ocf-shellfuncs (without the
".") here :
/usr/share/cluster/ocf-shellfuncs , so that's why the script does not find
this
file ocf-shellfuncs under ${OCF_ROOT}/lib/heartbeat}

Alain



De : alain.moulle [at] bull
A : linux-ha [at] lists
Date : 26/07/2012 16:49
Objet : [Linux-HA] tuning of ocf script exportfs
Envoyé par : linux-ha-bounces [at] lists



Hi Dejan

a little contribution on the script exportfs , last release found here
(delivered 16 days ago):
https://github.com/ClusterLabs/resource-agents/tree/master/heartbeat

two things except if I'm mistaking:

1/ little typo : I think the "." is missing for .ocf-shellfuncs

2/ the script does not work if we set the OCF_RESKEY_clientspec="*" in
params of the exportfs resource,

due to the exportfs_monitor function :
when using * instead of hostname, the exportfs is displaying for example :
/alain <world>
and the line :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t;
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' | grep -q -x -F

"${OCF_RESKEY_directory} ${OCF_RESKEY_clientspec}"
returns 1 and then $OCF_NOT_RUNNING

So I don't know if it is the more elegant manner to fix this little issue,

but I've added at the begining of exportfs_monitor :

exportfs_monitor ()
{
# exportfs output wraps lines for long export directory names.
# We unwrap here with sed.
# We then do a literal match on the full line (grep -x -F)
if [ "${OCF_RESKEY_clientspec}" == "*" ]; then
CLIENTSPEC="<world>"
else
CLIENTSPEC=${OCF_RESKEY_clientspec}
fi

and use $CLIENTSPEC on the grep :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t;
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' | grep -q -x -F

"${OCF_RESKEY_directory} ${CLIENTSPEC}

With this tuning, it works fine.

Regards
Alain
_______________________________________________
Linux-HA mailing list
Linux-HA [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

_______________________________________________
Linux-HA mailing list
Linux-HA [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems


alain.moulle at bull

Jul 29, 2012, 11:30 PM

Post #3 of 3 (152 views)
Permalink
Re: tuning of ocf script exportfs [In reply to]

Hi,

By the way, with regard to a very older version of ocf script exportfs,
there was a exportfs_backup function which
was launching the backup_rmtab every 2 seconds. In the new script , the
backup_rmtab is executed at each
monitoring call , meaning every "op monitor interval value". But it seems
not reasonable to set this interval to 2s ,
meaning it would be at least 30s ... is there any recommandation about
this ? isn't there any drawback to do a
backup rmtab only every 30s ? particularly in case of one node breakdone
leading to failover ?

Thanks
Alain



De : alain.moulle [at] bull
A : linux-ha [at] lists
Date : 26/07/2012 16:49
Objet : [Linux-HA] tuning of ocf script exportfs
Envoyé par : linux-ha-bounces [at] lists



Hi Dejan

a little contribution on the script exportfs , last release found here
(delivered 16 days ago):
https://github.com/ClusterLabs/resource-agents/tree/master/heartbeat

two things except if I'm mistaking:

1/ little typo : I think the "." is missing for .ocf-shellfuncs

2/ the script does not work if we set the OCF_RESKEY_clientspec="*" in
params of the exportfs resource,

due to the exportfs_monitor function :
when using * instead of hostname, the exportfs is displaying for example :
/alain <world>
and the line :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t;
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' | grep -q -x -F

"${OCF_RESKEY_directory} ${OCF_RESKEY_clientspec}"
returns 1 and then $OCF_NOT_RUNNING

So I don't know if it is the more elegant manner to fix this little issue,

but I've added at the begining of exportfs_monitor :

exportfs_monitor ()
{
# exportfs output wraps lines for long export directory names.
# We unwrap here with sed.
# We then do a literal match on the full line (grep -x -F)
if [ "${OCF_RESKEY_clientspec}" == "*" ]; then
CLIENTSPEC="<world>"
else
CLIENTSPEC=${OCF_RESKEY_clientspec}
fi

and use $CLIENTSPEC on the grep :
exportfs | sed -e '$! N; s/\n[[:space:]]\+/ /; t;
s/[[:space:]]\+\([^[:space:]]\+\)\(\n\|$\)/ \1\2/g; P;D;' | grep -q -x -F

"${OCF_RESKEY_directory} ${CLIENTSPEC}

With this tuning, it works fine.

Regards
Alain
_______________________________________________
Linux-HA mailing list
Linux-HA [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

_______________________________________________
Linux-HA mailing list
Linux-HA [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Linux-HA users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.