您好,登錄后才能下訂單哦!
這篇文章將為大家詳細講解有關如何分布式安裝Hbase,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
[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
查看
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
</configuration>
拷貝驅動,因為要支持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<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
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”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。