User Tools

Site Tools


nfs_server_on_centos_6

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
nfs_server_on_centos_6 [2015/03/03 15:01] – external edit 127.0.0.1nfs_server_on_centos_6 [2015/03/05 08:56] (current) herwarth
Line 1: Line 1:
-===Install the packages===+======NFS server on CentOS 6====== 
 +=====Installation===== 
 +====Packages====
  
   yum groupinstall "NFS server"   yum groupinstall "NFS server"
  
-===Configure the NFS options===+=====Configuration===== 
 +====NFS options====
 In this example we disable NFS4 In this example we disable NFS4
  
-  vi /etc/sysconfig/nfs+<code - /etc/sysconfig/nfs
 +# Port rquotad should listen on. 
 +RQUOTAD_PORT=875 
 +# TCP port rpc.lockd should listen on. 
 +LOCKD_TCPPORT=32803 
 +# UDP port rpc.lockd should listen on. 
 +LOCKD_UDPPORT=32769 
 +# Turn off v4 protocol support 
 +RPCNFSDARGS="-N 4" 
 +# Number of nfs server processes to be started. 
 +# The default is 8.  
 +RPCNFSDCOUNT=128 
 +# Port rpc.mountd should listen on. 
 +MOUNTD_PORT=892 
 +# Port rpc.statd should listen on. 
 +STATD_PORT=662 
 +# Outgoing port statd should used. The default is port 
 +# is random 
 +STATD_OUTGOING_PORT=2020 
 +# Specify callout program  
 +# To enable RDMA support on the server by setting this to 
 +# the port the server should listen on 
 +RDMA_PORT=20049  
 +</code>
  
-  # Port rquotad should listen on. +====Iptables==== 
-  RQUOTAD_PORT=875 +<code - /etc/sysconfig/iptables>    
-  # TCP port rpc.lockd should listen on. +. 
-  LOCKD_TCPPORT=32803 +. 
-  # UDP port rpc.lockd should listen on. +-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT 
-  LOCKD_UDPPORT=32769 +-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT 
-  # Turn off v4 protocol support +-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT 
-  RPCNFSDARGS="-N 4" +-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT 
-  # Number of nfs server processes to be started. +-A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT 
-  # The default is 8.  +-A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT 
-  RPCNFSDCOUNT=128 +-A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT 
-  # Port rpc.mountd should listen on. +-A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT 
-  MOUNTD_PORT=892 +-A INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT 
-  # Port rpc.statd should listen on. +-A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT 
-  STATD_PORT=662 +-A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT 
-  # Outgoing port statd should used. The default is port +
-  # is random +
-  STATD_OUTGOING_PORT=2020 +</code> 
-  # Specify callout program  +====Hardware RAID====
-  # To enable RDMA support on the server by setting this to +
-  # the port the server should listen on +
-  RDMA_PORT=20049  +
- +
-===Configure iptables=== +
-  vi /etc/sysconfig/iptables +
-  vi /etc/sysconfig/ip6tables +
-Add the following lines +
-   +
-  -A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT +
-  -A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT +
-  -A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT +
-  -A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT +
-  -A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT +
-  -A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT +
-  -A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT +
-  -A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT +
-  -A INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT +
-  -A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT +
-  -A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT +
-===Configure hardware RAID===+
 Configure the cache ratio: 75% read, 25% write. On HP we use hpacucli Configure the cache ratio: 75% read, 25% write. On HP we use hpacucli
  
Line 53: Line 58:
   hpacucli ctrl slot=0 modify cacheratio=75/25   hpacucli ctrl slot=0 modify cacheratio=75/25
  
-===Configure Linux parameters===+====Linux parameters====
  
-  vi /etc/rc.d/rc.local+<code - /etc/rc.d/rc.local
 +# NFS ESXi 
 +# Configuring the Linux I/O Scheduler 
 +echo "noop" > /sys/block/sda/queue/scheduler 
 +# Configuring Disk Read-Ahead. Set read-ahead cache to 512KB 
 +/sbin/blockdev --setra 1024 /dev/sda 
 +</code> 
 +<code - /etc/sysctl.conf> 
 +
 +.   
 +# ESXi NFS settings 
 +net.core.rmem_max = 16777216 
 +net.core.wmem_max = 16777216 
 +net.ipv4.tcp_rmem = 4096 87380 16777216 
 +net.ipv4.tcp_wmem = 4096 65535 16777216 
 +net.core.netdev_max_backlog = 30000 
 +vm.dirty_background_ratio = 1 
 +vm.dirty_expire_centisecs = 1000 
 +vm.dirty_ratio = 10 
 +vm.dirty_writeback_centisecs = 100 
 +vm.vfs_cache_pressure = 40 
 +</code>
  
-  # NFS ESXi +====Mount and exports====
-  # Configuring the Linux I/O Scheduler +
-  echo "noop" > /sys/block/sda/queue/scheduler +
-  # Configuring Disk Read-Ahead. Set read-ahead cache to 512KB +
-  /sbin/blockdev --setra 1024 /dev/sda+
  
-  vi /etc/sysctl.conf +<code - /etc/fstab> 
- +
-  # ESXi NFS settings +
-  net.core.rmem_max = 16777216 +/dev/mapper/system-nfs  /mnt/storage            ext4    defaults,noatime,data=journal 1 2 
-  net.core.wmem_max = 16777216 +</code>
-  net.ipv4.tcp_rmem = 4096 87380 16777216 +
-  net.ipv4.tcp_wmem = 4096 65535 16777216 +
-  net.core.netdev_max_backlog = 30000 +
-  vm.dirty_background_ratio = 1 +
-  vm.dirty_expire_centisecs = 1000 +
-  vm.dirty_ratio = 10 +
-  vm.dirty_writeback_centisecs = 100 +
-  vm.vfs_cache_pressure = 40 +
- +
-===Configure mount and exports=== +
- +
-  vi /etc/fstab +
- +
-  /dev/mapper/system-nfs  /mnt/storage            ext4    defaults,noatime,data=journal 1 2+
  
   mount -a   mount -a
  
-  vi /etc/exports +<code - /etc/exports> 
- +
-  /mnt/storage/vmware *(rw,insecure,sync,no_wdelay,no_root_squash)+. 
 +/mnt/storage/vmware *(rw,insecure,sync,no_wdelay,no_root_squash) 
 +</code>
  
 +{{tag>centos}}
nfs_server_on_centos_6.1425394911.txt.gz · Last modified: (external edit)