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] #

相关文章
|
Shell Linux
Linux shell编程学习笔记30:打造彩色的选项菜单
Linux shell编程学习笔记30:打造彩色的选项菜单
|
缓存 监控 Shell
如何使用 HBase Shell 进行数据的实时监控和备份?
如何使用 HBase Shell 进行数据的实时监控和备份?
270 5
|
Shell 分布式数据库 Hbase
如何使用 HBase Shell 进行数据的批量导入和导出?
如何使用 HBase Shell 进行数据的批量导入和导出?
886 5
|
分布式计算 Hadoop Shell
Hadoop-35 HBase 集群配置和启动 3节点云服务器 集群效果测试 Shell测试
Hadoop-35 HBase 集群配置和启动 3节点云服务器 集群效果测试 Shell测试
317 4
|
分布式计算 Hadoop Shell
Hadoop-36 HBase 3节点云服务器集群 HBase Shell 增删改查 全程多图详细 列族 row key value filter
Hadoop-36 HBase 3节点云服务器集群 HBase Shell 增删改查 全程多图详细 列族 row key value filter
205 3
|
Shell Linux
Linux shell编程学习笔记82:w命令——一览无余
Linux shell编程学习笔记82:w命令——一览无余
|
存储 Java Shell
shell学习笔记(详细整理)
这篇文章是一份详细的Shell学习笔记,涵盖了Shell的基础知识、脚本编写、变量、运算符、条件判断、流程控制、函数以及常用Shell工具的使用。
453 2
|
Shell 分布式数据库 Ruby
HBase常用shell操作(未完成)
HBase常用shell操作(未完成)
231 1
|
存储 Shell 分布式数据库
Hbase 的基本shell 命令
Hbase 的基本shell 命令
248 0
|
6月前
|
分布式计算 Ubuntu Hadoop
Ubuntu22.04下搭建Hadoop3.3.6+Hbase2.5.6+Phoenix5.1.3开发环境的指南
呈上,这些步骤如诗如画,但有效且动人。仿佛一个画家在画布上描绘出一幅完美的画面,这就是你的开发环境。接下来,尽情去创造吧,祝编程愉快!
448 19