標籤:ohasd
叢集安裝完畢後,重啟電腦,叢集會跟在系統一起啟動。網上很多文章都說是在/etc/inittab中添加一行
h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1
但是在我裝出來的系統中,inittab中並沒有設定任何叢集啟動的資訊。那麼叢集究竟是怎麼啟動的呢?
我們查看一下/etc/rc5.d或者/etc/rc3.d這個目錄下的指令碼。
[[email protected] rc5.d]# ll S96ohasd lrwxrwxrwx 1 root root 17 Aug 13 11:11 S96ohasd -> /etc/init.d/ohasd
就是因為有了這個,叢集才會隨機啟動的。
ohasd是整個叢集的一個高可用服務,監控叢集中的各個進程。當叢集進程崩潰後,嘗試重啟這些進程。
系統啟動時,會調用
crsctl start has -nowait
那麼如何禁止叢集自啟動呢?
[[email protected] ~]# cd /u01/app/11.2.0/grid/bin/[[email protected] bin]# ./crsctl disable crsCRS-4621: Oracle High Availability Services autostart is disabled.
/etc/oracle/scls_scr/11grac1/root/ohasdstr
這個指令碼中的值控制著叢集是否可以自動啟動。
如何手工啟動叢集:
[[email protected] root]# /u01/app/11.2.0/grid/bin/crsctl start crsCRS-4123: Oracle High Availability Services has been started.
此命令先啟動ohasd,然後由ohasd啟動crsd、cssd等後台進程
[[email protected] root]# /u01/app/11.2.0/grid/bin/crsctl check crsCRS-4638: Oracle High Availability Services is onlineCRS-4537: Cluster Ready Services is onlineCRS-4529: Cluster Synchronization Services is onlineCRS-4533: Event Manager is online
同時,它也會把資料庫、asm、監聽都一起啟動。
關閉叢集使用命令
[[email protected] root]# /u01/app/11.2.0/grid/bin/crsctl stop crs
如果想把這個叢集中的全部或大部分關閉,可以使用如下命令
[[email protected] root]# /u01/app/11.2.0/grid/bin/crsctl start cluster -all或者[[email protected] root]# /u01/app/11.2.0/grid/bin/crsctl start cluster -n 11grac1 11grac2
但是使用start cluster命令的前提是ohasd已經啟動。
本文出自 “叮咚” 部落格,請務必保留此出處http://lqding.blog.51cto.com/9123978/1684495
Oracle 學習之RAC(七) 叢集啟動解析