hbase常见错误

时间:2025-04-12 08:06:10

 

    1. hbase启动错误
      1. : The identifier of this process is 4818@localhost85

[root@localhost86 local]# hbase shell

HBase Shell; enter 'help<RETURN>' for list of supported commands.

Type "exit<RETURN>" to leave the HBase Shell

Version 0.94.7, r1471806, Wed Apr 24 18:44:36 PDT 2013

 

hbase(main):001:0> list

TABLE                                                                                          

17/04/01 19:15:06 ERROR : ZooKeeper exists failed after 3 retries

17/04/01 19:15:06 WARN : hconnection Unable to set watcher on znode (/hbase/hbaseid)

$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid

    at (:99)

    at (:51)

    at (:1041)

    at (:172)

    at (:450)

    at (:61)

    at (:50)

    at (:44)

    at

 

根据日志文件记录分析:

 vim

INFO : The identifier of this process is 4818@localhost85

原因:主要是中的值配置错误

<property>

<name></name>

<!--<value>localhost85,localhost86</value>-->

修改为以下内容

    <value>192.168.1.85,192.168.1.86</value>

  </property>

 

 

      1. : Server is not running yet

hbase(main):003:0* list

TABLE                                                                                                

 

ERROR: : Server is not running yet

    at (:2445)

    at (:946)

    at $MasterService$(:58521)

    at (:2339)

    at (:123)

    at $(:188)

    at $(:168)

 

Here is some help for this command:

List all tables in hbase. Optional regular expression parameter could

be used to filter the output. Examples:

 

  hbase> list

  hbase> list 'abc.*'

  hbase> list 'ns:abc.*'

  hbase> list 'ns:.*'

 

原因:

    Hadoop目录hdfs在访问时是受包含模式,取消hdfs目录访问安全模式。

解决办法:

进入hadoop安装目录中执行命令: bin/hdfs dfsadmin –safemode leave

 

 

      1. localhosti65: ssh: Could not resolve hostname localhosti65: Name or service not known

[root@localhost65 hbase-1.3.1]# bin/

localhost65: starting zookeeper, logging to /usr/local/hbase-1.3.1/bin/../logs/

starting master, logging to /usr/local/hbase-1.3.1/logs/

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0

localhosti65: ssh: Could not resolve hostname localhosti65: Name or service not known

[root@localhost65 hbase-1.3.1]#

问题原因:

    Hbase中链接Zookeeper配置写错。

解决办法:

    1.检查中的zookeeper链接ip,端口配置是否正确。如下:

<property>

                <name></name>

                <value>localhost65</value>

        </property>

<!--表示客户端连接 ZooKeeper 的端口 -->

        <property>

                <name></name>

                <value>2181</value>

        </property>

    2.检查regionservers 文件配置地址是否正确。如下:

    [root@localhost65 hbase-1.3.1]# vim conf/regionservers

localhost65 #域名

[root@localhost65 hbase-1.3.1]#

 

      1. ():`/hbase/WALs/localhost65,16201,1503546750714-splitting is non empty': Directory is not empty

2017-08-29 09:57:42,398 WARN  [ProcedureExecutor-0] : Returning success without actually splitting and deleting all the log files in path hdfs://192.168.3.65:9000/hbase/WALs/localhost65,16201,1503546750714-splitting: [FileStatus{path=hdfs://192.168.3.65:9000/hbase/WALs/localhost65,16201,1503546750714-splitting/localhost65%2C16201%.; isDirectory=false; length=83; replication=1; blocksize=134217728; modification_time=1503568364030; access_time=1503568364030; owner=root; group=supergroup; permission=rw-r--r--; isSymlink=false}]

(): `/hbase/WALs/localhost65,16201,1503546750714-splitting is non empty': Directory is not empty

    at (:4012)

    at (:3968)

    at (:3952)

    at (:825)

    at (:589)

    at $ClientNamenodeProtocol$()

    at $Server$(:619)

    at $(:962)

    at $Handler$(:2040)

    at $Handler$(:2036)

    at (Native Method)

    at (:422)

    at (:1656)

    at $(:2034)

 

该问题原因较多,从以下几个方面检查:

