Cassandraクラスタ管理-ノード異常再起動


Cassandraクラスタ管理-ノード異常再起動


クラスタノードにログインし、サーバを直接再起動し(172.0.101.166)、cassandra起動を設定します.

注意:


このドキュメントはシステムドキュメントの一部にすぎません.前のドキュメントの詳細は、テスト準備+オフライン正常ノードを参照してください.https://blog.51cto.com/michaelkang/2419518ノード異常再起動:https://blog.51cto.com/michaelkang/2419524新しいノードを追加:https://blog.51cto.com/michaelkang/2419521例外ノードを削除するにはhttps://blog.51cto.com/michaelkang/2419525

シーン:


ノードは異常に再起動され,クラスタに対する反応を起こす.

cassandra.logはほとんど出力されません

tailf /var/log/cassandra/cassandra.log 

system.log


有明显日志报172.0.101.166 DOWN!!!
172.20.101.165  :

[root@kubm-03 lib]# tailf /var/log/cassandra/system.log 
INFO  [GossipStage:1] 2019-07-11 18:19:23,372 Gossiper.java:1026 - InetAddress /172.20.101.166 is now DOWN

例外ノードの表示

[root@kubm-01 ~]# nodetool describecluster
Cluster Information:
        Name: pttest
        Snitch: org.apache.cassandra.locator.GossipingPropertyFileSnitch
        DynamicEndPointSnitch: enabled
        Partitioner: org.apache.cassandra.dht.Murmur3Partitioner
        Schema versions:
                cfce5a85-19c8-327a-ab19-e1faae2358f7: [172.20.101.164, 172.20.101.165, 172.20.101.167, 172.20.101.160, 172.20.101.157]

                UNREACHABLE: [172.20.101.166]

debug.log


大量の新聞は172.0.101.166に接続できません
172.20.101.164  :

tailf /var/log/cassandra/debug.log

DEBUG [GossipStage:1] 2019-07-11 18:19:23,374 OutboundTcpConnection.java:205 - Enqueuing socket close for /172.20.101.166
DEBUG [MessagingService-Outgoing-/172.20.101.166-Small] 2019-07-11 18:19:23,374 OutboundTcpConnection.java:411 - Socket to /172.20.101.166 closed
DEBUG [GossipStage:1] 2019-07-11 18:19:23,374 OutboundTcpConnection.java:205 - Enqueuing socket close for /172.20.101.166
DEBUG [MessagingService-Outgoing-/172.20.101.166-Gossip] 2019-07-11 18:19:23,374 OutboundTcpConnection.java:411 - Socket to /172.20.101.166 closed
DEBUG [GossipStage:1] 2019-07-11 18:19:23,374 FailureDetector.java:313 - Forcing conviction of /172.20.101.166
DEBUG [MessagingService-Outgoing-/172.20.101.166-Gossip] 2019-07-11 18:19:24,740 OutboundTcpConnection.java:425 - Attempting to connect to /172.20.101.166
INFO  [HANDSHAKE-/172.20.101.166] 2019-07-11 18:19:24,741 OutboundTcpConnection.java:561 - Handshaking version with /172.20.101.166
DEBUG [MessagingService-Outgoing-/172.20.101.166-Gossip] 2019-07-11 18:19:24,742 OutboundTcpConnection.java:533 - Done connecting to /172.20.101.166

クエリーの検証


システムが起動すると、サービスは自然に起動し、正常にクラスタに参加することができます.
cassandra@cqlsh> SELECT * from kevin_test.t_users; 

 user_id | emails                          | first_name | last_name
---------+---------------------------------+------------+-----------
       6 | {'[email protected]', '[email protected]'} |     kevin6 |      kang
       7 | {'[email protected]', '[email protected]'} |     kevin7 |      kang
       9 | {'[email protected]', '[email protected]'} |     kevin9 |      kang
       4 | {'[email protected]', '[email protected]'} |     kevin4 |      kang
       3 | {'[email protected]', '[email protected]'} |     kevin3 |      kang
       5 | {'[email protected]', '[email protected]'} |     kevin5 |      kang
       0 | {'[email protected]', '[email protected]'} |     kevin0 |      kang
       8 | {'[email protected]', '[email protected]'} |     kevin8 |      kang
       2 | {'[email protected]', '[email protected]'} |     kevin2 |      kang
       1 | {'[email protected]', '[email protected]'} |     kevin1 |      kang

テスト結果:


ノードを繰り返し再起動し、テーブルの内容が正常にクエリーされます.