如何分布式安装Hbase
这篇文章将为大家详细讲解有关如何分布式安装Hbase,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
创新互联是一家企业级云计算解决方案提供商,超15年IDC数据中心运营经验。主营GPU显卡服务器,站群服务器,温江服务器租用,海外高防服务器,机柜大带宽、租用·托管,动态拨号VPS,海外云手机,海外云服务器,海外服务器租用托管等。
[hadoop@master conf]$ pwd
/home/hadoop/hbase/conf
[hadoop@master conf]$ vim hbase-env.sh
[hadoop@master conf]$
export HBASE_CLASSPATH=/home/hadoop/hadoop/conf
BASE_MANAGES_ZK=true
[hadoop@master conf]$ vim hbase-site.xml
如果想知道默认参数在哪里可以
[hadoop@master hbase]$ find . -name "*default*"
./docs/hbase-default.xml
./src/main/resources/hbase-default.xml
[hadoop@master hbase]$ vim src/main/resources/hbase-default.xml
查看
拷贝驱动,因为要支持hadoop
[hadoop@master lib]$ ll hadoop-core-1.0.4.jar
-rw-r--r-- 1 hadoop hadoop 3929148 2014-01-11 hadoop-core-1.0.4.jar
这时候发现是hadoop 1.0.4 我们使用的是1.2.1
这个jar可以删除,拷贝新的过来
[hadoop@master lib]$ mv hadoop-core-1.0.4.jar hadoop-core-1.0.4.sav
[hadoop@master lib]$ cp /home/hadoop/hadoop/hadoop-core-1.2.1.jar .
[hadoop@master lib]$ ll hadoop-core-1.
hadoop-core-1.0.4.sav hadoop-core-1.2.1.jar
到这里伪分布式ok
[hadoop@master conf]$ start-hbase.sh
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 6d:ef:a5:75:27:1d:7f:60:eb:ef:bc:dc:7c:4d:f7:a4.
Are you sure you want to continue connecting (yes/no)? yes
localhost: Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
localhost: starting zookeeper, logging to /home/hadoop/hbase/logs/hbase-hadoop-zookeeper-master.out
starting master, logging to /home/hadoop/hbase/logs/hbase-hadoop-master-master.out
localhost: starting regionserver, logging to /home/hadoop/hbase/logs/hbase-hadoop-regionserver-master.out
[hadoop@master conf]$ jps
5248 HRegionServer
5946 NameNode
5068 HMaster
5492 Jps
4953 HQuorumPeer
6189 JobTracker
6108 SecondaryNameNode
[hadoop@master conf]$ hbase shell
HBase Shell; enter 'help
Type "exit
Version 0.94.16, r1557241, Fri Jan 10 20:10:24 UTC 2014
hbase(main):001:0> status
1 servers, 0 dead, 2.0000 average load
hbase(main):002:0> status 'simple'
1 live servers
master:60020 1414089200727
requestsPerSecond=0, numberOfOnlineRegions=2, usedHeapMB=30, maxHeapMB=48
0 dead servers
Aggregate load: 0, regions: 2
[hadoop@master ~]$ hadoop fs -ls /
Found 4 items
drwxr-xr-x - hadoop supergroup 0 2014-10-24 02:33 /hbase
drwxr-xr-x - hadoop supergroup 0 2014-10-15 07:42 /home
drwxr-xr-x - hadoop supergroup 0 2014-10-15 08:38 /system
drwxr-xr-x - hadoop supergroup 0 2014-10-15 08:33 /user
[hadoop@master ~]$
停止hbase
删除这些内容
[hadoop@master ~]$ hadoop fs -ls /hbase
Found 7 items
drwxr-xr-x - hadoop supergroup 0 2014-10-24 02:33 /hbase/-ROOT-
drwxr-xr-x - hadoop supergroup 0 2014-10-24 02:33 /hbase/.META.
drwxr-xr-x - hadoop supergroup 0 2014-10-24 02:33 /hbase/.logs
drwxr-xr-x - hadoop supergroup 0 2014-10-24 02:33 /hbase/.oldlogs
drwxr-xr-x - hadoop supergroup 0 2014-10-24 02:33 /hbase/.tmp
-rw-r--r-- 2 hadoop supergroup 38 2014-10-24 02:33 /hbase/hbase.id
-rw-r--r-- 2 hadoop supergroup 3 2014-10-24 02:33 /hbase/hbase.version
因为集群有唯一的东西比如ID
[hadoop@master ~]$ stop-hbase.sh
stopping hbase...........
localhost: stopping zookeeper.
[hadoop@master ~]$
[hadoop@master ~]$ hadoop fs -rmr /hbase
Deleted hdfs://master:9000/hbase
[hadoop@master ~]$
关于“如何分布式安装Hbase”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
网站题目:如何分布式安装Hbase
本文URL:http://pwwzsj.com/article/ighopi.html