[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Linux-cluster] config issuse or bug in 4.u4 for nfs exports



Quoting Pavlos Parissis <p_pavlos freemail gr>:

Hi,

I am building a NFS Active/Passive cluster using ext3 filesystem and I
don't know if I have a configuration issue or I come across a bug.

My service, nfs1, is started without problems but there is no nfs
export available.

I went through the list and I found this thread
http://marc.info/?l=redhat-linux-cluster&m=118764091712577&w=2

I tried to find any evidence of this by looking at bug reports and the
release notes of 4.5,4.6 and 5.0 but I couldn't find any thing.

Could you please someone give me an idea?

Well I couldn't find why cluster couldn't handle NFS share.
As a result I made a small script for starting/stopping the NFS shares and modified my service accordingly.


 <service domain="ThirdDomain" name="nfs1" autostart="1" recovery="relocate">
      <ip monitor_link="1" address="10.10.21.73"/>
      <ip monitor_link="1" address="10.10.21.142"/>
<fs device="/dev/sdb2" mountpoint="/nfs_omg_data" force_unmount="1" name="/nfs_omg_data" fstype="ext3"/> <fs device="/dev/sdb3" mountpoint="/nfs_apps" force_unmount="1" name="/nfs_apps" fstype="ext3"/> <fs device="/dev/sdb4" mountpoint="/nfs_cdr_central" force_unmount="1" name="/nfs_cdr_central" fstype="ext3"/>
      <script name="nfs1" file="/usr/local/wsb/scripts/rhc_nfs1"/>
    </service>


ocsi3# cat /usr/local/wsb/scripts/rhc_nfs1
#!/bin/sh
. /opt/ngp/tools/lib/ud_functions
check_daemons()
{
   NFS_DAEMONS="nfsd rpc.mountd rpc.statd"

   for daemon in $NFS_DAEMONS; do
       ps -ef | grep "$daemon" | grep -v grep >/dev/null 2>&1
       if [ $? -ne 0 ]; then
          log "NFS daemon $daemon is not running."
          return 1
       fi
   done

   return 0
}
check_shares()
{
   NFS_SHARES="/nfs_omg_data /nfs_apps /nfs_cdr_central"

   for share in $NFS_SHARES; do
       exportfs|grep "$share" >/dev/null 2>&1
       if [ $? -ne 0 ]; then
          log "$share is not shared."
          return 1
       fi
   done

   return 0
}
check_mounts()
{
  MOUNTS="/nfs_cdr_central /nfs_omg_data  /nfs_apps"

  for mount in $MOUNTS; do
     mount|grep $mount >/dev/null 2>&1
     if [ $? -ne 0 ]; then
        log "$mount file system isn't mounted"
        return 1
     fi
  done

  return 0
}

if [ "$1" = "start" ]; then
   log "Checking for NFS daemons"
   if ! check_daemons; then
      exit 1
   fi

   log "Checking for mounts"
   if ! check_mounts; then
      exit 1
   fi

   log "Starting NFS shares"
   exportfs -o rw 10.10.21.128/26:/nfs_omg_data
   exportfs -o rw 10.10.21.128/26:/nfs_apps
   exportfs -o rw 10.10.21.128/26:/nfs_cdr_central
   exit 0

elif [ "$1" = "stop" ]; then
   log "Stopping the NFS shares"
   exportfs -u 10.10.21.128/26:/nfs_omg_data
   exportfs -u 10.10.21.128/26:/nfs_apps
   exportfs -u 10.10.21.128/26:/nfs_cdr_central
   exit 0

elif [ "$1" = "status" ]; then
   if check_mounts; then
      # Disks mounted go and check daemons
      if ! check_daemons; then
         exit 1
      elif ! check_shares ; then
         exit 1
      fi
   else
      # Disks not mounted
      exit 1
   fi

  exit 0

else
   log "Unknown argument exit nicely"
   exit 0
fi





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]