欢迎投稿

今日深度:

hbase的搭建,

hbase的搭建,


hbase的伪分布式(单结点):
1.修改hbase-env.sh 
将java的路径修改一下。
2.修改hbase-site.xml ,将数据库文件保存到本地文件系统。
<property>
                <name>hbase.rootdir<name>
                <value>file:///root/hbase<value>
</property>


3.启动hbase
 ./start-hbase.sh 
4.启动hbase命令行

./hbase shell


hbase的完全分布式的搭建(在http://blog.csdn.net/vinsuan1993/article/details/70155112 基础上进行搭建)

配置hbase集群,要修改3个文件(首先zk集群已经安装好了)
注意:要把hadoop的hdfs-site.xml和core-site.xml 放到hbase/conf下

1.修改hbase-env.sh
export JAVA_HOME=/usr/java/jdk1.7.0_55
//告诉hbase使用外部的zk 
export HBASE_MANAGES_ZK=false

vim hbase-site.xml

<configuration>
		<!-- 指定hbase在HDFS上存储的路径 -->
        <property>
                <name>hbase.rootdir</name>
                <value>hdfs://ns1/hbase</value>
        </property>
		<!-- 指定hbase是分布式的 -->
        <property>
                <name>hbase.cluster.distributed</name>
                <value>true</value>
        </property>
		<!-- 指定zk的地址,多个用“,”分割 -->
        <property>
                <name>hbase.zookeeper.quorum</name>
                <value>heres04:2181,heres05:2181,heres06:2181</value>
        </property>
	</configuration>


vim regionservers
	heres03
	heres04
	heres05
	heres06



2拷贝hbase到其他节点

scp conf/hbase-site.xml heres06:/heres/hbase-0.96.2-hadoop2/conf/

scp conf/hbase-site.xml heres05:/heres/hbase-0.96.2-hadoop2/conf/

scp conf/hbase-site.xml heres04:/heres/hbase-0.96.2-hadoop2/conf/
scp conf/hbase-site.xml heres02:/heres/hbase-0.96.2-hadoop2/conf/

scp conf/hbase-site.xml heres03:/heres/hbase-0.96.2-hadoop2/conf/

3.这时如果想启动hbase,你回发现HRegionServer起不开,原因是各节点中HRegionServer的不知道连接哪个nameNode(它不知道ns1是啥,ns1下有几个nameNode?哪个nameNade在哪台机器上?hbase不知道,所以要配置)。有两种方法:

法一:

将hadoop集群中的两个配置文件拷贝到hbase的conf目录下:

 scp core-site.xml hdfs-site.xml heres02:/heres/hbase-0.96.2-hadoop2/conf/ 

 scp core-site.xml hdfs-site.xml heres03:/heres/hbase-0.96.2-hadoop2/conf/

 scp core-site.xml hdfs-site.xml heres04:/heres/hbase-0.96.2-hadoop2/conf/

 scp core-site.xml hdfs-site.xml heres04:/heres/hbase-0.96.2-hadoop2/conf/

 scp core-site.xml hdfs-site.xml heres06:/heres/hbase-0.96.2-hadoop2/conf/

法二:

直接修改hbase-site.xml


4.将配置好的HBase拷贝到每一个节点并同步时间。


5.启动所有的hbase
分别启动zk
./zkServer.sh start
启动hbase集群
start-dfs.sh
启动hbase,在主节点上运行:
start-hbase.sh
6.通过浏览器访问hbase管理页面
192.168.1.201:60010
7.为保证集群的可靠性,要启动多个HMaster
hbase-daemon.sh start master

注:按照上面的流程配置,你可能还会发现hbase集群部分节点HRegionServer启动后自动关闭的问题。

这是由于你忽视了配置的第四步。可参考博客:http://blog.csdn.net/vinsuan1993/article/details/71023713

www.htsjk.Com true http://www.htsjk.com/hbase/42075.html NewsArticle hbase的搭建, hbase的伪分布式(单结点): 1.修改hbase-env.sh  将java的路径修改一下。 2.修改hbase-site.xml ,将数据库文件保存到本地文件系统。 property                 namehbase.rootdirnam...
相关文章
    暂无相关文章
评论暂时关闭