oracle集群管理-集群RAC启动解析

  集群安装完毕后,重启计算机,集群会跟在系统一起启动。网上很多文章都说是在/etc/inittab中添加一行

h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1

但是在我装出来的系统中,inittab中并没有设置任何集群启动的信息。那么集群究竟是怎么启动的呢?

我们查看一下/etc/rc5.d或者/etc/rc3.d这个目录下的脚本。

[root@11grac1 rc5.d]# ll S96ohasd 
lrwxrwxrwx 1 root root 17 Aug 13 11:11 S96ohasd -> /etc/init.d/ohasd

就是因为有了这个,集群才会随机启动的。

 

ohasd是整个集群的一个高可用服务,监控集群中的各个进程。当集群进程崩溃后,尝试重启这些进程。

系统启动时,会调用

crsctl start has -nowait

那么如何禁止集群自启动呢?

[root@11grac1 ~]# cd /u01/app/11.2.0/grid/bin/
[root@11grac1 bin]# ./crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.
/etc/oracle/scls_scr/11grac1/root/ohasdstr

这个脚本中的值控制着集群是否可以自动启动。

 

如何手工启动集群:

[root@11grac1 root]# /u01/app/11.2.0/grid/bin/crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

此命令先启动ohasd,然后由ohasd启动crsd、cssd等后台进程

[root@11grac1 root]# /u01/app/11.2.0/grid/bin/crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

同时,它也会把数据库、asm、监听都一起启动。

 

关闭集群使用命令

[root@11grac1 root]# /u01/app/11.2.0/grid/bin/crsctl stop crs

 

如果想把这个集群中的全部或大部分关闭,可以使用如下命令

[root@11grac1 root]# /u01/app/11.2.0/grid/bin/crsctl start cluster -all
或者
[root@11grac1 root]# /u01/app/11.2.0/grid/bin/crsctl start cluster -n 11grac1 11grac2

但是使用start cluster命令的前提是ohasd已经启动。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值