设为首页 收藏本站
查看: 876|回复: 0

[经验分享] Internal Only: Advanced Troubleshooting of CSS Heartbeat Failures (Network) (Doc

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-11-21 10:58:56 | 显示全部楼层 |阅读模式
Applies to:
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.1
Information in this document applies to any platform.
Purpose
Internal Note to Explain How to Troubleshoot CSS Heartbeat Failures (Network).Scope and Application
For Oracle Support and DevelopmentInternal Only: Advanced Troubleshooting of CSS Heartbeat Failures (Network)
  The tell tale sign of a CSS network heartbeat related issue is the following type of message in the CSS log:
[ CSSD]2007-09-06 18:38:45.861 [18] >WARNING: clssnmPollingThread: node scadfrai11 (2) at 50% heartbeat fatal, eviction in 14.275 seconds  The first thing to do is find out if the missed checkins ARE the problem or are a result of the node going down due to other reasons. Check the messages file to see what exact time the node went down and compare it to the time of the missed checkins.
- If the messages file reboot time < missed checkin time then the node eviction was
likely not due to these missed checkins.                            <<<<< 通过时间来判断reboot是否由miss checkins引起。

- If the messages file reboot time > missed checkin time then the node eviction was
likely a result of the missed checkins.
  If you determine that CSS actually did reboot the node due to missed checkins, then we need to find out why. There are 3 threads in CSS that deal with CSS heartbeats:
  <<<<< 在每个节点,有三个theads来处理css heartbeat,一个接收,一个发送,一个表决。诊断时需要看这几个是否发送出去的被全部接收,是否存在miss checkin。

clssnmSendingThread - This thread periodically wakes up and sends appropriate packets (based on the join state) to other nodes so that other members know we are still alive. For the heartbeathe sends &quot;status&quot; packets to the other nodes to tell them that they are alive. This can be seen at CSS trace level 2 or higher. Example:
[ CSSD]2007-09-06 18:37:07.857 [19] >TRACE: clssnmSendingThread: sending status msg to all nodes
  Notice that the thread # for the clssnmSendingThread is 19 in this example. This is important to know so that you don't end up troubleshooting the wrong thread
  With CSS trace level 4 &#43; CLSC tracing you can see more details important details like:
[ CSSD]2007-09-06 18:38:31.584 [19] >TRACE: clssnmsendmsg: sending msg type 3 to node 1
[ CSSD]2007-09-06 18:38:31.584 [19] >TRACE: clscsendx: (b8aaf0) sending msg (f395c8) type 3, size 68, srqh (eed3d0)
[ CSSD]2007-09-06 18:38:31.587 [19] >TRACE: clscsendx: (b8aaf0) sent msg type 3, size 68, rc 0 srqh (eed3d0)  If you also turn on CLSC NS tracing you can see the Oracle Net tracing for this. You can see something like:
(19) [000013 06-SEP-2007 18:38:31:586] nsdo: cid=1, opcode=67, *bl=68, *what=1, uflgs=0x2, cflgs=0x3
(19) [000013 06-SEP-2007 18:38:31:586] snsbitts_ts: acquired the bit
(19) [000013 06-SEP-2007 18:38:31:586] nsdo: rank=64, nsctxrnk=0
(19) [000013 06-SEP-2007 18:38:31:586] nsdo: nsctx: state=8, flg=0x400d, mvd=0
(19) [000013 06-SEP-2007 18:38:31:586] nsdo: 68 bytes to transport
(19) [000013 06-SEP-2007 18:38:31:586] nttmwr: entry
(19) [000013 06-SEP-2007 18:38:31:587] nttmwr: socket 26 had bytes written=68
(19) [000013 06-SEP-2007 18:38:31:587] nttmwr: exit  And of course OS Watcher is good to look at things underneath CSS.
  The code path for sending a heartbeat message is clssnmSendingThread-->clssnmsendmsg-->clscsendx
  clssnmClusterListener thread - This thread listens for incoming packets from other nodes by calling clscselect and dispatches them for appropriate handling. When the clssnmClusterListenerreceives a packet, it calls clssnmProcessPkt to process the packet. If it is a status packet then clssnmProcessPkt calls clssnmHandleStatus. In clssnmHandleStatus we put the packet info in memory to let it get seen by the polling thread so it can decide whatto do with them.

At CSS trace level 3 or higher you can see the clssnmClusterListener thread waking up and going through it's loop. You can also see
[ CSSD]2007-09-06 18:38:31.299 [13] >TRACE: clssnmClusterListener: Entering select blocking
  Notice that the thread # for the clssnmClusterListener thread is 13 in this example. This is important to know so that you don't end up troubleshooting the wrong thread
  With trace level 4 &#43; CLSC tracing you can see more details important details like:
[ CSSD]2007-09-06 18:38:30.070 [13] >TRACE: clsc_receive: (f16470) prepare to receive
[ CSSD]2007-09-06 18:38:30.074 [13] >TRACE: clsc_receive: (f16470) compl recv, rc 0, nsret 0, flgs 0x0000, size 68
[ CSSD]2007-09-06 18:38:30.074 [13] >TRACE: clsc_receive: (f16470, 1) recv msg type 3, size 68, msgsz 68
[ CSSD]2007-09-06 18:38:30.074 [13] >TRACE: clssnmHandleStatus: src[2] dest[0] dom[0] seq[0] sync[53]
[ CSSD]2007-09-06 18:38:31.299 [13] >TRACE: clssnmClusterListener: Entering select blocking  If you also turn on CLSC NS tracing you can see the Oracle Net tracing for this. You can see something like:
(13) [000014 06-SEP-2007 18:38:30:071] nsdo: cid=2, opcode=68, *bl=131136, *what=0, uflgs=0x0, cflgs=0x3
(13) [000014 06-SEP-2007 18:38:30:071] snsbitts_ts: acquired the bit
(13) [000014 06-SEP-2007 18:38:30:071] nsdo: rank=64, nsctxrnk=0
(13) [000014 06-SEP-2007 18:38:30:071] nsdo: nsctx: state=8, flg=0x400c, mvd=0
(13) [000014 06-SEP-2007 18:38:30:072] nsdo: reading from transport...
(13) [000014 06-SEP-2007 18:38:30:072] nttmrd: entry
(13) [000014 06-SEP-2007 18:38:30:073] nttmrd: socket 95 had bytes read=68
(13) [000014 06-SEP-2007 18:38:30:073] nttmrd: exit  And of course OS Watcher is good to look at things underneath CSS.
  The code path for receiving a heartbeat message is clssnmClusterListener-->clscselect
The code path to process a received heartbeat message is clssnmClusterListener-->clssnmProcessPkt-->clssnmHandleStatus

clssnmPollingThread - Periodically wakes up and scans to see who is active and has been checking in regularly by reading from the node db in memory. If the last last packet time in memoryreaches 1/2 of misscount you will see this famous message:

[ CSSD]2007-09-06 18:38:45.861 [18] >WARNING: clssnmPollingThread: node scadfrai11 (2) at 50% heartbeat fatal, eviction in 14.275 seconds  Not much more useful trace info you can turn on for this guy. He just reads the last packet time in memory and takes action if we reach misscount (sends out poison packets, etc...).
  Things to Look For:
  - Is the clssnmSendingThread sending a status message to every other node continuously?
If the answer is no, see if the clssnmSendingThread is stuck (stack traces of all threads of CSS) or if there is a resource problem or network error in OS Watcher (netstat, vmstat, etc...)  - Is the clssnmClusterListener receiving a status message from every other node continuously?
Again, if the answer is no, see if the clssnmClusterListener is stuck (stack traces of all threads of CSS) or if there is a resource problem or network error in OS Watcher (netstat, vmstat, etc...)  As long as you can confirm that the sending thread from node x is sending and the listening thread from node y is receiving you should not see any missed checkins.

For Extremely Detailed Tracing of CSS Heartbeats (Be Careful Suggesting This to Customers):
  10.2.0.2 (Bundle Patch 2) and above:

<CRS_HOME>/bin/crsctl debug log css CSSD:4 (default is 1)
(No subsequent reboot needed if you do it this way)

  Prior versions:

<CRS_HOME>/bin/crsctl set css trace 4 (default is 1)

And set the following <CRS_HOME>/bin/ocssd:

CLSC_TRACE_LVL=5
export CLSC_TRACE_LVL
CLSC_NSTRACE_LVL=12
export CLSC_NSTRACE_LVL
  Then restart CRS.

This would provide A LOT of detail about the underlying Oracle network layers under CSS but obviously would generate trace info very fast in CRS_HOME/log/<hostname>/cssd so the data would have to be captured quickly before the CSS log wraps. Either that orhave a job to save off and compress all the logs every 10-15 min.
  Sample script to archive CSS logs every 10 minutes (archcsslogs.sh):
  
# archcsslogs.sh
#
# Archive CSS logs Every 10 Minutes to /tmp
#
# Set the CSSLOGDIR before running the script..(<CRS_HOME>/log/nodename/cssd)
#
# Example:
# CSSLOGDIR=/u01/oracrs/product/11.1.0/log/node1/cssd

CSSLOGDIR=<insert path here>

while [ 1 -ne 0 ]; do
CSSFILE=/tmp/css_`date &#43;%m%d%y&quot;_&quot;%H%M`.tar
tar cf $CSSFILE $CSSLOGDIR/*
compress $CSSFILE
sleep 600
done
exit
  
To run:

chmod 755 archcsslogs.sh
nohup ./archcsslogs.sh &

Then kill the archcsslogs.sh process when you want it to stop archiving...
  

References
@ BUG:6394860- NODE REBOOT/EVICTIONS DUE TO HEARTBEAT LOST ON NETWORK
NOTE:265769.1- Troubleshooting CRS Reboots
@ NOTE:305689.1- CSS (Cluster Synchronization Services) Internals (INTERNAL ONLY)
clssnm.c and clssnm.h

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-141773-1-1.html 上篇帖子: Heartbeat中ipfail的使用 下篇帖子: LVS+Heartbeat 配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表