標籤:style color 使用 os io 檔案 ar log
cat <<EOF >>/etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc unlimited
* hard nproc unlimited
EOF
cat <<EOF >>/etc/security/limits.d/90-nproc.conf
* soft nproc unlimited
root soft nproc unlimited
EOF
重新登入機器生效
cat <<EOF >>/etc/sysctl.conf
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_max_tw_buckets=50000
net.nf_conntrack_max=6553600
net.netfilter.nf_conntrack_max=6553600
sysctl -p 執行生效
報錯:
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
解決方案如下:
modprobe bridge
echo "modprobe bridge" >>/etc/rc.local
error: "net.ipv4.ip_conntrack_max" is an unknown key
error: "net.ipv4.netfilter.ip_conntrack_max" is an unknown key
error: "net.ipv4.netfilter.ip_conntrack_tcp_timeout_established" is an unknown key
解決:
modprobe ip_conntrack
echo "modprobe ip_conntrack" >> /etc/rc.local
modprobe(module probe)
功能說明:自動處理可載入模組.
語 法:modprobe [-acdlrtvV][--help][模組檔案][符號名稱 = 符號值]
補充說明:modprobe可載入指定的個別模組,或是載入一組相依的模組.modprobe會根據depmod所產生的相依關係,決定要載入哪些模組.若在載入過程中發生錯誤,在modprobe會卸載整組的模組.
參 數:
-a或--all 載入全部的模組.
-c或--show-conf 顯示所有模組的設定資訊.
-d或--debug 使用排錯模式.
-l或--list 顯示可用的模組.
-r或--remove 模組閑置不用時,即自動卸載模組.
-t或--type 指定模組類型.
-v或--verbose 執行時顯示詳細的資訊.
-V或--version 顯示版本資訊.
-help 顯示協助.
centos5 netfilter 參數設定檔目錄:/proc/sys/net/ipv4/netfilter/ip_conntrack_max
centos6 netfilter 參數設定檔目錄:/proc/sys/net/netfilter/nf_conntrack_max