Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation method and basic function demonstration of habase stand-alone version

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "habase stand-alone installation method and basic function demonstration". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The Linux distribution used in this article is: CentOS Linux release 7.4.1708 (Core)

Prepare to create user useradd-m hadooppasswd hadoop download installation package

1.jdk goes to the official download page http://www.oracle.com/technetwork/java/javase/downloads/index.html and downloads jdk. The version I downloaded is jdk-8u151-linux-x64.tar.gz.

The 2.hbase installation package goes to the hadoop official website to download the hadoop binary package. The version I use is: hbase-1.2.6-bin.tar.gz.

Upload the packages of jdk and hbase to linux at the path: / home/hadoop.

Hbase installation and configuration installation

Log in as a hadoop user and extract the packages for jdk and hadoop, respectively.

Tar-zxvf jdk-8u151-linux-x64.tar.gztar-zxvf hbase-1.2.6-bin.tar.gz

Rename the directory of hadoop

Mv hbase-1.2.6/ hbase/hadoop runtime environment configuration

The paths to all the following files and folders are relative to the user directory / home/hadoop of the hadoop user

Set jdk path vi hbase/conf/hbase-env.sh

Set the path of jdk

# The java implementation to use. Java 1.7 + required.export JAVA_HOME=/home/hadoop/jdk1.8.0_151 create data directory mkdir-p data/hbasemkdir-p data/zookeeper setup data directory vi hbase/conf/hbase-site.xml hbase.rootdir file:///home/hadoop/data/hbase hbase.zookeeper.property.dataDir / home/hadoop/data/zookeeper hbase launch and connection startup hbase/bin/start-hbase.sh view hbase status

Enter http://IP:16010 in the browser to view the status of hdfs. If port 50070 is not open, open port 16010 with the following command entered by the root user.

Iptables-I INPUT-p tcp-- dport 16010-j ACCEPT connection hbasehbase/bin/hbase shell

The following interface appears, which indicates that the connection is successful. You can enter the command of hbase.

Hbase (main): 001hbase 0 > basic operation instructions

Use hbase to store the following basic student information data, and do related operations.

Idnamesexage2018001zhangsanmale232018002lisifemale222018003wangwumale24 create table studenthbase (main): 004student', 0 > create 'student', 'f1mm 0 row (s) in 1.3200 seconds= > Hbase::Table-student to see which tables are available hbase (main): 006 main 0 > listTABLE student 1 row (s) in 0.0490 seconds= > ["student"] add data

Enter the following statements to add the information of the three students to the hbase.

Put 'student',' 2018001 paraphrase Fuzhuangsanfugu 'student',' 2018001ZHANGSANZOUP 'student',' 2018001MANTHERAPHY 23,000put 'student',' 2018002MILLING put 'student',' 2018002 'wanwu'put' student', '2018003,' 2018003', 'F1Flux', 'student',' 2018003', '2018003',' 2018003', '2018003',' 2018003', '2018003',' 2018003, '2018003,' 2018003, '2018003,' 2018003, '24' shows all records of the table hbase (main): 022scan 0 > scan 'student'ROW COLUMN+CELL 2018001 column=f1:age, timestamp=1514122123963 Value=23 2018001 column=f1:name, timestamp=1514122123729, value=zhangsan 2018001 column=f1:sex, timestamp=1514122123843 Value=male 2018002 column=f1:age, timestamp=1514122124178, value=22 2018002 column=f1:name, timestamp=1514122124062 Value=lisi 2018002 column=f1:sex, timestamp=1514122124129, value=female 2018003 column=f1:age, timestamp=1514122127361 Value=24 2018003 column=f1:name, timestamp=1514122124292, value=wanwu 2018003 column=f1:sex, timestamp=1514122124394 Value=male 3 row (s) in 0.1050 seconds to view a record based on the row key id

Display student information with row key id 2018001

Get 'student','2018001'COLUMN CELL f1:age timestamp=1514122123963 Value=23 f1:name timestamp=1514122123729 Value=zhangsan f1:sex timestamp=1514122123843, value=male 3 row (s) in 0.0200 seconds modifies a record

Change the age of a student with an id of 2018003 to 25

Put 'student',' 2018003 delete a record from a record 250row (s) in 0.0190 seconds

Delete student information with an id of 2018002

Deleteall's student','2018002'0 row (s) in 0.0500 seconds "habase stand-alone installation method and basic function demonstration" is introduced here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report