10. 修改你的 /etc/sysctl.conf ,添加这些kernel 参数
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144
kernel.shmall = 78643200
kernel.shmmax = 314572800
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
# sysctl -p 立刻生效
kernel.shmall为物理内存除以pagesize;
kernel.shmmax为物理内存的一半;
fs.file-max为512 乘以 processes (如128个process则为 65536);
net.ipv4.ip_local_port_range/net.core.rmem_default/net.core.rmem_max三个参数设置和官方文档不一样, 这是根据metalink 343431.1 最新要求更改的;
net.ipv4.tcp_rmem/net.ipv4.tcp_wmem两个参数一般情况下无需设置, 除非是在Dataguard/Streams等需很多网络传输情况下;
其它参数根据官方文档要求设置即可.
具体内容参考:Linux 内核参数及Oracle相关参数调整 http://www.linuxidc.com/Linux/2011-05/36002.htm
11. 设置用户资源限制
因为所有的进程都是以Oracle 身份来运行的,因此需要定义Oracle 用户能够使用的系统资源数量。
vi /etc/sysconfig/limits.conf
--使用HugePage 内存技术,添加下面2行
Oracle soft memlock 5242880
Oracle hard memlock 524280
--进程句柄数量
oracle soft nproc 2047
oracle hard nproc 16384
-- 文件句柄
oracle soft nofile 65536
oracle hard nofile 65536
将下面一行添加到/etc/pam.d/login文件中:
session required /lib/security/pam_limits.so
12. 配置 hangcheck-timer 模块
Hangcheck-timer 是Linux 提供的一个内核级的IO-Fencing 模块, 这个模块会监控Linux 内核运行状态, 如果长时间挂起, 这个模块会自动重启系统。 这个模块在Linux 内核空间运行, 不会受系统负载的影响。 这个模块会使用CPU的Time Stamp Counter(TSC) 寄存器,这个寄存器的值会在每个时钟周期自动增加, 因此使用的是硬件时间,所以精度更高。
配置这个模块需要2个参数: hangcheck_tick 和 hangcheck_margin。
hangcheck_tick用于定义多长时间检查一次,缺省值是30秒。 有可能内核本身很忙, 导致这个检查被推迟, 该模块还允许定义一个延迟上限,就是hangcheck_margin, 它的缺省值是180秒。
Hangcheck-timer 模块会根据hangcheck_tick 的设置,定时检查内核。只要2次检查的时间间隔小于 hangcheck_tick + hangchec_margin, 都会认为内核运行正常,否则就意味着运行异常,这个模块会自动重启系统。
CRS本身还有一个MissCount 参数,可以通过crsctl get css miscount 命令查看。
当RAC结点间的心跳信息丢失时, Clusterware 必须确保在进行重构时,故障结点确实是Dead 状态,否则结点仅是临时负载过高导致心跳丢失,然后其他结点开始重构,但是结点没有重启,这样会损坏数据库。 因此MissCount 必须大于 hangcheck_tick+hangcheck_margin的和。
12.1 查看模块位置:
[root@rac1 ~]# find /lib/modules -name "hangcheck-timer.ko"
/lib/modules/2.6.9-78.EL/kernel/drivers/char/hangcheck-timer.ko
/lib/modules/2.6.9-78.ELsmp/kernel/drivers/char/hangcheck-timer.ko
12.2 配置系统启动时自动加载模块,在/etc/rc.d/rc.local 中添加如下内容
[root@rac1 ~]# modprobe hangcheck-timer
[root@rac1 ~]# vi /etc/rc.d/rc.local
modprobe hangcheck-timer
12.3 配置hangcheck-timer参数, 在/etc/modprobe.conf 中添加如下内容:
[root@rac1 ~]# vi /etc/modprobe.conf
options hangcheck-timer hangcheck_tick=30 hangcheck_margin=180
12.4 确认模块加载成功:
[root@rac1 ~]# grep Hangcheck /var/log/messages | tail -2
Feb 23 22:08:44 rac1 kernel: Hangcheck: starting hangcheck timer 0.9.0 (tick is 30 seconds, margin is 180 seconds).
13. 安装ocfs2 , ocfs2的console的rpm,
# rpm -ivh *.rpm
linux 挂在windows 共享的盘
1. 启动nfs服务: service nfs start
2. mount -o username=share,password=share //10.85.10.80/RAC /mnt
14. 在每个node 上这样操作
/etc/init.d/o2cb enable
然后编辑 /etc/init.d/o2cb, 删除掉 靠近配置开头的那些带 #的配置行
进入X, 然后运行 ocfs2console, 把你的2个node都添加进去
添加后会生成 /etc/ocfs2/cluster.conf文件
若不能apply, 把/etc/ocfs2/cluster.Conf 文件删了在运行即可。
node:
ip_port = 7777
ip_address = 10.85.10.119
number = 0
name = rac1 ---- 注意:name是机器名
cluster = ocfs2
node:
ip_port = 7777
ip_address = 10.85.10.121
number = 1
name = rac2
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2
