linux上搭建hbase

linux上搭建hbase,第1张

1.下载和安装hbase数据库

[root@tong1 ~]# wget http://mirrors.hust.edu.cn/apache/hbase/stable/hbase-0.98.9-hadoop2-bin.tar.gz

[root@tong1 ~]# tar xvf hbase-0.98.9-hadoop2-bin.tar.gz

[root@tong1 ~]# mv hbase-0.98.9-hadoop2 /usr/local/

[root@tong1 local]# chown -R hadoop:hadoop hbase-0.98.9-hadoop2

[root@tong1 local]# ll hbase-0.98.9-hadoop2

total 352

drwxr-xr-x. 4 hadoop hadoop 4096 Dec 16 14:16 bin

-rw-r--r--. 1 hadoop hadoop 164928 Dec 16 14:20 CHANGES.txt

drwxr-xr-x. 2 hadoop hadoop 4096 Jan 8 12:48 conf

drwxr-xr-x. 4 hadoop hadoop 4096 Dec 16 14:16 dev-support

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:22 hbase-annotations

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-assembly

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:22 hbase-checkstyle

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-client

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:22 hbase-common

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-examples

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:25 hbase-hadoop1-compat

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-hadoop2-compat

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-hadoop-compat

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-it

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-prefix-tree

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-protocol

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-rest

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-server

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-shell

drwxr-xr-x. 2 hadoop hadoop 4096 Dec 16 14:23 hbase-testing-util

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 14:23 hbase-thrift

-rw-r--r--. 1 hadoop hadoop 11358 Dec 2 07:36 LICENSE.txt

drwxrwxr-x. 2 hadoop hadoop 4096 Jan 8 12:01 logs

-rw-r--r--. 1 hadoop hadoop897 Dec 16 14:16 NOTICE.txt

-rw-r--r--. 1 hadoop hadoop 81667 Dec 16 14:16 pom.xml

-rw-r--r--. 1 hadoop hadoop 1377 Dec 16 14:16 README.txt

drwxr-xr-x. 3 hadoop hadoop 4096 Dec 16 06:37 src

[root@tong1 local]#

2.修改hbase配置文件

[root@tong1 local]# cd /usr/local/hbase-0.98.9-hadoop2/conf/

[root@tong1 conf]# vim hbase-site.xml

<configuration>

<property>

<name>hbase.rootdir</name>

<value>hdfs://tong1:9000/hbase</value>-与hadoop中的core-site.xml文件中一至

</property>

<property>

<name>hbase.cluster.distributed</name>

<value>true</value>

</property>

</configuration>

[root@tong1 conf]# vim hbase-env.sh

export JAVA_HOME=/usr/local/jdk1.8.0_25

[root@tong1 conf]#

3.启动hbase服务

[root@tong1 conf]# su - hadoop

[hadoop@tong1 ~]$ start-hbase.sh

localhost: starting zookeeper, logging to /usr/local/hbase-0.98.9-hadoop2/bin/../logs/hbase-hadoop-zookeeper-tong1.out

starting master, logging to /usr/local/hbase-0.98.9-hadoop2/logs/hbase-hadoop-master-tong1.out

localhost: starting regionserver, logging to /usr/local/hbase-0.98.9-hadoop2/bin/../logs/hbase-hadoop-regionserver-tong1.out

[hadoop@tong1 ~]$ hbase shell

2015-01-08 15:01:36,052 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available

2015-01-08 15:01:36,082 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available

2015-01-08 15:01:36,109 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available

2015-01-08 15:01:36,135 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available

2015-01-08 15:01:36,147 INFO [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available

HBase Shellenter 'help<RETURN>' for list of supported commands.

Type "exit<RETURN>" to leave the HBase Shell

Version 0.98.9-hadoop2, r96878ece501b0643e879254645d7f3a40eaf101f, Mon Dec 15 23:00:20 PST 2014

hbase(main):008:0* create 'tong1' ,'test'

0 row(s) in 0.9120 seconds

=>Hbase::Table - tong1

hbase(main):009:0>scan 'tong1'

ROW COLUMN+CELL

0 row(s) in 0.0390 seconds

hbase(main):010:0>

4.在浏览器查看状态即可。

HBase是一个分布式的、面向列的开源数据库,该技术来源于 Fay Chang 所撰写的Google论文“Bigtable:一个结构化数据的分布式存储系统”。就像Bigtable利用了Google文件系统(File System)所提供的分布式数据存储一样,HBase在Hadoop之上提供了类似于Bigtable的能力。HBase是Apache的Hadoop项目的子项目。HBase不同于一般的关系数据库,它是一个适合于非结构化数据存储的数据库。另一个不同的是HBase基于列的而不是基于行的模式。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/7205302.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-02
下一篇 2023-04-02

发表评论

登录后才能评论

评论列表(0条)

保存