hbase表结构及安装部署过程
这篇文章主要介绍"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
[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
Type "exit
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表结构及安装部署过程"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!