远程调试HBase
步骤:
1 修改HBASE_HOME/bin/hbase文件,增加-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=10444
如
figure out which class to run if [ “COMMAND"="shell"];thenelif["COMMAND” = “master” ] ; then CLASS=‘org.apache.hadoop.hbase.master.HMaster’
HBASE_OPTS=“HBASEOPTS−Xdebug−Xrunjdwp:transport=dtsocket,server=y,suspend=n,address=10444"elif["COMMAND” = “regionserver” ] ; then
CLASS=‘org.apache.hadoop.hbase.regionserver.HRegionServer’ elif [ “$COMMAND” = “rest” ] ; then CLASS=‘org.apache.hadoop.hbase.rest.Dispatcher’ elif [
“COMMAND"="thrift"];thenCLASS=′org.apache.hadoop.hbase.thrift.ThriftServer′elif["COMMAND” = “migrate” ] ; then
CLASS=‘org.apache.hadoop.hbase.util.Migrate’ elif [ “$COMMAND” = “zookeeper” ] ; then CLASS=‘org.apache.hadoop.hbase.zookeeper.HQuorumPeer’ else
CLASS=$COMMAND fi
2 修改HBASE_HOME/conf/hbase-site.xml文件
zookeeper.session.timeout 300000 ZooKeeper session timeout. This option is not used by HBase directly, it
is for the internals of ZooKeeper. HBase merely passes it in whenever a connection is established to ZooKeeper. It is used by ZooKeeper for hearbeats. In
milliseconds. hbase.zookeeper.property.tickTime 2000000 Property from
ZooKeeper’s config zoo.cfg. The number of milliseconds of each tick.
bin/start-hbase.xml,启动HBase集群。
3 设置eclipse
选择Remote Java Application,右键New
写入名字,选择要调试的工程
默认Connection Type(Socket Attach)
写入Host和port,点击Apply,Debug.
可以通过lsof -i 10444查看是否连接上。
4 加入断点,进行调试
在源码中createTable函数加断点
在远程hbase shell中写:create ‘t1’,‘f1’
即可进入断点处
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。