1、系统或hdfs是否有空间
2、datanode数是否正常 
3、是否在safemode 
4、防火墙关闭
5、配置方面
6、把NameNode的tmp文件清空,然后重新格式化NameNode

 

 

      1. ERROR:: Master is initializing

ERROR:: Master is initializing

at (:2452)

    at (:792)

    at $MasterService$(:58519)

    at (:2339)

    at (:123)

    at $(:188)

    at $(:168)

can't get master address from ZooKeeper

 

解决办法:

通过查看日志信息来分析,可以看出hbase数据库 shell运行失败的原因大概就是时钟不同步了。安装ntpdate, sudo apt-get install ntpdate后,运行shell命令:ntpdate      这个命令很简单,参数可以选择任意一个时间服务器的地址,然后重启hbase数据库:bin/     bin/  即可。可能会出现 can't get master address from ZooKeeper错误,这可能是由于ZooKeeper不稳定造成的,我试着又重启了一下,就可以了。

 

 

      1. Can't get master address from ZooKeeper; znode data == null

hbase(main):001:0> status

 

ERROR: Can't get master address from ZooKeeper; znode data == null

 

Here is some help for this command:

Show cluster status. Can be 'summary', 'simple', 'detailed', or 'replication'. The

default is 'summary'. Examples:

 

 

      1. : callTimeout=60000, callDuration=68489

hbase(main):029:0>

hbase(main):029:0> [root@node3 ~]# hive

 

Logging initialized using configuration in jar:file:/opt/cloudera/parcels/CDH-5.10.0-1.cdh5.10.0.p0.41/jars/hive-common-1.1.0-cdh5.10.!/

WARNING: Hive CLI is deprecated and migration to Beeline is recommended.

hive> select *  FROM TempLogTerminal WHERE RESOURCETYPE=32 AND  AreaCode='610103' AND KEY LIKE 'T%';

Query ID = root_20180227182020_72cd9a43-95b7-4e89-82d1-15feea3af10e

Total jobs = 1

Launching Job 1 out of 1

Number of reduce tasks is set to 0 since there's no reduce operator

Starting Job = job_1519724327083_0007, Tracking URL = http://node1:8088/proxy/application_1519724327083_0007/

Kill Command = /opt/cloudera/parcels/CDH-5.10.0-1.cdh5.10.0.p0.41/lib/hadoop/bin/hadoop job  -kill job_1519724327083_0007

Hadoop job information for Stage-1: number of mappers: 22; number of reducers: 0

2018-02-27 18:21:08,970 Stage-1 map = 0%,  reduce = 0%

2018-02-27 18:21:31,265 Stage-1 map = 9%,  reduce = 0%, Cumulative CPU 8.69 sec

2018-02-27 18:21:32,334 Stage-1 map = 23%,  reduce = 0%, Cumulative CPU 17.66 sec

2018-02-27 18:21:34,470 Stage-1 map = 27%,  reduce = 0%, Cumulative CPU 21.59 sec

2018-02-27 18:21:36,574 Stage-1 map = 32%,  reduce = 0%, Cumulative CPU 25.94 sec

2018-02-27 18:21:38,662 Stage-1 map = 36%,  reduce = 0%, Cumulative CPU 33.28 sec

2018-02-27 18:21:39,704 Stage-1 map = 41%,  reduce = 0%, Cumulative CPU 33.44 sec

2018-02-27 18:21:40,730 Stage-1 map = 50%,  reduce = 0%, Cumulative CPU 37.89 sec

2018-02-27 18:21:48,923 Stage-1 map = 55%,  reduce = 0%, Cumulative CPU 39.94 sec

2018-02-27 18:21:50,987 Stage-1 map = 59%,  reduce = 0%, Cumulative CPU 43.99 sec

2018-02-27 18:21:52,008 Stage-1 map = 73%,  reduce = 0%, Cumulative CPU 55.82 sec

2018-02-27 18:21:53,032 Stage-1 map = 77%,  reduce = 0%, Cumulative CPU 60.51 sec

2018-02-27 18:21:54,067 Stage-1 map = 86%,  reduce = 0%, Cumulative CPU 69.67 sec

2018-02-27 18:21:56,109 Stage-1 map = 91%,  reduce = 0%, Cumulative CPU 73.65 sec

2018-02-27 18:22:56,560 Stage-1 map = 91%,  reduce = 0%, Cumulative CPU 73.65 sec

