error: "Invalid argument" setting key "net.ipv4.ip_local_port_range"

dayong2015發表於2014-07-31
今天在搭建10g RAC的時候配置核心引數出現如下問題,記錄下來。
以roo使用者登入,按照Oracle 10g官方文件,起初對 /etc/sysctl.conf 的配置如下:
kernel.shmmax = 3126704128
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 25032000100128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 102465000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
使配置檔案生效,出現如下錯誤提示:
[root@HHDB120 ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 3126704128
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 25032000100128
fs.file-max = 65536
error: "Invalid argument" setting key "net.ipv4.ip_local_port_range"
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
這個配置參考於cache伺服器varnish的推薦配置和SunOne 伺服器系統最佳化的推薦配置。這裡有個對埠範圍的限制如果不做修改原始的返回只有2.8萬個port區間。
對上述記憶體引數的具體操作命令示例:
檢視埠範圍,如下:

[root@HHDB120 ~]# sysctl -a | grep range
net.ipv4.ip_local_port_range = 32768    61000
修改核心引數的配置net.ipv4.ip_local_port_range,將其值修改為3276861000 
使配置生效如下:
[root@HHDB120 ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 3126704128
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 25032000100128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 32768 61000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
配置生效,無錯誤提示,問題解決。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29634949/viewspace-1243043/,如需轉載,請註明出處,否則將追究法律責任。

相關文章