HBase伪分布式安装及简单使用
HBase是Hadoop的数据库,基于Hadoop运行,是一种NoSQL数据库。 特点:分布式、多版本、面向列的存储模型,能够大规模的数据实时随机读写,可直接使用本地文件系统。 不适合:与关系型数据库相比,模型简单,API很少;不适合小规模的数据。 数据存放的位置叫
HBase是Hadoop的数据库,基于Hadoop运行,是一种NoSQL数据库。
特点:分布式、多版本、面向列的存储模型,能够大规模的数据实时随机读写,可直接使用本地文件系统。
不适合:与关系型数据库相比,模型简单,API很少;不适合小规模的数据。
数据存放的位置叫做单元(cell),其中的数据可以有多个版本,根据时间戳(timestamp)来区别。
安装:
tar xfz hbase-0.94.18.tar.gz
cd hbase*
cd conf
vi hbase-env.sh
export JAVA_HOME = /usr/jdk1.6.0_45
vi hbase-site.xml
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://localhost:9000/hbase</value> <description>数据存放的位置。</description> </property> <property> <name>dfs.replication</name> <value>1</value> <description>指定副本个数为1,因为伪分布式。</description> </property> </configuration>
cd ../hadoop
bin/start-all.sh
jps 检查是否启动成功。
然后启动hbase,
cd ../hbase*
bin/start-hbase.sh
jps检查hbase是否启动成功,
成功会有HMaster
也可通过浏览器,http://localhost:60010查看
bin/hbase shell 可进入hbase命令行工具。
HBase Shell 支持多种命令
–一般的有
? status, version
–数据定义语言(DDL)
? alter, create, describe, disable, drop, enable, exists, is_disabled,
is_enabled, list
–数据控制语言 (DML)
? count, delete, deleteall, get, get_counter, incr, put, scan, truncate
–集群管理
? balancer, close_region, compact, flush, major_compact, move, split,
unassign, zk_dump, add_peer,disable_peer, enable_peer,
remove_peer, start_replication, stop_replication
? 查看每个命令的使用方法
–hbase> help "
>list #列出hbase存在的表
>status #返回集群的状态信息
创建一张表,hbase有多种建表的方式:
--hbase> create 't1', {NAME => 'f1', VERSIONS => 5}
–hbase> create 't1', {NAME => 'f1', VERSIONS => 1,
TTL => 2592000, BLOCKCACHE => true}
–hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'},
{NAME => 'f3'}
–hbase> create 't1', 'f1', 'f2', 'f3'
如,create 'blog', {NAME=>'info'}, {NAME=>'content'}
list查看hbase中的表
建好表之后,添加数据到表中
格式如下:
put 'table', 'row_id', 'family:column', 'value'
put 'Blog', 'Matt-001', 'info:title', 'Elephant'
put 'Blog', 'Matt-001', 'info:author', 'Matt'
put 'Blog', 'Matt-001', 'info:date', '2014.04.26'
count 'table_name' 查看列数
get 'table', 'row_id' 获取表中的某一列数据
scan 'table_name' 返回整张表的全部数据
scan 'table', {COLUMNS=>['col1', 'col2']} 也可以加条件
编辑数据:
用的还是put 命令,即put在列不存在的时候执行添加,存在的话就执行修改。
修改的时候会保留之前的版本,默认会保留3份。
delete 'table', 'rowId', 'column' 删除数据,不加条件会删除所有版本。
删除表,首先要将表的状态改成离线,disable 'table_name'
才能删除,drop 'table_name'

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











CrystalDiskMark is a small HDD benchmark tool for hard drives that quickly measures sequential and random read/write speeds. Next, let the editor introduce CrystalDiskMark to you and how to use crystaldiskmark~ 1. Introduction to CrystalDiskMark CrystalDiskMark is a widely used disk performance testing tool used to evaluate the read and write speed and performance of mechanical hard drives and solid-state drives (SSD). Random I/O performance. It is a free Windows application and provides a user-friendly interface and various test modes to evaluate different aspects of hard drive performance and is widely used in hardware reviews

foobar2000 is a software that can listen to music resources at any time. It brings you all kinds of music with lossless sound quality. The enhanced version of the music player allows you to get a more comprehensive and comfortable music experience. Its design concept is to play the advanced audio on the computer The device is transplanted to mobile phones to provide a more convenient and efficient music playback experience. The interface design is simple, clear and easy to use. It adopts a minimalist design style without too many decorations and cumbersome operations to get started quickly. It also supports a variety of skins and Theme, personalize settings according to your own preferences, and create an exclusive music player that supports the playback of multiple audio formats. It also supports the audio gain function to adjust the volume according to your own hearing conditions to avoid hearing damage caused by excessive volume. Next, let me help you

If you have successfully downloaded the installation file of Baidu Netdisk, but cannot install it normally, it may be that there is an error in the integrity of the software file or there is a problem with the residual files and registry entries. Let this site take care of it for users. Let’s introduce the analysis of the problem that Baidu Netdisk is successfully downloaded but cannot be installed. Analysis of the problem that Baidu Netdisk downloaded successfully but could not be installed 1. Check the integrity of the installation file: Make sure that the downloaded installation file is complete and not damaged. You can download it again, or try to download the installation file from another trusted source. 2. Turn off anti-virus software and firewall: Some anti-virus software or firewall programs may prevent the installation program from running properly. Try disabling or exiting the anti-virus software and firewall, then re-run the installation

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

NetEase Mailbox, as an email address widely used by Chinese netizens, has always won the trust of users with its stable and efficient services. NetEase Mailbox Master is an email software specially created for mobile phone users. It greatly simplifies the process of sending and receiving emails and makes our email processing more convenient. So how to use NetEase Mailbox Master, and what specific functions it has. Below, the editor of this site will give you a detailed introduction, hoping to help you! First, you can search and download the NetEase Mailbox Master app in the mobile app store. Search for "NetEase Mailbox Master" in App Store or Baidu Mobile Assistant, and then follow the prompts to install it. After the download and installation is completed, we open the NetEase email account and log in. The login interface is as shown below

Cloud storage has become an indispensable part of our daily life and work nowadays. As one of the leading cloud storage services in China, Baidu Netdisk has won the favor of a large number of users with its powerful storage functions, efficient transmission speed and convenient operation experience. And whether you want to back up important files, share information, watch videos online, or listen to music, Baidu Cloud Disk can meet your needs. However, many users may not understand the specific use method of Baidu Netdisk app, so this tutorial will introduce in detail how to use Baidu Netdisk app. Users who are still confused can follow this article to learn more. ! How to use Baidu Cloud Network Disk: 1. Installation First, when downloading and installing Baidu Cloud software, please select the custom installation option.

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple

Installing Android applications on Linux has always been a concern for many users. Especially for Linux users who like to use Android applications, it is very important to master how to install Android applications on Linux systems. Although running Android applications directly on Linux is not as simple as on the Android platform, by using emulators or third-party tools, we can still happily enjoy Android applications on Linux. The following will introduce how to install Android applications on Linux systems.
