Linux操作系统09 模块内核 公司培训

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 46

Linux 操作 系统

软件模 块和内核安 装配置

周炯
上海艾基信 息技术有限 公司

Acegene IT Co. Ltd. 1


内容提 要
•1 软件安装与配置
•2 开机和关机
•3 系统服务
•4 内核管理
•5 模块管理
•6 核心参数

Acegene IT Co. Ltd. 2


1 软件安 装与配置
• 本部分将讨论两种最常用的软件安装方法
:使用 Red Hat Package Manager 软件
包管理工具软件( RPM )和自行编译源代
码。
• 本部分中所有需要输入的命令都是以根用
户的身份输入的。因此最好是直接以根用
户身份登录进入系统。

Acegene IT Co. Ltd. 3


RPM Package Manager
• Manage software packages
– Install, upgrade, remove, verify, query, build
• Package files referred to as RPMs
– Distributed by the vendor
– Include files to be installed plus some install
scripts
• Source RPMs contain the source code
– e.g., kernel-2.4.9-e.24.src.rpm
• Binary RPMs contain the pre-built binaries
– e.g., kernel-2.4.9-e.24.i686.rpm
– Choose the highest architecture the machine
can use
• e.g., i686, i586, i486, i386 (uname -m)
Acegene IT Co. Ltd. 4
1 Red Hat Package Manager
• 一些可以获得到 rpm 软件的站点
• http://www.rpmfind.net
• ftp://ftp.redhat.com/pub/contrib
• http://www.linuxapps.com

• rpm 的老家
• http://www.rpm.org

Acegene IT Co. Ltd. 5


1 安装新 的软件包
• 普通安装:
– #rpm -i bc-1.05a-4.i386.rpm
• 升级软件:
– #rpm -U bc-1.05a-4.i386.rpm
• 强行安装:
– #rpm -i --force -nodeps packagename.rpm
• 其他参数
– -h 使用符号“ #” 指示安装进度,与 -v 参数一起使用
时显示效果更好
– -v 告诉 RPM 报告每一步操作的情况
– --test 这个参数并不进行真正的安装;它只是用来检
查安装能否成功地完成。用于检查依赖关系是否安全

– --percent 显示已完成的百分比指示安装进度。如果
从另外一个程序(比如某个 Perl 脚本程序)中来运行
RPM ,并且想了解安装的进度时,这个参数就很方便
Acegene IT Co. Ltd. 6
1 查询软 件包
• 列出已经安装的全部软件包
– #rpm -qa
– #rpm -qa | grep -i 'name'
• 找出某个特定的文件到底是属于哪个软件包的
– #rpm -qf filename
• 查出某个已经安装的软件包的功能
– #rpm -qi packagename
• 查出软件包中的文件
– #rpm -qlp packagename
– 其中的 packagename 是准备要了解其组成文件的软
件包名称
• 列出已经安装的软件包中的文件 :
– #rpm –ql <pkg_name>
Acegene IT Co. Ltd. 7
1 反安装 (清除) 软件包
• RPM 反安装(清除)软件包
– #rpm -e packagename
– 其中的 packagename 是 rpm -qa 命令清单
中列出的软件包名称。

Acegene IT Co. Ltd. 8


1 gnorpm 工具
• 那些喜欢使用 GUI 工具简化操作的人们可
以使用 gnorpm 软件。虽然它是被设计运
行于 GNOME 环境的,但在 KDE 环境中也
运行得相当好。它可以完成通过命令行完
成的全部操作,但是用户就不必费力记住
那些命令行参数了。当然,这样做是要增
加一些系统开销的,这也是命令行版本依
然存在的原因。

Acegene IT Co. Ltd. 9


RPM Builds
• Builds consist of multiple phases:
– Prep – extracts and patches sources
– Build – make individual binaries
– Install – creates an install staging area
• Doesn’t install it for use on the local system!
• Additional actions come after Install
phase:
– Create a source RPM
– Create a binary RPM

Acegene IT Co. Ltd. 10


RPM Work Area
• Work area is used for building RPMs
• Location depends on vendor:
– Red Hat: /usr/src/redhat
– UnitedLinux: /usr/src/packages
• Directory structure contents:
– SPECS – RPM spec file
– SOURCES – source archives and patches
– BUILD – extracted source, objects, binaries
– RPMS – generated binary RPMs
– SRPMS – generated source RPMs

Acegene IT Co. Ltd. 11


