Sunday, January 24, 2016

How to Identify the Master node in RAC?

This question came to my mind when i was doing the RAC course and thought i post this topic in my blog and it might be helpful for others.

The node which join first in the cluster is Master node. Each node has node id and it is assigned the order in which the node is joined in the cluster.   If master node is evicted or rebooted, cluster choose the next node(node which joined in the cluster right after the master/first node)  for master instance.

Master node is responsible for backing up the OCR file. Obliviously, who ever is backing up the OCR is master instance. This is one way we can find the master node.

[root@RAC1 crsd]# ocrconfig -showbackup auto

rac1     2015/10/07 09:45:15     /grid/app/11.2.0/grid/cdata/RAC-cluster/backup00.ocr

rac1     2015/10/07 05:45:14     /grid/app/11.2.0/grid/cdata/RAC-cluster/backup01.ocr

rac1     2015/10/07 01:45:14     /grid/app/11.2.0/grid/cdata/RAC-cluster/backup02.ocr

rac1     2015/10/07 01:45:14     /grid/app/11.2.0/grid/cdata/RAC-cluster/day.ocr

rac1     2015/10/05 16:25:04     /grid/app/11.2.0/grid/cdata/RAC-cluster/week.ocr
[root@RAC1 crsd]#

As per the above output, RAC1 is master instance.

 Second way to identify the master instance is, scanning the ocssd log file.

[oracle@RAC1 cssd]$ cat /grid/app/11.2.0/grid/log/rac1/cssd/ocssd.log|grep 'master node'|tail -1
2016-01-24 20:35:25.670: [    CSSD][2105509648]clssgmCMReconfig: reconfiguration successful, incarnation 339437441 with 2 nodes, local node number 1, master node number 1
[oracle@RAC1 cssd]$


Third way to identify the master instance is, scanning the crssd log file.

[oracle@RAC1 crsd]$ cat /grid/app/11.2.0/grid/log/rac1/crsd/crsd.log|grep 'OCR MASTER'|tail -1
2016-01-24 20:35:25.077: [  OCRMAS][2206197520]th_master:12: I AM THE NEW OCR MASTER at incar 1. Node Number 1
[oracle@RAC1 crsd]$

Hope this post is helpful..

No comments: