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

Both sides previous revisionPrevious revision
Next revision
Previous revision
nfs_server_on_centos_6 [2015/03/05 08:03] herwarthnfs_server_on_centos_6 [2015/03/05 08:56] (current) herwarth
Line 5: Line 5:
   yum groupinstall "NFS server"   yum groupinstall "NFS server"
  
-=====Configure=====+=====Configuration=====
 ====NFS options==== ====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. 
-  # Port rquotad should listen on. +RQUOTAD_PORT=875 
-  RQUOTAD_PORT=875 +# TCP port rpc.lockd should listen on. 
-  # TCP port rpc.lockd should listen on. +LOCKD_TCPPORT=32803 
-  LOCKD_TCPPORT=32803 +# UDP port rpc.lockd should listen on. 
-  # UDP port rpc.lockd should listen on. +LOCKD_UDPPORT=32769 
-  LOCKD_UDPPORT=32769 +# Turn off v4 protocol support 
-  # Turn off v4 protocol support +RPCNFSDARGS="-N 4" 
-  RPCNFSDARGS="-N 4" +# Number of nfs server processes to be started. 
-  # Number of nfs server processes to be started. +# The default is 8.  
-  # The default is 8.  +RPCNFSDCOUNT=128 
-  RPCNFSDCOUNT=128 +# Port rpc.mountd should listen on. 
-  # Port rpc.mountd should listen on. +MOUNTD_PORT=892 
-  MOUNTD_PORT=892 +# Port rpc.statd should listen on. 
-  # Port rpc.statd should listen on. +STATD_PORT=662 
-  STATD_PORT=662 +# Outgoing port statd should used. The default is port 
-  # Outgoing port statd should used. The default is port +# is random 
-  # is random +STATD_OUTGOING_PORT=2020 
-  STATD_OUTGOING_PORT=2020 +# Specify callout program  
-  # Specify callout program  +# To enable RDMA support on the server by setting this to 
-  # To enable RDMA support on the server by setting this to +# the port the server should listen on 
-  # the port the server should listen on +RDMA_PORT=20049  
-  RDMA_PORT=20049 +</code>
  
 ====Iptables==== ====Iptables====
-  vi /etc/sysconfig/iptables +<code - /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 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 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 2049 -j ACCEPT +-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -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 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 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 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 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 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 tcp -p tcp --dport 662 -j ACCEPT +-A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT 
-  -A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT+
 +
 +</code>
 ====Hardware RAID==== ====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 58: Line 60:
 ====Linux parameters==== ====Linux parameters====
  
-  vi /etc/rc.d/rc.local +<code - /etc/rc.d/rc.local> 
- +# NFS ESXi 
-  # NFS ESXi +# Configuring the Linux I/O Scheduler 
-  # Configuring the Linux I/O Scheduler +echo "noop" > /sys/block/sda/queue/scheduler 
-  echo "noop" > /sys/block/sda/queue/scheduler +# Configuring Disk Read-Ahead. Set read-ahead cache to 512KB 
-  # Configuring Disk Read-Ahead. Set read-ahead cache to 512KB +/sbin/blockdev --setra 1024 /dev/sda 
-  /sbin/blockdev --setra 1024 /dev/sda +</code> 
- +<code - /etc/sysctl.conf> 
-  vi /etc/sysctl.conf +. 
- +  
-  # ESXi NFS settings +# ESXi NFS settings 
-  net.core.rmem_max = 16777216 +net.core.rmem_max = 16777216 
-  net.core.wmem_max = 16777216 +net.core.wmem_max = 16777216 
-  net.ipv4.tcp_rmem = 4096 87380 16777216 +net.ipv4.tcp_rmem = 4096 87380 16777216 
-  net.ipv4.tcp_wmem = 4096 65535 16777216 +net.ipv4.tcp_wmem = 4096 65535 16777216 
-  net.core.netdev_max_backlog = 30000 +net.core.netdev_max_backlog = 30000 
-  vm.dirty_background_ratio = 1 +vm.dirty_background_ratio = 1 
-  vm.dirty_expire_centisecs = 1000 +vm.dirty_expire_centisecs = 1000 
-  vm.dirty_ratio = 10 +vm.dirty_ratio = 10 
-  vm.dirty_writeback_centisecs = 100 +vm.dirty_writeback_centisecs = 100 
-  vm.vfs_cache_pressure = 40+vm.vfs_cache_pressure = 40 
 +</code>
  
 ====Mount and exports==== ====Mount and exports====
  
-  vi /etc/fstab +<code - /etc/fstab> 
- +
-  /dev/mapper/system-nfs  /mnt/storage            ext4    defaults,noatime,data=journal 1 2+. 
 +/dev/mapper/system-nfs  /mnt/storage            ext4    defaults,noatime,data=journal 1 2 
 +</code>
  
   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}} {{tag>centos}}
nfs_server_on_centos_6.1425542632.txt.gz · Last modified: by herwarth