RHEL7安装11204 RAC的注意事项

最近在某客户的RHEL7 + 11204 RAC环境上测试遇到不少的坑,好在都赶在正式上线前及时发现并处理完毕。
其中两个问题比较典型所以特别记录下:问题都和主机重启后,O相关服务没有自启动导致,看来RHEL7安装11204RAC后一定要注意下主机重启后O相关服务是否可以自启动,而造成此现象的根本原因是RHEL7的服务管理机制有变化。

1.主机重启后,ohasd不会自启动

之前自己有一套测试环境也存在这个问题,但遗憾的是当时认为是自己用的测试环境就没有深究,每次主机重启都是直接按照/etc/inittab中的配置,手工启动nohup /etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null &的。如今生产也遇到这样的问题,必须要查下根因了。
导致ohasd不启动这个问题,其实在网上直接去搜索也有不少资料了,我也咨询过一些有RHEL7环境部署11204RAC经验的同事基本也都遇到过,基本定位为是普遍存在的一个问题,具体参考MOS的文章:

  • Install of Clusterware fails while running root.sh on OL7 – ohasd fails to start (Doc ID 1959008.1)
  • Patch 18370031: RC SCRIPTS (/ETC/RC.D/RC.* , /ETC/INIT.D/* ) ON OL7 FOR CLUSTERWARE

根本解决方法:
MOS提供的方案:

Because Oracle Linux 7 (and Redhat 7) use systemd rather than initd for starting/restarting processes and runs them as a service the current > software install of both 11.2.0.4 & 12.1.0.1 will not succeed because the ohasd process does not start properly.

In OL7 it needs to be set up as a service and patch fix for Bug 18370031 needs to be applied for this , BEFORE you run root.sh when prompted .
Need to apply the patch 18370031 for 11.2.0.4 .

也可以使用手工添加服务的方式配置ohasd服务自启动:
cat /etc/systemd/system/oracle-ohasd.service

# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
#
# Oracle OHASD startup

[Unit]
Description=Oracle High Availability Services
After=syslog.target

[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null
Type=simple
Restart=always

[Install]
WantedBy=multi-user.target graphical.target

文件权限建议为750,然后启动服务:

systemctl enable oracle-ohasd.service

我这里采用的是直接手工添加服务的方式。

2.主机重启后,acfsload不会自启动

还遇到一个acfs集群文件系统自动挂载的问题,同样类似的现象,主机重启后,对应的acfs无法自动挂载,而只重启集群就可以。说明问题还是在os重新启动,对应acfs存在相关服务没有启动成功。
经过排查是acfsload没有自动启动,使用acfsload start手工启动后,正常可以挂载。
手工虽然可以处理,但还是不符合自动挂载的需求,最终也是通过配置服务自启动的方式来实现acfsload在主机重启后自启动。

根本解决方法:
手工添加服务并配置服务自启动:
cat /etc/systemd/system/oracle-acfsload.service

#
# Oracle ACFS Drivers
#
[Unit]
Description=Load ACFS Drivers during boot
After=syslog.target oracle-ohasd.service
[Service]
ExecStart=<GRID_HOME>/bin/acfsload start -s >/dev/null 2>&1 </dev/null
Type=simple

[Install]
WantedBy=multi-user.target graphical.target

注意修改为你自己实际环境的,比如我这里是/opt/app/11.2.0/grid,文件权限建议为750,然后启动服务:

systemctl enable oracle-acfsload.service
This entry was posted in Oracle安装部署 and tagged , , . Bookmark the permalink.