rhel 7 RAC安装执行root.sh遭遇ohasd failed to start,Failed to start the Clusterware. Last 20 lines of the alert log follow

[root@rac2 ~]# /u01/app/11.2.0.4/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0.4/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2066-11-06 20:06:10.062:
[client(18511)]CRS-2101:The OLR was formatted using version 3.

/u01/app/11.2.0.4/grid/perl/bin/perl -I/u01/app/11.2.0.4/grid/perl/lib -I/u01/app/11.2.0.4/grid/crs/install /u01/app/11.2.0.4/grid/crs/install/rootcrs.pl execution failed
[root@rac2 ~]#

将集群添加到inittab服务,启动ohasd失败。inittab为linux初始化文件系统时init初始化程序用到的配置文件,负责设置init初始化程序脚本,比如开机、关机、重启命令。
linux 7 使用systemd代替了initd运行,重启进程,所有用以前的initd启动ohasd服务就找不到目录

创建服务ohas.service的服务文件并赋予权限
[root@rac2 etc]# touch /usr/lib/systemd/system/ohas.service
[root@rac2 etc]# chmod 777 /usr/lib/systemd/system/ohas.service

ohas.service服务文件添加启动ohasd的相关信息
[root@rac2 etc]# vi /usr/lib/systemd/system/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

重新加载守护进程
[root@rac2 etc]# systemctl daemon-reload
[root@rac2 etc]#
设置守护进程自动启动
[root@rac2 etc]# systemctl enable ohas.service
[root@rac2 etc]#
手工启动ohas服务
[root@rac2 etc]# systemctl start ohas.service;
查看状态
[root@rac2 etc]# systemctl status ohas.service;
ohas.service - Oracle High Availability Services
Loaded: loaded (/usr/lib/systemd/system/ohas.service; enabled)
Active: active (running) since Mon 2066-11-09 10:19:54 CST; 5s ago
Main PID: 56773 (init.ohasd)
CGroup: /system.slice/ohas.service
└─56773 /bin/sh /etc/init.d/init.ohasd run >/dev/null 2>&1 Type=simple

Nov 09 10:19:54 rac2 systemd[1]: Started Oracle High Availability Services.

重新运行root.sh
[root@rac2 ~]# /u01/app/11.2.0.4/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0.4/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
Installing Trace File Analyzer

CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@rac2 ~]#
运行成功

[root@rac2 ~]# su - grid
[rac2:grid]:/home/grid>crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac1
ora.ons ora.ons.type ONLINE ONLINE rac1
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
[rac2:grid]:/home/grid>

posted @ 2020-11-12 11:25  ritchy  阅读(1673)  评论(0编辑  收藏  举报