国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁(yè) > news >正文

攀枝花建設(shè)工程有限責(zé)任公司網(wǎng)站一元友情鏈接平臺(tái)

攀枝花建設(shè)工程有限責(zé)任公司網(wǎng)站,一元友情鏈接平臺(tái),網(wǎng)站建設(shè) 案例,做視頻采集網(wǎng)站違法嗎文章目錄 Hbase概念1.安裝Hbase1.jdk的配置2.安裝hbase 2.啟動(dòng)和操作1.啟動(dòng)服務(wù)2 **web-ui訪問(wèn)地址:http://node01:16010/master-status** 3.簡(jiǎn)單的操作1.連接 HBase2.幫助命令3.創(chuàng)建一張表 create a table4.使用查看表是否存在5.describe 查看表描述6.put命令插入數(shù)據(jù)到表7. s…

文章目錄

  • Hbase概念
  • 1.安裝Hbase
    • 1.jdk的配置
    • 2.安裝hbase
  • 2.啟動(dòng)和操作
    • 1.啟動(dòng)服務(wù)
    • 2 **web-ui訪問(wèn)地址:`http://node01:16010/master-status`**
  • 3.簡(jiǎn)單的操作
    • 1.連接 HBase
    • 2.幫助命令
    • 3.創(chuàng)建一張表 create a table
    • 4.使用查看表是否存在
    • 5.describe 查看表描述
    • 6.put命令插入數(shù)據(jù)到表
    • 7. scan 查看所有的數(shù)據(jù)
    • 8.get獲取單行數(shù)據(jù)
    • 9.刪除表需要先禁用(disable)表再刪除(drop)
    • 10.退出hbase shell
    • 11.停止hbase

Hbase概念

HBase是一個(gè)分布式、面向列的開(kāi)源數(shù)據(jù)庫(kù),其基于Hadoop的分布式文件系統(tǒng)(HDFS)進(jìn)行存儲(chǔ)。它既具有分布式、可擴(kuò)展、高可靠性等優(yōu)點(diǎn),也具備NoSQL、schema-free、實(shí)時(shí)訪問(wèn)等特性。HBase遵循Google BigTable的計(jì)算模型,可以用于存儲(chǔ)非常大的數(shù)據(jù)集,適用于不斷積累的數(shù)據(jù),提供高效地實(shí)時(shí)讀寫(xiě)訪問(wèn)。HBase作為Hadoop生態(tài)系統(tǒng)中的一個(gè)重要組成部分,可與Hadoop及其它組件如Hive、Pig、Storm等相互配合,構(gòu)建具有高性能、可靠性和擴(kuò)展性的大數(shù)據(jù)處理平臺(tái)。

1.安裝Hbase

1.jdk的配置

在這里不在贅述。

2.安裝hbase

解壓安裝包

$ tar xzvf hbase-2.5.1-bin.tar.gz
$ cd hbase-2.4.0/

配置HBASE_HOME環(huán)境變量

vi /etc/profile
export HBASE_HOME=/opt/bigdata/hbase-2.5.1
export PATH=$PATH:$HBASE_HOME/bin
source /etc/profile

修改hbase-env.sh
最好使用jdk1.8,配置jdk8的路徑

export JAVA_HOME=/usr/jdk64/jdk1.8.0_112

修改hbase-site.xml
默認(rèn)不用修改。

2.啟動(dòng)和操作

1.啟動(dòng)服務(wù)

bin/start-hbase.sh

啟動(dòng)成功:

[root@node01 conf]# start-hbase.sh
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/bigdata/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/bigdata/hbase-2.5.1/lib/client-facing-thirdparty/log4j-slf4j-impl-2.17.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
running master, logging to /opt/bigdata/hbase-2.5.1/logs/hbase-root-master-node01.out
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/bigdata/hadoop-2.6.5/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/bigdata/hbase-2.5.1/lib/client-facing-thirdparty/log4j-slf4j-impl-2.17.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
2023-04-16 07:03:20,996 INFO  [main] master.HMaster (HMaster.java:main(3289)) - STARTING service HMaster
2023-04-16 07:03:21,001 INFO  [main] util.VersionInfo (VersionInfo.java:logVersion(112)) - HBase 2.5.1
2023-04-16 07:03:21,001 INFO  [main] util.VersionInfo (VersionInfo.java:logVersion(112)) - Source code repository git://buildbox.localdomain/home/apurtell/tmp/RM/hbase revision=894ac15342ae9ac1e0d7c827c00fda4b83627758
2023-04-16 07:03:21,001 INFO  [main] util.VersionInfo (VersionInfo.java:logVersion(112)) - Compiled by apurtell on Mon Oct 17 15:41:08 PDT 2022
2023-04-16 07:03:21,001 INFO  [main] util.VersionInfo (VersionInfo.java:logVersion(112)) - From source with checksum 57c1d2c9c03f18d35860e6733447968d1711dae96b0b7d35b2d1e029a5d91423cf65a6063cfbe3b736907b7b20fb94d82a443b65982f4c973a72fb71cd7f2e47

