HBase Shell 访问|学习笔记

简介: 快速学习 HBase Shell 访问

开发者学堂课程【云数据库 HBase 版使用教程HBase Shell 访问笔记与课程紧密联系,让用户快速学习知识。

课程地https://developer.aliyun.com/learning/course/436/detail/5414


HBase Shell 访问


内容介绍:

一、前言

二、操作指南


一、前言

今天这节课的内容主要是讲解如何通过 HBase Shell 来访问 HBase 集群。


二、操作指南

1、首先可以看到在 HBase Shell 控台界面上已经有了一个“按量付费”的HBase Shell 集群。 接下来将会仔细讲解一下这个集群的一些信息。点击“管理”

2、比较关键的信息

网络地址白名单;

1.第一步:

如果需要访问网络地址,那么就需要准备与它相同区域的一台 ECS。

2.第二步:

打开ECS, 同时需要下载好一台 HBase quiet。

HBase quiet 的下载可以去 HBase quiet  官方文档查看下载地址。下载之后将它截取出来;

[root@emr -header-1 admin]# 11 ,

total 105524

-rw-r--r--1 root root 108052628 Jun 1 14:17 hbase-1.1.10-bin.tar.gz

[rootlemr-header-1 admin] tar-zxf hbase-1.1.10-bin. tar gz

3.第三步:截取之后会看到一个目录;

1 [rooteemr -header-1 admin]# 11

total 105528

drwxr-xr-x 7 root root 4096 Jun 1 14:27 hbase-1.1.1 0

-rw-r--r--1 root root 108052628 Jun 1 14:17 hbase-1.1.10-bin.tar .gz

[rootlemr -header-1 admin]# cd hbase 1.1.10

[ rootlem header-1 hbase-1.1.10]# 11

total 412

drwxr-xr-x  4 root root 4096 Apr 19 11:44 bin

-rw-r--r--   1 root root 198737 Apr 19 11:44 CHANGES . txt

drwxr -xr-x  2 root root 4096 Apr 19 11:44 conf

drwxr-xr-x  12 root root 4096 Apr 19 12:09 docs

drwxr-xr-x   7 root root 4096 Apr 19 11:58 hbase-vebapps

-rw-r--r--   1 root root 261 Apr 19 12:11 LEGAL

drwxr-xr-x 3 root root 4096 Jun 1 14:27 bin

-rw-r--r--   1 root root 139698 Apr 19 12:11 LICENSE . txt

-rw-r--r--   1 root root 48422 Apr 19 12:11 NOTICE. txt

rw-r--r--   1 root root 1477 Apr 19 11:44 README . txt

[rootlemr -header-1 hbase-1.1.10]# cd conf/

4.第四步:

进入 conf 文件,辨析 conf.site

[rooteemr -header-1 conf]# 11

total 40

-rw-r--r-- 1 root root 1811 Apr 19 11:44 hadoop-metrics2-hbase . properties .

-rw-r--r-- 1 root root 4537 Apr 19 11:44 hbase env . cmd

-rw-r--r-- 1 root root 7468 Apr 19 11:44 hbase - env . sh

-rw-r--r-- 1 root root 2257 Apr 19 11:44 hbase -policy. xml

-rw-r--r-- 1 root root 934 Apr 19 11:44 hbase -3ite . xml

-rw-r--r-- 1 root root 4603 Apr 19 11:44 log4j . properties

- rw r--r-- 1 root r0ot , 10 Apr 19 11:44 regionservers

[rooteemr -header-1 conf]# vi HBase-site.xml

5.第五步:

进行一段复制,拷贝 shop tips, 其中有一部分操作需要在控台页面上进行

?xml veraion="1.0" 2?>

く?xml - stylesheet type-"text/xsl" hre."coniguration. xsl" ?>

Licensed to the Apache Software Foundation (ASE) unde r one or more contr ibutor license agreements . See the NOTICE file distributed with this work for addit ional information

regarding copy ight owne rship. The ASF licenses this file to you under the Apache License, Version 2.0 (the"License"); you may not use this file except in compliance.with the License. You may obtain a copy of the License athttp://www. apache . org/ licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software

under the License is distributed on an 'AS IS" BASIS ,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and

limitations under the License .

HBase . zookeeper.quorum

hb-uf6bqhw9dbr79exgs-001.hbase.rds. aliyuncs.com:2181 hb-uf6bqhw9dbr79exgs-002.hbase.rds. aliyuncs.com:2181 hb-uf6bqhw9dbr79exgs-004.hbase.rds. aliyuncs.com:2181

// 将拷贝的内容插入到此处

文件

6.第六步:

保存、退出; 在这一步骤还需要将这台计算机的内网地址加入到网络白名单里面。点击如下图光标所在位置;

[rooteemr -header-1 conf] # vi HBase-site.xml