RPM Build Procedure
1. First, install source RPM
– Populates SPECS and SOURCES
2. Run build phases
• Populates BUILD and creates staging area
3. Generate binary and/or source RPMs
• Populates RPMS and SRPMS, respectively
4. Clean up the build area
5. Install the new binary RPM if desired

Acegene IT Co. Ltd. 12


RPM Build Example
• All in one go:
# rpm ––rebuild stat-2.5-3.src.rpm
• Step-by-step:
# rpm –i stat-2.5-3.src.rpm
# cd /usr/src/redhat/SPECS
# rpm –bp stat.spec
# rpm –bc stat.spec
# rpm –bi stat.spec
# rpm –bl stat.spec
# rpm –ba stat.spec ––clean
# rpm –i ../RPMS/i386/stat-2.5-
3.i386.rpm

Acegene IT Co. Ltd. 13


2 开机和 关机
• 2.1 系统引导
• 2.2 启动文件
• 2.3 内核加载
• 2.4 init 进程

Acegene IT Co. Ltd. 14


2.1 启动 引导 - Boot Loaders
• Grub
– New and improved boot loader
– Configured via /boot/grub/menu.lst
– Not necessary to rerun after config changes
– Grub Configuration
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Red Hat Ent Linux AS (2.4.21-9.EL)
root (hd0,0)
kernel /boot/vmlinuz-2.4.21-9.EL root=LABEL=/
initrd /boot/initrd-2.4.21-9.EL.img
• LILO
– Original Linux boot loader
– Configured via /etc/lilo.conf
– Must run /sbin/lilo after any change to lilo.conf or binary
images (/boot/*)

Acegene IT Co. Ltd. 15


2.2 Boot Files
• Kernel binary:
– IA-32 (compressed): /boot/vmlinuz-$LABEL
– Other architectures: /boot/vmlinux-$LABEL
• initrd images:
– /boot/initrd-$LABEL
• System mapfile:
– /boot/System.map-$LABEL

By convention kernel binary, initrd and


system mapfile should share the same
$LABEL
Acegene IT Co. Ltd. 16
2.2 Initrd Images
• Kernel can’t mount root fs until
appropriate disk drivers are loaded
(except IDE)
• Initrd is loaded into memory by Grub/LILO
• Contains drivers needed to mount real
root fs
• Initrd must be rebuilt if a disk driver
changes
• To rebuild:
– RH: Use /sbin/mkinitrd
– SUSE: Use /sbin/mk_initrd

Acegene IT Co. Ltd. 17


2.3 开机 引导的步骤
• 加载内核
– 内核就必须完整地加载到可用 RAM 的第一个兆字节之
内。为了实现这个目的,内核是被压缩了的。
– 这个文件的头部包含着必要的代码,先设置 CPU 进入
安全模式(以此解除内存限制)再对内核的剩余部分
进行解压缩。
• 执行内核
– 内核在内存中解压缩之后,它就可以开始运行了
– 一旦内核启动运行,对硬件的检测就会决定需要对哪
些设备驱动程序进行初始化。
– 内核就能够挂装根文件系统,内核挂装了根文件系统
之后,
– 启动并运行一个叫做 init 的程序。
Acegene IT Co. Ltd. 18
2.4 开机 引导的步骤
• init 进程是所有进程的发起者和控制者。
– init 是第一个运行的进程,
– init 的进程编号永远是 1 。 Run Level Description
– 如果 init 出现问题,系统随之垮掉。 0 Halt
• init 进程有两个作用:
1 Single User
– 扮演终极父进程的角色。
• 失去了父进程的子进程就都会以 init 作为它们的 2 No Network
父进程。 3 MultiUser
• 快速执行一下 ps -af 命令可以列出许多父进程
ID ( parent process ID , PPID )为 1 的进程 4 (Unused)
来。
5 GUI
– 特定运行级别( runlevel )时运行相应的程序
, 6 Reboot
• init 读取配置文件 /etc/inittab ,决定启动的运
行级别( runlevel )。
• 缺省的运行级别
– 取决于配置文件 /etc/inittab
id:3:initdefault:
Acegene IT Co. Ltd. 19
2.4 开机 引导的步骤
• 命令脚本程序
– 执行 rc.sysinit
– 执行脚本在各个运行级别的子目录中
/etc/rc{RUNLEVEL}.d
• 都建立有到 /etc/rc.d/init.d 子目录中的符号链接。
– 但是这些符号链接并不使用命令脚本程序在
/etc/rc.d/init.d 子目录中原来的名字,
• 如果命令脚本程序是用来启动一个服务的,其符号链接的名字
就以字母 S 打头;
• 如果命令脚本程序是用来关闭一个服务的,其符号链接的名字
就以字母 K 打头
• 运行级别 3 和 5 中,在字母 S 后面使用了数字 99 ,这就保证
了这个命令脚本程序将作为引导过程的组成部分,其最后阶段
被执行。

Acegene IT Co. Ltd. 20


2.4 编写 自己的 rc 命令脚 本程序
• 有两种方法可以用来实现修改开机或者关机命令
脚本的目的:
– /etc/rc.d/rc.local
• 如果所做的修改只在引导开机的时候起作用,并且改动不大的
话,可以考虑简单地编辑一下 /etc/rc.d/rc.local 脚本。
• 这个命令脚本程序是在引导过程的最后一步被执行的。
– /etc/rc.d/init.d 子目录中添加一个命令脚本程序
• 适合修改比较细致,或者还要求关闭进程的操作必须使之明确
地停止运行
• 这个命令脚本程序必须可以接受 start 和 stop 参数并完成相
应的操作。

Acegene IT Co. Ltd. 21


3 系统服 务管理
• 用于在激活或停用启动时的服务
• 会修改 /etc/rcX.d 到 /etc/init.d 的 ( 符
号联接 symbolic links)
• 配置服务 chkconfig
– chkconfig --list
– chkconfig [--level 2345] [service] on|off
• 服务管理 service
– service [servicename] start|stop|restart

Acegene IT Co. Ltd. 22


使用 chkconfig

# See where sendmail is running


chkconfig --list sendmail

sendmail 0:off 1:off 2:off


3:on 4:off 5:on 6:off

# Turn off sendmail at levels 3 & 5


# too many spammers out there!
chkconfig --level 35 sendmail off

Acegene IT Co. Ltd. 23


4 内核
• 4.1 核心服务
• 4.2 内核编译和安装
• 4.3 模块加载卸载

Acegene IT Co. Ltd. 24


4.1 核心 级系统服务
• 核心系统服务: init 、 inetd 、 syslog 和
cron 。
• 本部分将对每一个核心系统服务、相应的
配置文件以及推荐的应用方式(如果有的
话)逐个进行介绍。

Acegene IT Co. Ltd. 25


4.2 安装 新内核
• Distributed by vendors in binary RPM
format
– Red Hat: kernel-{smp|enterprise}-*.i686.rpm
– UnitedLinux: ???
• RPM contents:
– /boot/vmlinuz-$LABEL
– /boot/System.map-$LABEL
– /lib/module/$LABEL/…
• RPM script generates a new initrd-$LABEL
and automatically adds a Grub entry
• If using LILO instead of Grub, then add
lilo.conf entry manually and re-run
/sbin/lilo
Acegene IT Co. Ltd. 26
4.2 编译 或者不编译 内核的原 因
• 编译的原因
– 运行一个程序,但是操作系统不支持该程序需要的功
能。
– 某个用户需要的内核功能—比如说用户的机器中装有
1GB 到 2GB 容量之间的 RAM 系统内存,只能重新编
译经过改动的内核才能够激活它。
– 用户希望对内核进行优化。
– 内核升级(驱动、 BUG 、意愿、功能、安全、有时间
进行升级)
• 为什么不编译
– 如果只是想给内核加上很少数量的功能的话,就没有
必要进行编译
• 编译内核可能会遇到的困难:面对众多的选项

Acegene IT Co. Ltd. 27


4.2 编译 (或升级) 内核
• 确定内核版本
– uname –r
• 确定内核是测试版还是正式版
– 按照下面的方法确定内核是测试版还是正式版

– 1) 忽略句号” .” 前的第一个数字。
– 2) 查看紧跟在句号” .” 后面的第二个数字。
– 在实验性版本中,紧跟在第一个句号后面的第
一个数字是一个奇数。
– 在成熟版本中,紧跟在第一个句号后面的第一
个数字是一个偶数。
– 举例来说,内核版本 2.2.5-15 是成熟版本,
而版本 2.3.4-12Acegene
是实验性版本IT Co. Ltd. 28
4.2 为内 核源代码打 补丁
• 内核经常需要小规模地升级。每次升级修复一个特定的 bug ,增加
一个新的驱动程序或者功能,或者实现其他任务。
• 1) 下载主版本的源代码和升级到新版本需要的每一个补丁的源代码

• 2) 使用 c d 命令把路径切 到 /usr/src 目录。
• 3) 使用 l s 命令列出目录中的内容清单。如果其中有一个
/usr/src/linux-version-ext 目录已经存在的话,一般情况这就是正
在已经运行的内核源代码。
• 4) 输入“ mkdir linux-newversion-ext” 命令建立一个新的源代码
目录。
• 5) 把下载的源代码和补丁都拷贝到这个目录中。
• 6) 使用 tar 命令对源代码进行解包操作。
• 7) 每一个补丁都应该分别并按顺序来处理。使用 tar 命令对第一个
补丁进行解包操作。
• 8) 使用 patch 命令把这个补丁打到源代码中去。输入“ patch -p0
original <patchname” 命令。
• 9) 依次打补丁
• 10) 准备编译
• 注意:在源代码中有时候会包括有一个名为 kernel-patch 的命令脚
本程序,该程序的功能是按顺序打所有的补丁。
Acegene IT Co. Ltd. 29
4.2 编译 内核
• 1) 获取需要安装的内核源代码。
• 2) 使用 tar 命令把源代码解包到 /usr/src/linux-version-ext 目录
• 3) 使用 cd 命令把路径切换到这个目录。
• 4) 选择你想使用的内核配置工具程序:
– 图形化功能最少,又很乏味的工具是 config 程序
– 一个图形化的工具是 menuconfig 程序
– 用于对内核进行配置的 X 工具总是最流行的,它叫做 xconfig
• Make [config|menuconfig|xconfig]
• 保存并退出内核配置程序之后,就已经有了用来配置内核设置值了。
• 5) 输入“ make dep” 命令建立依赖关系表,它定义了包括在内核
源代码中的某个特定文件如果发生了变化,就需要修改哪一个文件。
• 6) 输入“ make clean” 命令删除安装过程中产生的大量临时文件。
• 7) 输入“ make bzImage” 命令完成建立新内核的过程。
• 8) 输入“ make modules” 命令编译内核模块并把它们存放到相应
的位置。这是那些需要加载或者卸载的内核模块,另外还有一些固定
加载的。
• 9) 安装内核

Acegene IT Co. Ltd. 30


4.2 安装 内核
• 简单(自动)方法:
– make
– install
– make
– module_install
– reboot

Acegene IT Co. Ltd. 31


4.2 安装 内核
• 手工方法:
– 1) 使用 ls 命令列出 /boot 目录中的内容。
– 2) 备份 /boot/vmlinuz 文件。改名为 vmlinuz-version-ext 。
– 3) 拷贝编译过程中生成的 bzImage 文件到 /boot 目录中。
/usr/src/LINUX_PATH/arch/i386/boot/ 目录中找到。
– 4) 把 /boot 目录中的 bzImage 文件改名为“ vmlinuz” 。
– 5) 把 /usr/src/linux/System.map 文件拷 到 /boot 目录。
– 6) 把路径切 回 /usr/src/LINUX_PATH 目录。
– 7) “make module_install” 命令把内核模块存放到相应的位置

– 8) 如果 SCSI 硬盘要确保 SCSI 模块能够被及时加载。输入“
mkinitrd /boot/initrd-version-ext version-ext” 命令确保
SCSI 模块在引导过程中能够被及时加载。
– 9) 拷 initrd-version.img 到 /boot 目录,输入“ mkinitrd
/boot/initrd-version.img version-ext” 命令建立一个 RAM 盘
,它将在开机引导启动过程中加载,然后再从机器中被删除
– 10) 配置 LILO
Acegene IT Co. Ltd. 32
4.2 使用 RPM 包升级 内核的步 骤
• 从 Red Hat 公司的 Web 升级站点下载内核软件包,按照
下面的方法进行操作:
• 1) 以根用户身份登录进入系统。
• 2) 使用 rpm 命令升级下载的非内核文件,输入“ rpm
-Uvh packagename” 命令。警告千万要在手边准备好
一张引导启动盘以防新的内核出现问题。
• 3) 为确保不出现问题,最好安装一个新内核,而不是简
单的升级。安装内核文件需要输入“ rpm -ivh
packagename” 命令。
• 4) 从 /boot 目录中查看当前内核的名称是什么。格式应
该是“ /boot/vmlinuz-version-ext”
• 5) 输入“ mkinitrd /boot/initrd-version.img version-
ext” 命令建立一个 RAM 盘,它将在开机引导启动过程中
加载,然后再从机器中被删除。
• 7) 配置 LILO
Acegene IT Co. Ltd. 33
4.2 配置 LILO
• 1) 以根用户身份登录进入系统。
• 2) 使用“ vi /etc/lilo.conf” 之类的命令打开 /etc/lilo.conf 文件。
• 3) 除了被升级的部分,文件中新的数据段必须和用户当前运行的旧版本的有关内容保
持一致。举例来说,用户原来的数据可能是如下所示的样子:
• image = /boot/vmlinuz-2.2.5-15
• label =linux
• root = /dev/hda1
• initrd = /boot/initrd-2.2.5
• 4) 把光标移动到以“ image” 字样开头的那一行。
• 5) 输入“ 4yy” 拷贝 4 行文本到缓冲区。
• 6) 按下“ G” 键前进到文件末尾。
• 7) 按下“ o” 键在文件末尾插入一个新的文本行。
• 8) 按下 ESC 键返回到命令模式。
• 9) 按下“ p” 键把拷贝的文本复制到 /etc/lilo.conf 文件的末尾。
• 10) 在新的语句中做必要的修改。比如说,把 2.2.5-15 修改为 2.2.5-25 等等。
initrd 项的数据根据版本之间差异的大小可以修改也可以不改。
• 11) 再回到原始数据段部分,把它的 label 项改为“ linuxold” 之类的东西,这样用户
就可以把这两个数据段区分开了。
• 12) 输入“ :wq” 保存文件并退出编辑器程序。
• 13) 输入“ /sbin/lilo -v” 命令执行 LILO 程序,让新设置生效。
• 14) 重新启动

Acegene IT Co. Ltd. 34


5 加载核 心模块
• 安装模块:
– insmod <module name>.o
– modprobe <module name>
• 列出已经安装的模块 :
– lsmod
– cat /proc/modules
– 每一个已经安装的内核版本都应该有一个对应
的目录。把路径切换到当前运行内核对应的目
录中。

Acegene IT Co. Ltd. 35


5 卸载模 块
• 卸载模块
– rmmod <module name>
– 只对 idle 和不再使用的模块起作用
• 如果机器警告有其他的模块依赖于想要删除的这
个,但你还是想删除它的话,可以使用
– rmmod -r modulename

Acegene IT Co. Ltd. 36


5 检查坏 的模块 (Tainted Kernel)
• Use the /sbin/lsmod command to
see whether the kernel is tainted:

# /sbin/lsmod
Module Size Used by Not tainted
nfs 87936 0 (autoclean)
lockd 60224 0 (autoclean) [nfs]
sunrpc 79952 0 (autoclean) [nfs lockd]

iptable_filter 2912 0 (autoclean) (unused)


ip_tables 14080 1 [iptable_filter]
ad1848 23968 0 [cs4232]
ext3 70240 5
jbd 51004 5 [ext3]
6 核心参 数
• Control dynamic kernel configuration /
tuning
– Most parameters can be changed on the fly!
• Can be set multiple ways:
– In /etc/sysctl.conf: (Recommended)
• fs.aio-max-size=1048576
– In /etc/rc.local (RH) or /etc/boot.local (SUSE):
• echo 1048576 > /proc/sys/fs/aio-max-size
– Using sysctl:
• sysctl –w fs.aio-max-size=1048576
• Will be lost on reboot if not in
/etc/sysctl.conf

Acegene IT Co. Ltd. 38


6 shmfs
• Mount tmpfs on /dev/shm via fstab
• Option “size=8g” means 8GB
• Option “size=??” can be larger than
physical RAM
• Required by Oracle for VLM mode
– Only used for buffer cache
– Never used in non-VLM mode

Acegene IT Co. Ltd. 39


6 IA-32 系统上 使用超过 4g 内存
• Bigpages (x86)
– Separate memory pool using large hw pages
– Non-swappable
– Must be set aside at boot time
• Boot with kernel parameter “bigpages=8192MB”
– Use Workaround in bug 3080838
• To prevent Kernel panic in sshd_config set:
– UsePrivilegeSeparation no -OR-
– Compression no (preferred)
• Hugetlbfs (RHEL)
– Similar to bigpages but, configured at runtime, no need
to reboot:
• Shutdown instance (free memory)
• echo 600 > /proc/sys/vm/hugetlb_pool
– Ask for 600MB
• cat /proc/sys/vm/hugetlb_pool
– Verify you got 600MB, if not might need to reboot
• Startup instance
– Verify usage in /proc/meminfo

Acegene IT Co. Ltd. 40


6 参数 : 异步 IO - async io requests
• /proc/sys/fs/aio-max-size
– Max size of data passed to driver at once
– Requests larger than this will be broken up
– Next chunk will not be submitted until the
previous one has completed
– Default value: 131072
– Unit: bytes
• /proc/sys/fs/aio-max-nr
– Max number of aio requests system-wide
– Limits number of structures allocated, not the
number of requests in flight!
– Each Oracle process allocates 1024
– Default value: 65536
– Unit: count

Acegene IT Co. Ltd. 41


6 参数 : 共享内存
• /proc/sys/kernel/shmmax
– Max size of a single shared memory segment
– Smaller values mean more segments needed
– Default value: 33554432
– Unit: bytes
– Maximum allowed: 4GB - 1 (4294967295)
• /proc/sys/kernel/shmall
– Max amount of shared memory system-wide
– Default: 2097152
– Unit: ?
• /proc/sys/kernel/shm-use-bigpages
– Allowed values:
• 0: don’t use bigpages pool for shared memory
• 1: use bigpages pool for SysV shared memory
• 2: use bigpages pool for SysV and shmfs
– Default value: 0
– Use Workaround in bug 3080838
• To prevent Kernel panic in sshd_config set:
– UsePrivilegeSeparation no -OR-
– Compresson no (preferred)
Acegene IT Co. Ltd. 42
6 RHEL Kernel Types (IA-32)
• Choose the right kernel
– “smp”: 2-level page tables
• HW can only address 4GB of RAM
• 4kB pages and 4MB “large” pages
– “enterprise”: 3-level page tables
• HW can address up to 64GB of RAM
• 4kB pages and 2MB “large” pages
• RHEL2.1: max 16GB RAM supported
• SLES8: 64GB officially supported

Kernel # CPUs RAM


Standard 1 4 GB
SMP Multi 4 GB
Enterprise Multi > 4 GB
Acegene IT Co. Ltd. 43
6 进程地 址空间 (IA-32)
• 3GB user/1GB kernel address space
– 0x00000000-0xbfffffff user
– 0xc0000000-0xffffffff kernel
• Stack grows down from 0xbfffffff
• mapped_base
– Address where .so libraries are loaded
– Default value: 0x40000000
– Configure via /proc/$PID/mapped_base
Default After Relink
0xFFFFFFFF 0xFFFFFFFF
Reserved Reserved
for kernel for kernel
0xC0000000 0xC0000000
Variable SGA Variable SGA
DB Buffers
(SGA) sga_base DB Buffers
(relink Oracle) (SGA)
0x50000000 mapped_base
0x40000000 (/proc/<pid>/mapped_base)
Code, etc. 0x15000000
0x00000000
0x10000000 Code, etc.
0x00000000
Acegene IT Co. Ltd. 44
Q&
A
QUESTIONS
ANSWERS
练习
• 为虚拟机安装 vmware-tools 软件
– 安装
– 确认是否安装
– 卸载
• 配置系统服务
– 启动服务 :  
• rsh rexec rlogin telnet sshd vsftpd rawdevices
– 禁用服务 : /etc/sysctl.conf
• cups sendmail smartd apmd net.ipv4.ip_forward = 0
• chkconfig service net.ipv4.conf.default.rp_filter = 1
• 配置自动启动服务 net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
– /etc/rc.d/rc.local, net.core.rmem_max = 262144
• 启动时自动授权 oracle 用户文件权限 net.core.wmem_default = 262144
– /dev/rawctl net.core.wmem_max = 262144
– /dev/raw/* kernel.sysrq = 0
• chown chmod kernel.core_uses_pid = 1
kernel.shmmax = 1610612736
• 设置 Linux 核心参数 kernel.shmmni = 4096
– 编辑 /etc/sysctl.conf kernel.shmall = 2097152
– 参数生效 #sysctl -p kernel.msgmax = 8192
kernel.msgmnb = 65535
kernel.msgmni = 2878
kernel.sem = 500 64000 100 512
#fs.aio-max-size =1048576
fs.file-max = 327680
fs.aio-max-nr = 1048576
Acegene IT Co. Ltd. 46

You might also like