Subscribe:

Ads 468x60px

Pages

Wednesday, April 20, 2011

Problem: reboot my server using autofs while my LDAP server is down


I'm using Autofs and LDAP for mounting my home directories via nfs.  In general, everything seems to work fine.  However, I have one small problem.

If I reboot my server using autofs while my LDAP server is down, I get the following error message in my logs:
automount[3358]: bind_ldap_anonymous: lookup(ldap): Unable to bind to the
LDAP server: (default), error Can't contact LDAP server

Which is understandable, since my ldap server is temporarily down?

My problem, however, is that once my ldap server is back up, autofs never seems to retry to connect to it, so all my /home mounts fail.  Basically, it means I have to make sure that my LDAP server is never down while another server is rebooting.

I figure there must be something in the configuration file that would allow me to tweak this to indicate to autofs to recheck the ldap server periodically to see if it has come back up, but can't seem to find anything.
 
My /etc/sysconfic/autofs file is pretty plain:

# TIMEOUT - set the default mount timeout (default 600).
#
TIMEOUT=300
# LOGGING - set default log level "none", "verbose" or "debug"
#
LOGGING="verbose"
Read more...

Configuring AutoFS


Introduction:

Auto-mounts are mounted only as they are accessed, and are unmounted after a period of inactivity. Because of this, automounting NFS/Samba shares conserves bandwidth and offers better overall performance compared to static mounts via fstab.

Configuration Files:

The configuration is done with the help of 2 files.
  1. /etc/auto.master: It is a main configuration file. It holding the mount points.
  2. /etc/auto.nfs1:  It  is a mount point file providing the system options for this specific mount point.
  3. /etc/auto.misc: To find the mount options and the key associated to the file system. 

Installation:

Vertify whether autofs installed or not
root# rpm -qa autofs

if not installed then install it
root# yum install -y autofs*

Vertify installed version
root# rpm -qa autofs

View list of files releated to autofs
root# rpm -ql autofs

Configuring autofs:

Edit the /etc/auto.master file
root# cd /etc
root# vim /etc/auto.master
/nfs1  /etc/auto.share
+auto.master
Note: Local mount point nfs1 uses the /etc/auto.share config file

Edit the /etc/auto.shares for automount your remote host(1982.168.0.254)
root# vim /etc/auto.share
nfs1 –fstype=nfs 192.168.0.254:/share
Note: above step should follow the syntax as {mount point} {mount point} {location}

Create a directory /nfs1
root# mkdir /nfs1

Restart the autofs service
root# service autofs restart

Check the remote host’s files exists or not(it show empty directory)
root# ls –l /nfs1

But when access the directory with remote hosts directory. It will display all the content of the remote hosts.
root# cd /nfs1
root# ls –ltr share1

Check the service will run at boot time or not
root# chkconfig --list autofs
To start service at boot time:
root# chkconfig autofs on

Verify the service will run at boot time
root# chkconfig --list autofs

automount:

Automout works from an initial mount point (the one found by autofs to start automount) and from a new map describing the features of this initial mount point. The map associated to the automount will hold all required information for mounting the file system automatically (hence the name). This automatic mount is done as soon as someone tries to accesses something in the directory tree starting from the mount point. Next, the file systems are automatically "unmount" after an inactive period (the default time out is 5 minutes).

The default value of several general settings may be changed in the configuration file /etc/sysconfig/autofs.

To change the default time according to our wish then access the /etc/sysconfig/auto file then change the DEFAULT_TIMEOUT=300(default time set by system is 300 seconds i.e. 5 Minutes).

To change default time to 30 seconds
root# vim /etc/sysconfig/auto
DEFAULT_TIMEOUT=30
root# service autofs reload


Read more...

Tuesday, April 5, 2011

PING command

PING:


PING stands for Packet Internet Groper. This is the tool that diagnosis ICMP protocols troubles on ICMP network. Within TCP/IP there are many protocols(i.e TCP, UDP, etc..). There is one protocols sweep in TCP protocol is called ICMP(Internet Control Messaging Protocol) protocol. It is regularly designed for facilitate troubleshooting or diagnosing problems of IP based network.

To view the full path of ping command:
#which ping
/bin/ping

To view the package of the ping command:
#rpm -qf ping
iputils-200020927-2

Ping on a client or on host or on server realize on client interface to the ICMP protocol. So when pinging on host functioning as client. The host that responses functioning as server to response on our request. When you ping a host or requests to the host then it is called an echo request  and when host replies then it is called an echo reply.

Ping function as client server protocol. ping is used for diagnosis and also used for DNS resolution (It is way to test whether the DNS resolution is working or not).

#ping www.yahoo.com

It's going on responding util pressing the Ctrl+c. When
Unless we break the process using Ctrl+c or It never end. Ping sends packets within one second

If name resulotion is not functioning on this machine, the response will not come back. Then see the name resolution settings. Those name resolutions are responding. So then to test the name resolution on your system simply use the dig and nslookup tools. It is another way to ping the host.

To send only 3 pings to server instead of sending indefinite number of times:
#ping -c 3 www.yahoo.com


To send only 6 pings to server:
#ping -c 6 www.yahoo.com

if any sort of firewalls or routers at the edge of the network prevents ping echo requests type8 and also it prevents echo response type0 from leaving the network consequently we can ping the network  in between our machine and other machine which you want to ping. Then chances are ping will work. Does mean that host is down. It simply means the ICMP is been blocked. 

Read more...