Instalación Básica de un servidor NFS

1. Deshabilitación de SELinux


[root@rhel ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

2. Deshabilitación del cortafuegos
[root@rhel ~]#chkconfig iptables off
3. Instalación de los servicios necesarios para NFS
[root@rhel ~]# yum -y install nfs-utils rpcbind
4. Habilitación de los servicios necesarios para NFS
[root@rhel ~]# chkconfig nfs on
[root@rhel ~]# chkconfig rpcbind on
[root@rhel ~]# chkconfig nfslock on

5. Configuración de NFS
[root@rhel ~]# vim /etc/sysconfig/nfs
RQUOTAD_PORT=875
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
STATD_PORT=662
STATD_OUTGOING_PORT=2020

6. inicio de los servicios
[root@rhel ~]# service rpcbind start
[root@rhel ~]# service nfs start
[root@rhel ~]# service nfslock start

7. Configuración de /etc/exports
[root@rhel ~]# vim /etc/exports
/datos 192.168.1.0/24(rw,sync)

8. estado del servicio NFS
[root@rhel ~]# nfstat

Configuración en el cliente

1. Instalación de utilidades
[root@rhel ~]# yum -y install nfs-utils rpcbind
2. Inicialización de los servicios

[root@rhel ~]#  service rpcbind start
[root@rhel ~]#  service netfs start
[root@rhel ~]#  service nfslock start

3. Verificación
[root@rhel ~]# rpcinfo -p
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 53446 status
100024 1 tcp 37562 status
100021 1 udp 45403 nlockmgr
100021 3 udp 45403 nlockmgr
100021 4 udp 45403 nlockmgr
100021 1 tcp 33077 nlockmgr
100021 3 tcp 33077 nlockmgr
100021 4 tcp 33077 nlockmgr

4. Edición del archivo /etc/fstab
[root@rhel ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Aug 9 20:36:02 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_rhel-lv_root / ext4 defaults 1 1
UUID=19974464-29a1-43fd-b5ba-a8ff5356bc78 /boot ext4 defaults 1 2
/dev/mapper/vg_rhel-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
192.168.1.1:/datos /datos nfs hard,nfsvers=2 0 0

5. Verificación

En el servidor
[root@rhel datos]# echo "Hola, soy el servidor , la hora es `date` , mis ips son `ip add
show| grep /24` y la hora es `date`" > hora_servidor.txt

En el cliente
[root@rhel ~]# date && cat /datos/hora_servidor.txt
jue ago 11 01:43:54 CDT 2011
Hola, soy el servidor , la hora es jue ago 11 01:43:09 CDT 2011 , mis ips son inet
192.168.1.1/24 brd 192.168.1.255 scope global eth2
inet
192.168.1.2/24 brd 192.168.1.255 scope global eth3 y la hora es jue ago 11 01:43:09 CDT 2011

Advertisement
  1. Dejar un comentario

Deja un comentario

Fill in your details below or click an icon to log in:

Logo de WordPress.com

You are commenting using your WordPress.com account. Log Out / Cambiar )

Twitter picture

You are commenting using your Twitter account. Log Out / Cambiar )

Facebook photo

You are commenting using your Facebook account. Log Out / Cambiar )

Connecting to %s

Seguir

Get every new post delivered to your Inbox.