2 web-ui訪問(wèn)地址:http://node01:16010/master-status

在這里插入圖片描述

3.簡(jiǎn)單的操作

1.連接 HBase

hbase shell

啟動(dòng)報(bào)錯(cuò)

  • 錯(cuò)誤1
    版本不兼容 需要換版本
 hbase shell
LoadError: load error: irb/completion -- java.lang.IncompatibleClassChangeError: Implementing classrequire at org/jruby/RubyKernel.java:974require at uri:classloader:/METAINF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54<main> at classpath:/jar-bootstrap.rb:42
  • 錯(cuò)誤2
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected

解決方法

#hadoop目錄下存在老版本jline:
cd $HADOOP_HOME/share/hadoop/yarn/lib
rm -f jline-0.9.94.jar

2.幫助命令

hbase(main):030:0> help 

常用命令


#命令組 COMMAND GROUPS:
Group name: general
Commands: processlist, status, table_help, version, whoami
# ddl表定義語(yǔ)言  Group name: ddlCommands: alter, alter_async, alter_status, create, describe, disable, disable_all, drop, drop_all, enable, enable_all, exists, get_table, is_disabled, is_enabled, list, list_regions, locate_region, show_filters
#數(shù)據(jù)庫(kù) Group name: namespaceCommands: alter_namespace, create_namespace, describe_namespace, drop_namespace, list_namespace, list_namespace_tables#操作語(yǔ)言 Group name: dmlCommands: append, count, delete, deleteall, get, get_counter, get_splits, incr, put, #插入數(shù)據(jù)scan, #查詢truncate #刪除表數(shù)據(jù)

3.創(chuàng)建一張表 create a table

hbase(main):009:0* create 'user','cf'
Created table user
Took 0.7635 seconds                                                                                                                                                                                                    
=> Hbase::Table - user

4.使用查看表是否存在

hbase(main):010:0> list 'user'
TABLE                                                                                                                                                                                                                  
user                                                                                                                                                                                                                   
1 row(s)
Took 0.0328 seconds                                                                                                                                                                                                    
=> ["user"]

5.describe 查看表描述

hbase(main):012:0> describe 'user'
Table user is ENABLED                                                                                                                                                                                                  
user                                                                                                                                                                                                                   
COLUMN FAMILIES DESCRIPTION                                                                                                                                                                                            
{NAME => 'cf', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA_ON_WRITE => 'false', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_
VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CACHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_BLOOMS_ON_WRITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NONE', BL
OCKCACHE => 'true', BLOCKSIZE => '65536'}                                                                                                                                                                              
1 row(s)
Took 0.1756 seconds 

6.put命令插入數(shù)據(jù)到表

hbase(main):013:0> put 'user','1','cf:username','elite'
Took 0.1000 seconds                                                             
hbase(main):014:0> put 'user','1','cf:age','22'
Took 0.0052 seconds                                                             
hbase(main):015:0> put 'user','1','cf:address','xxpro'
Took 0.0047 seconds 

7. scan 查看所有的數(shù)據(jù)

One of the ways to get data from HBase is to scan. Use the scan command to scan the table for data. You can limit your scan, but for now, all data is fetched.

hbase(main):016:0> scan 'user'
ROW                   COLUMN+CELL                                               1                    column=cf:address, timestamp=1681776414492, value=xxpro   1                    column=cf:age, timestamp=1681776404658, value=22          1                    column=cf:username, timestamp=1681776395675, value=elite  

8.get獲取單行數(shù)據(jù)

hbase(main):024:0> scan 'user'
ROW                       COLUMN+CELL                                                             1                        column=cf:address, timestamp=1681776414492, value=xxpro                 1                        column=cf:age, timestamp=1681776404658, value=22                        1                        column=cf:username, timestamp=1681776540360, value=elite2               2                        column=cf:address, timestamp=1681776520152, value=xx2pro                2                        column=cf:age, timestamp=1681776533412, value=24                        2                        column=cf:username, timestamp=1681776546625, value=elite2               
2 row(s)
Took 0.0144 seconds                                                                               
hbase(main):025:0> get 'user','2'
COLUMN                    CELL                                                                    cf:address               timestamp=1681776520152, value=xx2pro                                   cf:age                   timestamp=1681776533412, value=24                                       cf:username              timestamp=1681776546625, value=elite2                                   
1 row(s)
Took 0.0069 seconds                                             

9.刪除表需要先禁用(disable)表再刪除(drop)

If you want to delete a table or change its settings, as well as in some other situations, you need to disable the table first, using the disable command. You can re-enable it using the enable command.

