Cassandra (10) Logs
一般來說 cassandra 的 logs 放在 /var/log/cassandra/,根據日誌層級分別輸出到 system.log 和 debug.log。
接下來我們會用 tail 指令動態追蹤這兩個日誌的變化:
$ tail -f /var/log/cassandra/system.log
$ tail -f /var/log/cassandra/debug.log
1.觀察節點對日誌的變化:
考慮我的叢集有三個節點分別是 192.168.0.128, 192.168.0.140, 192.168.0.156。
ssh 到 192.168.0.128 把 cassandra 停下來:
$ ssh cooper@192.168.0.128 192.168.0.128$ sudo service cassandra stop
system.log 發現 192.168.0.128 掛了,而 debug.log 會顯示 192.168.0.128 連線失敗:
INFO [GossipStage:1] 2018-08-28 13:27:18,025 Gossiper.java:1034 - InetAddress /192.168.0.128 is now DOWN INFO [HANDSHAKE-/192.168.0.128] 2018-08-28 13:34:08,028 OutboundTcpConnection.java:561 - Handshaking version with /192.168.0.128
重新啟動服務:
192.168.0.128$ sudo service cassandra start
system.log 會顯示 192.168.0.128 復活,debug.log 會顯示 Tokens:
INFO [GossipStage:1] 2018-08-28 13:35:57,175 Gossiper.java:1053 - Node /192.168.0.128 has restarted, now UP INFO [GossipStage:1] 2018-08-28 13:35:57,176 TokenMetadata.java:479 - Updating topology for /192.168.0.128 INFO [GossipStage:1] 2018-08-28 13:35:57,176 TokenMetadata.java:479 - Updating topology for /192.168.0.128 INFO [HANDSHAKE-/192.168.0.128] 2018-08-28 13:35:57,202 OutboundTcpConnection.java:561 - Handshaking version with /192.168.0.128 INFO [RequestResponseStage-1] 2018-08-28 13:35:57,221 Gossiper.java:1019 - InetAddress /192.168.0.128 is now UP INFO [GossipStage:1] 2018-08-28 13:35:58,004 StorageService.java:2289 - Node /192.168.0.128 state jump to NORMAL
留言
張貼留言