LoginSignup
4
4

More than 5 years have passed since last update.

zookeeper ポート監視 (&hive少々)

Posted at

zookeeper のポート監視で2181のポートをつついていると、zookeeperが正常なセッションクローズができずに、監視のポーリングのタイミングごとにログファイル(zookeeper.log)に以下ログが出力される。


2012-xx-xx 14:27:38,270 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@202] - Accepted socket connection from /192.168.x.x:58158
2012-xx-xx 14:27:38,270 [myid:1] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@349] - caught end of stream exception
EndOfStreamException: Unable to read additional data from client sessionid 0x0, likely client has closed socket
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:213)
at java.lang.Thread.run(Thread.java:662)
2012-xx-xx 14:27:38,270 [myid:1] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1000] - Closed socket connection for client /192.168.x.x.101:58158 (no session established for client)

これが時が経つと容量も肥大化する。。

●zookeeperのお作法としては、ruokを使う。


# echo ruok | nc localhost 2181
imok

●異常時には値を何も返さないので、zabbixでは文字列での判断ができなかったので以下のようなキーを作り、カウント値が0なら異常のトリガーを作った。


system.run[echo ruok | nc localhost 2181 | grep imok | wc -l]

●これで無駄ログスッキリ。不要なログ、見もしないログは消さないと。

●hiveのポート監視でも同様に、無駄ログ大量にはかれることになる。
以下のようにbeelineコマンドを使った方法がお作法としては正しそうです。


echo "show tables;" | beeline -u jdbc:hive2://hiveserver2:10000 -n username -p password --silent=true
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4