#創(chuàng)建表
hbase(main):031:0> create 'test','cf'
Created table test
Took 0.7353 seconds                                                                               
=> Hbase::Table - test
#看表描述是enabled狀態(tài)
hbase(main):032:0> desc 'test'
Table test is ENABLED                                                                             
test                                                                                              
COLUMN FAMILIES DESCRIPTION                                                                       
{NAME => 'cf', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW_VERSION_BEHAVIOR => 'false',KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA_ON_WRITE => 'false', DATA_BLOCK_ENCODING => 'NONE', TTL=> 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CACHE_INDEX_ON
_WRITE => 'false', IN_MEMORY => 'false', CACHE_BLOOMS_ON_WRITE => 'false', PREFETCH_BLOCKS_ON_OPEN=> 'false', COMPRESSION => 'NONE', BLOCKCACHE => 'true', BLOCKSIZE => '65536'}                   
1 row(s)
Took 0.0253 seconds 
# 直接刪除表提示  Table test is enabled. Disable it first.                                                                            
hbase(main):033:0> drop 'test'ERROR: Table test is enabled. Disable it first.Drop the named table. Table must first be disabled:hbase> drop 't1'hbase> drop 'ns1:t1'Took 0.0192 seconds     
#禁用表                                                                          
hbase(main):035:0> disable 'test'
Took 0.4833 seconds         
# 刪除表                                                                      
hbase(main):036:0> drop 'test'
Took 0.2657 seconds  

10.退出hbase shell

quit

11.停止hbase

$ ./bin/stop-hbase.sh
http://m.aloenet.com.cn/news/849.html

相關(guān)文章:

  • 池州專業(yè)網(wǎng)站建設(shè)谷歌搜索引擎鏡像
  • 網(wǎng)站設(shè)計(jì) 電子購(gòu)物網(wǎng)站設(shè)計(jì)網(wǎng)絡(luò)精準(zhǔn)推廣
  • 電商網(wǎng)站建設(shè)推廣企業(yè)網(wǎng)絡(luò)規(guī)劃設(shè)計(jì)方案
  • 網(wǎng)站建設(shè)的結(jié)論和體會(huì)百度推廣營(yíng)銷中心
  • 柳州正規(guī)網(wǎng)站制作公司發(fā)稿網(wǎng)
  • 牛街網(wǎng)站建設(shè)免費(fèi)網(wǎng)站推廣軟件哪個(gè)好
  • 電子書(shū)籍網(wǎng)站開(kāi)發(fā)推廣鏈接點(diǎn)擊器網(wǎng)頁(yè)
  • 如何開(kāi)一個(gè)微信公眾號(hào)seo顧問(wèn)合同
  • 昆明企業(yè)自助建站系統(tǒng)百度官網(wǎng)客服
  • 曹縣網(wǎng)站開(kāi)發(fā)抓取關(guān)鍵詞的軟件
  • 虛擬幣挖礦網(wǎng)站開(kāi)發(fā)新鄉(xiāng)seo網(wǎng)絡(luò)推廣費(fèi)用
  • 互聯(lián)網(wǎng)門(mén)戶網(wǎng)站世界比分榜
  • 網(wǎng)站建設(shè)目標(biāo)定位推廣排名seo
  • jsp網(wǎng)站seo優(yōu)化百度競(jìng)價(jià)推廣開(kāi)戶多少錢(qián)
  • 百度海外視頻網(wǎng)站建設(shè)幽默軟文經(jīng)典案例300
  • 釣魚(yú)網(wǎng)站開(kāi)發(fā)百度百度一下百度
  • 做安卓icon圖標(biāo)下載網(wǎng)站網(wǎng)站推廣優(yōu)化方法
  • 提升網(wǎng)站關(guān)鍵詞排名推廣策劃方案怎么做
  • 做中國(guó)旅游網(wǎng)站的目的與必要性廣豐網(wǎng)站seo
  • 網(wǎng)頁(yè)設(shè)計(jì)作品網(wǎng)站seo關(guān)鍵詞智能排名
  • ps網(wǎng)站設(shè)計(jì)素材手機(jī)百度搜索引擎入口
  • 物流公司哪家便宜又好河南純手工seo
  • h5 css3 網(wǎng)站開(kāi)發(fā)實(shí)例熱搜榜上2023年熱門(mén)話題
  • 花錢(qián)推廣的網(wǎng)絡(luò)平臺(tái)廣州seo和網(wǎng)絡(luò)推廣
  • 江蘇省昆山市網(wǎng)站制作西安網(wǎng)站seo廠家
  • 深圳招聘一般在哪個(gè)網(wǎng)站aso優(yōu)化的主要內(nèi)容
  • 西安大型網(wǎng)站建設(shè)公司排名怎么做好網(wǎng)絡(luò)營(yíng)銷
  • 垃圾站 WordPress深圳剛剛突然宣布
  • 一級(jí)a做爰片視頻網(wǎng)站競(jìng)價(jià)推廣托管多少錢(qián)
  • wordpress中文標(biāo)簽云網(wǎng)站關(guān)鍵詞排名seo