Operating System - HP-UX
1827459 Members
4538 Online
109965 Solutions
New Discussion

Re: Restrict NFS for servers in MCSG

 
Narendran
Occasional Advisor

Restrict NFS for servers in MCSG

Hi All,

I wish do the same like the below in MCSG enviroment :-
/usr/sap/trans -access=slahp09:slahp01:slahp02:sapserv7:faxmac
/sapmnt/D01 -access=slahp09:slahp01:slahp02:sapserv7:faxmac

I do have NFS toolkit. So where in dbci.cntl do i add some lines to restrict NFS only to certain servers.

Thanks & Regards,

Naren.S
9 REPLIES 9
Stefan Farrelly
Honored Contributor

Re: Restrict NFS for servers in MCSG

nfs restrictions go in /etc/exports. If you want the exports dependant on which package is running where you need to modify the package startup scripts to copy your modified exports file to /etc/exports, then run exportfs -a to make it active.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Narendran
Occasional Advisor

Re: Restrict NFS for servers in MCSG

But for MCSG I guess /etc/exports is not being used cause automounter is running.
But I think the NFS toolkit is bypassing by using exportfs -i.
Stefan Farrelly
Honored Contributor

Re: Restrict NFS for servers in MCSG

Take a look in /etc/cmcluster//startup.sh or shutdown.sh. If someone is doing an exportfs -i explicitely then you can modify it here.

Automounter can run alongside nfs, you can mount filesystems either way, but nfs will still use the exports file, unless someone has used the -i option.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Narendran
Occasional Advisor

Re: Restrict NFS for servers in MCSG

I dont have any startup/shutdown scripts,but only dbci.cntl
the exportfs -i is in the dbci.cntl. I'm running SAP R/3 as the application and oracle as well.
Geoff Wild
Honored Contributor

Re: Restrict NFS for servers in MCSG

You restrict in the hanfs.sh script.

Like this:

XFS[0]="-o access=pc0003f:pc0004f:pc0110f:pc0111f:pc0112f:iprdbf:iprcif:iqadbcif:pctransf:pc1000:pc1005,root=pc0003f:pc0004f:pc0110f:pc0111f:pc0112f:iprdbf:iprcif:pctransf:iqadbcif:pc1000:pc1005 /export/usr/sap/trans"

In your cntl file you should have something like:

function verify_ha_nfs
{
HA_NFS_SCRIPT="${0%/*}/hanfs.sh"

if [[ -x $HA_NFS_SCRIPT ]]
then

$HA_NFS_SCRIPT $1

#
# The hanfs.sh script has the return values as follow:
#
# 0 - success
# 1 - fails
#
test_return 50
fi
}

If you want, I can post my scripts...


Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Narendran
Occasional Advisor

Re: Restrict NFS for servers in MCSG

Hi All,

'To make it easier, I've attached the dbci.cntl file where the exportfs -i is defined. Maybe you can give me recommendation where to edit.

Thanks & Regards
Geoff Wild
Honored Contributor

Re: Restrict NFS for servers in MCSG

Okay - if you want to keep it in the cntl file:

# NFS: Specifies all exported NFS directories with export options. The
# directories must be defined in the above mounted file system FS list.
# These variables are used by the command "exportfs -i" to export
# the file systems and the command "exportfs -u" to unexport the file
# systems.
# Example: XFS[0]="-o ro /pkg1"
# Example: XFS[1]="/pkg2"
#XFS[0]=

XFS[0]="-o access=slahp09:slahp01:slahp02:sapserv7:faxmac, root=slahp09:slahp01:slahp02:sapserv7:faxmac /export/sapmnt/P01"

XFS[1]="-o access=slahp09:slahp01:slahp02:sapserv7:faxmac, root=slahp09:slahp01:slahp02:sapserv7:faxmac /export/usr/sap/trans"


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Animesh Chakraborty
Honored Contributor

Re: Restrict NFS for servers in MCSG

Hi,
There should be one seperate scripts called hanfs.sh unser /etc/cmcluster/SID directory.
and your dbci.cntl should have following line
#
function verify_ha_nfs
{
HA_NFS_SCRIPT="${0%/*}/hanfs.sh"

if [[ -x $HA_NFS_SCRIPT ]]
then

$HA_NFS_SCRIPT $1

#
# The hanfs.sh script has the return values as follow:
#
# 0 - success
# 1 - fails
#
test_return 50
fi
}
Did you take a backup?

Re: Restrict NFS for servers in MCSG

What version of the ServiceGuard Extension for SAP are you using? The older versions wrapped up the NFS export code in their own scripts, while the newer versions utilised the NFS Toolkit via hanfs.sh

HTH

Duncan

I am an HPE Employee
Accept or Kudo