在执行root.sh时报:
Adding Clusterware entries to inittab
ohash failed to start
failed to start the clusterware,Last 20 lines of the alert log follow:
原因:因为centos7 使用的sysemd而不时initd运行继承和重启进程,而root.sh通过传统的initd运行ohasd进程
解决方法:在centos7中ohasd需要被设置为一个服务,在运行脚本roo.sh之前。
步骤:
1、以root用户创建服务文件。
#touch /usr/lib/systemd/system/ohas.service
#chmod 777 /usr/lib/systemd/sysem/ohas.service
2、将以下内容条件到ohas.service文件中。
[Unit]
Description=Oracle High Availability Services
After=syslog.target
[Service]
ExecStart=/etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple
Restart=always
[Install]
WantedBy=multi-user.target
3、以root用户运行下面命令
systemctl daemon-reload
systemctl enable ohas.service
systemctl start ohas.service
4、查看运行状态
systemctl status ohas.service
此时状态为失败,原因时现在还没有/etc/init.d/init.ohasd文件,下面可以运行脚本roo.sh了不会再报ohasd failed to start错误。