[rooteemr -header-1 conf] # cd ..

[rootlemr -header-1 hbase-1.1.10] # hostname - i

10 . 47 . 106 .40

[rootlemr -header-1 hbase-1.1.10]# cd conf/

将原来的127.0.0.1改为刚才ECS的地址10 . 47 . 106 .40

因为127.0.0.1这个地址表示 禁止所有地址访问。

7.第七步:

点击“确定”之后,就可以访问新的网络地址了。这个时候就可以运行 HBase Shell 了。直接运行就可以得出HBase Shell已经运行成功了,现在可以对 HBase Shell 进行相关操作。

目前HBase Shell的这个数据库是空的, 此时就可以对 HBase Shell 进行一些简单的相关操作,比如说create ‘test’ 同时建立’cf’

hbase (main) : 003” 0 > create ‘test’ ‘cf’

0 row(s) in 1.3630 seconds

HBase::Table – test

hbase (main) : 004 : 0 > list test

ArgumentError: wrong  number of arguments (0 for 2)

hbase(main) :005:0> list ‘test’

TABLE

test

1 row (s) in 0,0170 seconds

[“test”]

hbase(main) : 006: 0 >

此时还可以简单地进行一些操作,比如说:

[ ]

hbase (main) : 003” 0 > create ‘test’ ‘cf’

0 row(s) in 1.3630 seconds

HBase::Table – test

hbase (main) : 004 : 0 > list test

ArgumentError: wrong  number of arguments (0 for 2)

hbase(main) :005:0> list ‘test’

TABLE

test

1 row (s) in 0.0170 seconds

[“test”]

hbase(main) : 006: 0 > put ‘test’, ‘row1’ ,‘ef’:a’, ‘value1’

0 row (s) in 0.1900 seconds

// 将数据导入进去,

hbase(main) :007:0> scat ‘test’

//此时使用scat查看

NoMethodError : undefined method ‘scat’ for #

hbase(main) :009:0> scat ‘test’

//查看模型

查看模型后可以得到:

ROW 是 row1,column 是 cf,timestamp 是一个值,value 是 value1

最后输入quit,就可以退出:

hbase(main) :010:0> quit ‘test’

[rootlemr -header-1 hbase-1.1.10] #

相关实践学习
云数据库HBase版使用教程
  相关的阿里云产品:云数据库 HBase 版 面向大数据领域的一站式NoSQL服务,100%兼容开源HBase并深度扩展,支持海量数据下的实时存储、高并发吞吐、轻SQL分析、全文检索、时序时空查询等能力,是风控、推荐、广告、物联网、车联网、Feeds流、数据大屏等场景首选数据库,是为淘宝、支付宝、菜鸟等众多阿里核心业务提供关键支撑的数据库。 了解产品详情: https://cn.aliyun.com/product/hbase   ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
3月前
|
Shell Linux C++
Linux C/C++ 开发(学习笔记二):Shell脚本编程案例
Linux C/C++ 开发(学习笔记二):Shell脚本编程案例
39 0
|
4月前
|
Java Shell 分布式数据库
【大数据技术Hadoop+Spark】HBase数据模型、Shell操作、Java API示例程序讲解(附源码 超详细)
【大数据技术Hadoop+Spark】HBase数据模型、Shell操作、Java API示例程序讲解(附源码 超详细)
84 0
|
7月前
|
Shell 分布式数据库 Apache
Hbase常用shell操作
Hbase常用shell操作
322 1
|
4月前
|
分布式计算 Hadoop Shell
|
3月前
|
分布式计算 分布式数据库 API
Spark与HBase的集成与数据访问
Spark与HBase的集成与数据访问
|
3月前
|
Java Shell Linux
Shell编程 学习笔记
Shell编程 学习笔记
69 1
|
4月前
|
SQL 分布式计算 Hadoop
Hadoop学习笔记(HDP)-Part.16 安装HBase
01 关于HDP 02 核心组件原理 03 资源规划 04 基础环境配置 05 Yum源配置 06 安装OracleJDK 07 安装MySQL 08 部署Ambari集群 09 安装OpenLDAP 10 创建集群 11 安装Kerberos 12 安装HDFS 13 安装Ranger 14 安装YARN+MR 15 安装HIVE 16 安装HBase 17 安装Spark2 18 安装Flink 19 安装Kafka 20 安装Flume
82 1
Hadoop学习笔记(HDP)-Part.16 安装HBase
|
4月前
|
Shell Linux Perl
shell 学习笔记
shell 学习笔记
50 1
|
7月前
|
Shell 分布式数据库 Hbase
Hbase shell管理操作
Hbase shell管理操作
53 0
|
8月前
|
Shell 分布式数据库 数据库
Hbase Shell操作
Hbase Shell操作
135 0