This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| nfs_server_on_centos_6 [2015/03/05 08:03] – herwarth | nfs_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 / | + | <code - / |
| - | + | # 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=" |
| - | RPCNFSDARGS=" | + | # 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 | + | </ |
| ====Iptables==== | ====Iptables==== | ||
| - | vi / | + | <code - / |
| - | vi / | + | . |
| - | 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 | + | . |
| + | . | ||
| + | </ | ||
| ====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 / | + | <code - / |
| - | + | # NFS ESXi | |
| - | | + | # Configuring the Linux I/O Scheduler |
| - | # Configuring the Linux I/O Scheduler | + | echo " |
| - | echo " | + | # Configuring Disk Read-Ahead. Set read-ahead cache to 512KB |
| - | # Configuring Disk Read-Ahead. Set read-ahead cache to 512KB | + | / |
| - | / | + | </ |
| - | + | <code - / | |
| - | | + | . |
| - | + | . | |
| - | # 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 |
| + | </ | ||
| ====Mount and exports==== | ====Mount and exports==== | ||
| - | vi / | + | <code - /etc/fstab> |
| - | + | . | |
| - | / | + | . |
| + | / | ||
| + | </ | ||
| mount -a | mount -a | ||
| - | vi / | + | <code - / |
| - | + | . | |
| - | / | + | . |
| + | / | ||
| + | </ | ||
| {{tag> | {{tag> | ||