总结的一些Hbase shell的命令
都很简单,可以help来查看帮助
create 'user_test','info'
describe 'user_test'
disable 'user_testinfo'
drop 'user_testinfo'
put 'user_test','test-1','info:username','test1'
put 'user_test','test-1','info','1'
put 'user_test','test-2','info:creattime','20101116'
list
scan 'user_test'
#可以指定startrow,stoprow来scan多个row
scan 'user_test',{COLUMNS =>'info:username',LIMIT =>10, STARTROW => 'test',STOPROW=>'test2'}
get 'user_test','test-1'
get 'user_test','test-1',{COLUMN => 'info:username'}
#删除某行的某一列,比如username那列的值
delete 'user_test','test-1','info:username'
#删除某行所有的列
deleteall 'user_test','test-2'
count 'user_test'
status 'detailed'
=======================================
基于现有的Hadoop集群,来搭建Hbase的环境
整个过程还是比较简单的
1. 下载Hbase源码,并解压
cp hbase-0.20.6.tar.gz /opt/hadoop/
cd /opt/hadoop/
tar zxvf hbase-0.20.6.tar.gz
ln -s hbase-0.20.6 hbase2.修改hbase-env.sh,加入java环境,并修改log位置
export JAVA_HOME=/opt/java/jdk
export HBASE_LOG_DIR=/opt/log/hbase
export HBASE_MANAGES_ZK=true3. 修改hbase-site.xml,配置hbase
<property>
<name>hbase.rootdir</name>
<value>hdfs://zw-hadoop-master:9000/hbase</value>
<description>The directory shared by region servers.</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
<description>The mode the cluster will be in. Possible values are
false: standalone and pseudo-distributed setups with managed Zookeeper
true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
</description>
</property>
<property>
<name>hbase.master</name>
<value>hdfs://zw-hadoop-master:60000</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>zw-hadoop-slave225,zw-hadoop-slave226,zw-hadoop-slave227</value>
<description>Comma separated list of servers in the ZooKeeper Quorum. For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com". By default this is set to localhost for local and pseudo-distributed modes of operation. For a fully-distributed setup, this should be set to a full list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh this is the list of servers which we will start/stop ZooKeeper on.
</description>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/opt/log/zookeeper</value>
<description>Property from ZooKeeper's config zoo.cfg.
The directory where the snapshot is stored.
</description>
</property>几个配置的说明:
- hbase.rootdir设置hbase在hdfs上的目录,主机名为hdfs的namenode节点所在的主机
- hbase.cluster.distributed设置为true,表明是完全分布式的hbase集群
- hbase.master设置hbase的master主机名和端口
- hbase.zookeeper.quorum设置zookeeper的主机,官方推荐设置为3,5,7比较好
4. 编辑regionservers文件,设置regionservers的服务器,和hadoop的slaves一样即可
5. 启动Hbase
/opt/sohuhadoop/hbase/bin/start-hbase.sh
/opt/sohuhadoop/hbase/bin/stop-hbase.shHbase默认只有一个Master,我们可以也启动多个Master:
/opt/sohuhadoop/hbase/bin/hbase-daemon.sh start master
不过,其它的Master并不会工作,只有当主Master down掉后
其它的Master才会选择接管Master的工作
Hbase也有一个简单的web界面,来查看其状态
http://10.10.71.1:60010/master.jsp
http://10.10.71.1:60030/regionserver.jsphttp://10.10.71.1:60010/zk.jsp
相关推荐
这是我从网上整理的一个文档,用于hbase shell初学者的参考文档。
总结常用的hbase shell操作命令。
HBase Shell的一些基本操作命令,列出了几个常用的HBase Shell命令
Hadoop技术-HBaseShell常用命令.pptx
该文档包含了HBase里面一系列常用的shell命令,包括增删改查等操作,还有读数据模型的概括,为了方便童鞋们查找,整理成一个文档供大家查阅。
NULL 博文链接:https://whxhz.iteye.com/blog/1607834
hbase_shell操作命令汇总, 内含HBase常用shell命令。
HDFS_HBaseShell的常用命令.docx
Hbase shell及常用命令
hadoop HBaseshell常用shell命令,这是工作中整理的一份文档,使用价值很高
HBase Shell 提供了大多数的 HBase 命令,通过 HBase Shell,用户可以方便地创建、删除及修改表,还可以向表中添加数据,列出表中的相关信息等。本节介绍一些常用的命令和具体操作,并讲解如何使用命令行实现一个...
(2)熟练使用HBase操作常用的 Shell命令。(3)熟悉HBase操作常用的 Java API。 A.3.2 实验平台 (1)操作系统:Linux。 (2)Hadoop 版本:2.7.1或以上版本。(3)HBase版本:1.1.2或以上版本。(4) JDK 版本:1.7或以上...
HBase是一种构建在HDFS之上的分布式、面向列的存储系统。在需要实时读写、随机访问超大规模数据集时,可以使用HBase。该文档整理了一些HBase Shell 常用命令以及示例,希望能够帮助初学者快速熟悉hbase的基本使用。
知识速查手册,适用于初学者,学过大数据的人员。
HBase是Google Bigtable的开源实现,它利用Hadoop HDFS作为其文件存储系统,利用Hadoop MapReduce来处理HBase中的海量数据,利用Zookeeper作为协同服务。 1. 简介 HBase是一个分布式的、面向列的开源数据库,源于...
今天小编就为大家分享一篇HBASE 常用shell命令,增删改查方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
2. 熟练使用HBase操作常用的Shell命令; 3. 熟悉HBase操作常用的Java API。 二、实验平台 1. 操作系统:Linux(建议Ubuntu16.04或Ubuntu18.04); 2. Hadoop版本:3.1.3; 3. HBase版本:2.2.2; 4. JDK版本:1.8; ...
│ Day1507_Hbase shell中namespace的常用操作.mp4 │ Day1508_Hbase shell中表的DDL操作.mp4 │ Day1509_Hbase shell中表的DML操作(一).mp4 │ Day1510_Hbase shell中表的DML操作(二).mp4 │ Day1511_Hbase的...
hadoop2安装和常用shell命令,