2018-02-27 18:23:57,063 Stage-1 map = 91%,  reduce = 0%, Cumulative CPU 73.65 sec

2018-02-27 18:24:55,426 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 73.65 sec

MapReduce Total cumulative CPU time: 1 minutes 13 seconds 650 msec

Ended Job = job_1519724327083_0007 with errors

Error during job, obtaining debugging information...

Examining task ID: task_1519724327083_0007_m_000002 (and more) from job job_1519724327083_0007

Examining task ID: task_1519724327083_0007_m_000016 (and more) from job job_1519724327083_0007

Examining task ID: task_1519724327083_0007_m_000020 (and more) from job job_1519724327083_0007

 

Task with the most failures(4):

-----

Task ID:

  task_1519724327083_0007_m_000020

 

URL:

  http://0.0.0.0:8088/?jobid=job_1519724327083_0007&tipid=task_1519724327083_0007_m_000020

-----

Diagnostic Messages for this Task:

Error: : : Failed after attempts=36, exceptions:

Tue Feb 27 18:24:45 CST 2018, null, : callTimeout=60000, callDuration=68489: row 'TC09F0534B145' on table 'LOG20180108' at region=LOG20180108,TC09F0534B145,1515254515969.dbd4f4e281c3c7d6d765352f6f990af7., hostname=node2,60020,1519721631359, seqNum=4326

 

    at (:97)

    at (:57)

    at (:252)

    at (:703)

    at $TrackedRecordReader.<init>(:169)

    at (:432)

    at (:343)

    at $(:164)

    at (Native Method)

    at (:415)

    at (:1796)

    at (:158)

Caused by: : Failed after attempts=36, exceptions:

Tue Feb 27 18:24:45 CST 2018, null, : callTimeout=60000, callDuration=68489: row 'TC09F0534B145' on table 'LOG20180108' at region=LOG20180108,TC09F0534B145,1515254515969.dbd4f4e281c3c7d6d765352f6f990af7., hostname=node2,60020,1519721631359, seqNum=4326

 

    at (:286)

    at (:231)

    at (:61)

   at (:200)

    at (:320)

    at (:295)

    at (:160)

    at .<init>(:155)

    at (:867)

    at (:91)

    at (:169)

    at (:134)

    at $(:211)

    at (:118)

    at (:250)

    ... 9 more

Caused by: : callTimeout=60000, callDuration=68489: row 'TC09F0534B145' on table 'LOG20180108' at region=LOG20180108,TC09F0534B145,1515254515969.dbd4f4e281c3c7d6d765352f6f990af7., hostname=node2,60020,1519721631359, seqNum=4326

    at (:159)

    at $(:80)

    at (:1145)

    at $(:615)

    at (:745)

Caused by: : : Region LOG20180108,TC09F0534B145,1515254515969.dbd4f4e281c3c7d6d765352f6f990af7. is not online on node2,60020,1519721631359

    at (:2921)

    at (:1053)

    at (:2384)

    at $ClientService$(:33648)

    at (:2170)

    at (:109)

    at $(:185)

    at $(:165)

 

    at .newInstance0(Native Method)

    at (:57)

    at (:45)

    at (:526)

    at (:106)

    at (:95)

    at (:327)

    at (:402)

    at (:203)

    at (:64)

   at (:200)

    at $(:381)

    at $(:355)

    at (:126)

    ... 4 more

Caused by: (): : Region LOG20180108,TC09F0534B145,1515254515969.dbd4f4e281c3c7d6d765352f6f990af7. is not online on node2,60020,1519721631359

    at (:2921)

    at (:1053)

    at (:2384)

    at $ClientService$(:33648)

    at (:2170)

    at (:109)

    at $(:185)

    at $(:165)

 

    at (:1269)

    at (:227)

    at $(:336)

    at $ClientService$(:34094)

    at (:394)

    ... 10 more

 

 

FAILED: Execution Error, return code 2 from

MapReduce Jobs Launched:

Stage-Stage-1: Map: 22   Cumulative CPU: 73.65 sec   HDFS Read: 445399 HDFS Write: 2667943 FAIL

Total MapReduce CPU Time Spent: 1 minutes 13 seconds 650 msec

hive>

解决 办法:

设置连接超时时间:

",20000

",30000

",200000