您好,登錄后才能下訂單哦!
這篇文章主要介紹“hbase表結構及安裝部署過程”,在日常操作中,相信很多人在hbase表結構及安裝部署過程問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”hbase表結構及安裝部署過程”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!
hbase表結構及安裝部署
建表時只需要指定表名和列族
每一行是一條記錄, 每一行的字段數是任意的,每一個字段都要指定存儲
字段名和字段值,查詢某一個字段時,需要指定的坐標:表名--行健--列族
字段名clolumn family 字段
[root@hadoop04 Desktop]# tar -zxvf hbase-0.96.2-hadoop2-bin.tar.gz -C ../app
[root@hadoop04 Desktop]# cd ../app
[root@hadoop04 app]# cd hbase-0.96.2-hadoop2
[root@hadoop04 hbase-0.96.2-hadoop2]# ls
bin conf hbase-webapps LICENSE.txt README.txt
CHANGES.txt docs lib NOTICE.txt
[root@hadoop04 hbase-0.96.2-hadoop2]# cd conf
[root@hadoop04 conf]# ls
hadoop-metrics2-hbase.properties hbase-policy.xml regionservers
hbase-env.cmd hbase-site.xml
hbase-env.sh log4j.properties
[root@hadoop04 conf]# echo $JAVA_HOME
/usr/lib/java/java-7-sun
[root@hadoop04 conf]# vi hbase-env.sh
export JAVA_HOME=/usr/lib/java/java-7-sun
export HBASE_MANAGES_ZK=false指定外部的zk
[root@hadoop04 conf]# vi 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>hadoop01:2181,hadoop02:2181,hadoop03:2181</value>
</property>
</configuration>
[root@hadoop04 conf]# vi regionservers
hadoop01
hadoop02
hadoop03
注意要把hadoop 的hdfs-site.xml,core-site.xml放到hbase/conf下
[root@hadoop04 conf]# cp /home/hadoop/hadoop-2.6.0/etc/hadoop/{core-site.xml,hdfs-site.xml} ./
[root@hadoop05 ~]# mkdir /root/app
[root@hadoop01 ~]# mkdir /root/app
[root@hadoop02 ~]# mkdir /root/app
[root@hadoop03 ~]# mkdir /root/app
[root@hadoop04 app]# scp -r hbase-0.96.2-hadoop2/ hadoop05:/root/app
[root@hadoop04 app]# scp -r hbase-0.96.2-hadoop2/ hadoop01:/root/app
[root@hadoop04 app]# scp -r hbase-0.96.2-hadoop2/ hadoop02:/root/app
[root@hadoop04 app]# scp -r hbase-0.96.2-hadoop2/ hadoop03:/root/app
[root@hadoop04 app]# hdfs dfsadmin report
[root@hadoop04 app]# cd hbase-0.96.2-hadoop2
[root@hadoop04 hbase-0.96.2-hadoop2]# cd bin
[root@hadoop04 bin]# ./start-hbase.sh
starting master, logging to /root/app/hbase-0.96.2-hadoop2/bin/../logs/hbase-root-master-hadoop04.out
hadoop03: starting regionserver, logging to /root/app/hbase-0.96.2-hadoop2/bin/../logs/hbase-root-regionserver-hadoop03.out
hadoop02: starting regionserver, logging to /root/app/hbase-0.96.2-hadoop2/bin/../logs/hbase-root-regionserver-hadoop02.out
hadoop01: starting regionserver, logging to /root/app/hbase-0.96.2-hadoop2/bin/../logs/hbase-root-regionserver-hadoop01.out
[root@hadoop04 bin]# jps
16023 Jps
25023 DFSZKFailoverController
24498 NameNode
15805 HMaster
[root@hadoop01 app]# jps
15125 DataNode
19939 HRegionServer
20100 Jps
15243 NodeManager
4649 QuorumPeerMain
4822 JournalNode
[root@hadoop04 bin]# ./hbase shell
2016-01-16 18:51:14,061 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.96.2-hadoop2, r1581096, Mon Mar 24 16:03:18 PDT 2014
hbase(main):001:0>
hbase(main):013:0> help
啟動所有的hbase
分別啟動zk
./zkServer.sh start
啟動hbase集群
start-dfs.sh
啟動hbase,在主節點上運行
start-hbase.sh
通過瀏覽器訪問hbase管理頁面
hadoop04:60010
為保證集群的可靠性,要啟動多個hmaster
hbase-daemon.sh start master
到此,關于“hbase表結構及安裝部署過程”的學習就結束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續學習更多相關知識,請繼續關注億速云網站,小編會繼續努力為大家帶來更多實用的文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。