Hadoop 错误:java.io.IOException:表命名空间管理器尚未就绪,请稍后重试
我正在使用HDP2平台。在使用HBase时。我正在尝试在HBase中创建表。下面是我正在使用的命令 hbase(主):002:0>创建“测试”、“cf1”和“cf2” 但它给了我以下的错误Hadoop 错误:java.io.IOException:表命名空间管理器尚未就绪,请稍后重试,hadoop,hbase,apache-zookeeper,hadoop2,hortonworks-data-platform,Hadoop,Hbase,Apache Zookeeper,Hadoop2,Hortonworks Data Platform,我正在使用HDP2平台。在使用HBase时。我正在尝试在HBase中创建表。下面是我正在使用的命令 hbase(主):002:0>创建“测试”、“cf1”和“cf2” 但它给了我以下的错误 ERROR: java.io.IOException: Table Namespace Manager not ready yet, try again later at org.apache.hadoop.hbase.master.HMaster.getNamespaceDescriptor
ERROR: java.io.IOException: Table Namespace Manager not ready yet, try again later
at org.apache.hadoop.hbase.master.HMaster.getNamespaceDescriptor(HMaster.java:3328)
at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1781)
at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1911)
at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:40470)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2078)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:108)
at org.apache.hadoop.hbase.ipc.FifoRpcScheduler$1.run(FifoRpcScheduler.java:74)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Here is some help for this command:
Creates a table. Pass a table name, and a set of column family
specifications (at least one), and, optionally, table configuration.
Column specification can be a simple string (name), or a dictionary
(dictionaries are described below in main help output), necessarily
including NAME attribute.
Examples:
Create a table with namespace=ns1 and table qualifier=t1
hbase> create 'ns1:t1', {NAME => 'f1', VERSIONS => 5}
Create a table with namespace=default and table qualifier=t1
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
hbase> # The above in shorthand would be the following:
hbase> create 't1', 'f1', 'f2', 'f3'
hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
hbase> create 't1', {NAME => 'f1', CONFIGURATION => {'hbase.hstore.blockingStoreFiles' => '10'}}
Table configuration options can be put at the end.
Examples:
hbase> create 'ns1:t1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe'
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 'myvalue' }
hbase> # Optionally pre-split the table into NUMREGIONS, using
hbase> # SPLITALGO ("HexStringSplit", "UniformSplit" or classname)
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit', REGION_REPLICATION => 2, CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand'
=> 'true'}}
You can also keep around a reference to the created table:
hbase> t1 = create 't1', 'f1'
Which gives you a reference to the table named 't1', on which you can then
call methods
下面是我的hbase-site.xml文件
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
* Copyright 2010 The Apache Software Foundation
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://severname:8020/apps/hbase/data</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>my_server_name</value>
</property>
<property>
<name>hbase.log.dir</name>
<value>d:\hadoop\logs\hbase</value>
</property>
<property>
<name>hbase.regionserver.wal.codec</name>
<value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property>
</configuration>
hbase.rootdir
hdfs://severname:8020/apps/hbase/data
hbase.cluster.distributed
真的
hbase.zookeeper.quorum
我的服务器名称
hbase.log.dir
d:\hadoop\logs\hbase
hbase.regionserver.wal.codec
org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec
hbase.zookeeper.property.clientPort
2181
请帮助我解决此问题。实际上,在调查区域服务器日志文件之后。我理解这个问题。问题是
2015-03-12 18:10:27,718 WARN org.apache.hadoop.hdfs.DFSClient: Last block locations not available. Datanodes might not have reported blocks completely. Will retry for 1 times
2015-03-12 18:10:31,720 ERROR org.apache.hadoop.hbase.regionserver.wal.HLogFactory: Can't open after 24 attempts and 310413ms for hdfs://server_name(name_node):8020/apps/hbase/data/WALs/region_server1,60020,1424845883415-splitting/region_server1%2C60020%2C1424845883415.1424856732238
2015-03-12 18:10:31,720 INFO org.apache.hadoop.hbase.regionserver.wal.HLogSplitter: Processed 0 edits across 0 regions; log file=hdfs://server_name(namenode):8020/apps/hbase/data/WALs/region_server160020,1424845883415-splitting/region_server1%2C60020%2C1424845883415.1424856732238 is corrupted = false progress failed = false
2015-03-12 18:10:31,720 WARN org.apache.hadoop.hbase.regionserver.SplitLogWorker: log splitting of WALs/region_server1,60020,1424845883415-splitting/region_server1%2C60020%2C1424845883415.1424856732238 failed, returning error
java.io.IOException: Could not obtain the last block locations.
at org.apache.hadoop.hdfs.DFSInputStream.openInfo(DFSInputStream.java:257)
at org.apache.hadoop.hdfs.DFSInputStream.<init>(DFSInputStream.java:231)
at org.apache.hadoop.hdfs.DFSClient.open(DFSClient.java:1498)
at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:302)
at org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:298)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.open(DistributedFileSystem.java:298)
at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:766)
at org.apache.hadoop.hbase.regionserver.wal.HLogFactory.createReader(HLogFactory.java:116)
at org.apache.hadoop.hbase.regionserver.wal.HLogFactory.createReader(HLogFactory.java:89)
at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.getReader(HLogSplitter.java:639)
at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.getReader(HLogSplitter.java:564)
at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.splitLogFile(HLogSplitter.java:277)
at org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.splitLogFile(HLogSplitter.java:220)
at org.apache.hadoop.hbase.regionserver.SplitLogWorker$1.exec(SplitLogWorker.java:143)
at org.apache.hadoop.hbase.regionserver.handler.HLogSplitterHandler.process(HLogSplitterHandler.java:82)
at org.apache.hadoop.hbase.executor.EventHandler.run(EventHandler.java:128)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2015-03-12 18:10:27718警告org.apache.hadoop.hdfs.DFSClient:最后一个块位置不可用。Datanodes可能没有完全报告块。将重试1次
2015-03-12 18:10:31720错误org.apache.hadoop.hbase.regionserver.wal.HLogFactory:在24次尝试和310413ms后无法打开hdfs://server_name(名称节点):8020/apps/hbase/data/WALs/region\u服务器1600201424845883415-spliting/region\u服务器1%2C60020%2C1424845883415.1424856732238
2015-03-12 18:10:31720 INFO org.apache.hadoop.hbase.regionserver.wal.HLogSplitter:处理了0个区域的0个编辑;日志文件=hdfs://server_name(名称节点):8020/apps/hbase/data/WALs/region_server1600201424845883415-spliting/region_server1%2C60020%2C1424845883415.1424856732238已损坏=错误进度失败=错误
2015-03-12 18:10:31720警告org.apache.hadoop.hbase.regionserver.SplitLogWorker:WALs/region_服务器1600201424845883415-spliting/region_服务器1%2C60020%2C1424845883415.1424856732238日志拆分失败,返回错误
java.io.IOException:无法获取最后一个块位置。
位于org.apache.hadoop.hdfs.DFSInputStream.openInfo(DFSInputStream.java:257)
位于org.apache.hadoop.hdfs.DFSInputStream。(DFSInputStream.java:231)
位于org.apache.hadoop.hdfs.DFSClient.open(DFSClient.java:1498)
位于org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:302)
位于org.apache.hadoop.hdfs.DistributedFileSystem$3.doCall(DistributedFileSystem.java:298)
位于org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
位于org.apache.hadoop.hdfs.DistributedFileSystem.open(DistributedFileSystem.java:298)
位于org.apache.hadoop.fs.FileSystem.open(FileSystem.java:766)
位于org.apache.hadoop.hbase.regionserver.wal.HLogFactory.createReader(HLogFactory.java:116)
位于org.apache.hadoop.hbase.regionserver.wal.HLogFactory.createReader(HLogFactory.java:89)
位于org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.getReader(HLogSplitter.java:639)
位于org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.getReader(HLogSplitter.java:564)
位于org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.splitLogFile(HLogSplitter.java:277)
位于org.apache.hadoop.hbase.regionserver.wal.HLogSplitter.splitLogFile(HLogSplitter.java:220)
位于org.apache.hadoop.hbase.regionserver.SplitLogWorker$1.exec(SplitLogWorker.java:143)
位于org.apache.hadoop.hbase.regionserver.handler.HLogSplitterHandler.process(HLogSplitterHandler.java:82)
位于org.apache.hadoop.hbase.executor.EventHandler.run(EventHandler.java:128)
位于java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
位于java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
运行(Thread.java:745)
所以,我尝试了一些文件系统检查HBase
hbase-hbck
它向我展示了两个不一致之处
然后我通过使用hbase hbck-fix命令来解决这个问题