zoukankan      html  css  js  c++  java
  • 查看ZooKeeper的日志

    ZooKeeper的日志是序列化过的,所以需要反序列化。

    * 由于版本差异的原因,以下方法并不是每个版本都适用,请自行尝试。

    方法1

    java -cp zookeeper-3.4.12.jar:slf4j-api-1.7.25.jar org.apache.zookeeper.server.LogFormatter 日志文件名 > temp.log

    方法2

    java -cp zookeeper-3.6.2/lib org.apache.zookeeper.server.LogFormatter 日志文件名 > temp.log

    方法3

    java -cp * org.apache.zookeeper.server.LogFormatter 日志文件名 > temp.log

    方法4

    hbase org.apache.zookeeper.server.LogFormatter 日志文件名 > temp.log

    方法5

    ZooKeeper 3.6版本及之后的版本,新增了2个日志读取工具,读取log和snapshots。

    zkTxnLogToolkit.sh -d 日志文件名
    zkSnapShotToolkit.sh -d 快照文件名

    zkTxnLogToolkit和zkSnapShotToolkit的参数说明:

    $ bin/zkTxnLogToolkit.sh
    usage: TxnLogToolkit [-dhrv] txn_log_file_name
    -d,--dump      Dump mode. Dump all entries of the log file. (this is the default)
    -h,--help      Print help message
    -r,--recover   Recovery mode. Re-calculate CRC for broken entries.
    -v,--verbose   Be verbose in recovery mode: print all entries, not just fixed ones.
    -y,--yes       Non-interactive mode: repair all CRC errors without asking

    * 上面命令中的jar包的版本号,根据实际安装的版本号修改一下,具体的查找命令:

    find -name zookeeper*jar
    find -name slf4j-api*jar
  • 相关阅读:
    Leetcode53_Spiral_Matrix
    leetcode 分类
    bash 脚本
    关闭占用端口
    blue bossa
    判断对称二叉树
    This server is in the failed servers list: localhost/127.0.0.1:16000 启动hbase api调用错误
    在cikuapi.com上抓取相关词
    那些天使用AWS填过的坑和注意事项
    一百个人的十年-读后感
  • 原文地址:https://www.cnblogs.com/live41/p/15468011.html
Copyright © 2011-2022 走看看