hbase:伪分布环境搭建及常见错误解决方法
配置注意事项
HBase使用本地 hostname 才获得IP地址. 正反向的DNS都是可以的.
如果你的机器有多个接口,HBase会使用hostname指向的主接口.
如果还不够,你可以设置 hbase.regionserver.dns.interface 来指定主接口。当然你的整个集群的配置文件都必须一致,每个主机都使用相同的网络接口
还有一种方法是设置 hbase.regionserver.dns.nameserver来指定nameserver,不使用系统带的.
127.0.0.1 localhost127.0.0.1 ubuntu.ubuntu-domain ubuntu4、集群系统时间同步
集群的时钟要保证基本的一致。稍有不一致是可以容忍的,但是很大的不一致会造成奇怪的行为。 运行 NTP 或者其他什么东西来同步你的时间.
如果查询的时候或者是遇到奇怪的故障,可以检查一下系统时间是否正确。使用命令date。
如果你使用的是Ubuntu,你可以这样设置:
在文件 /etc/security/limits.conf 添加一行,如:
hadoop - nofile 32768HBase 伪分布式模式配置:伪分布式模式是一个相对简单的分布式模式。这个模式是用来测试的。不能把这个模式用于生产环节,也不能用于测试性能。
<?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://master:9000/hbase</value></property><property> <name>dfs.replication</name> <value>1</value></property><property> <name>hbase.zookeeper.quorum</name> <value>master</value></property><property> <name>hbase.cluster.distributed</name> <value>true</value></property></configuration>~~"hbase-site.xml" [readonly] 41L, 1345CHDFS客户端配置 如果希望Hadoop集群上做HDFS 客户端配置 ,例如HDFS客户端的配置和服务端的不一样。按照如下的方法配置,HBase就能看到配置信息:
http://master:60010/master-status
2013-09-09 10:28:02,878 WARN org.apache.hadoop.hbase.util.FSUtils: Unable to create version file at hdfs://master:9000/hbase, retrying: org.apache.hadoop.security.AccessControlException: Permission denied: user=root, access=WRITE, inode="hbase":hadoop:supergroup:rwxr-xr-x2013-09-09 10:28:02,881 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.org.apache.hadoop.security.AccessControlException: org.apache.hadoop.security.AccessControlException: Permission denied: user=root, access=WRITE, inode="hbase":hadoop:supergroup:rwxr-xr-xD、java.io.FileNotFoundException: /usr/local/hadoop/hbase/hbase-0.94.11-security/logs/SecurityAuth.audit (Permission denied)解决方法:A、使用命令查看hadoop是否处于安全模式,如果是,使离开。
$hadoop dfsadmin -safemode get
$hadoop dfsadmin -safemode leaveB、很简单,将hbase/lib目录下的hadoop-core的jar文件删除,将hadoop目录下的hadoop-x.y.z-core.jar拷贝到hbase/lib下面,然后重新启动hbase即可。C、更改权限。
$sudo chmod a+rwx /usr/local/hadoop/hbase/hbase-0.94.11-security/bin/../logs/SecurityAuth.audit2、ERROR: org.apache.hadoop.hbase.MasterNotRunningException: null解决方法:
A、启动hadoop后,需要等一段时间,再开启hbase
B、去掉hadoop的安全模式:
hadoop dfsadmin -safemode leave
3、在secureCRT中hbase shell命令下无法回删在secureCRT中,点击【选项】【回话选项】【终端】【仿真】,右边的终端选择linux,在hbase shell中如输入出错,按住Ctrl+删除键 即可删除!