HBase权威指南环境配置

简介:

系统采用ubuntu-14.04,64bit

1、安装git

sudo apt-get install git

出现下面错误:
Err http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main git-man all 1:1.9.1-1ubuntu0.1
404 Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main git-man all 1:1.9.1-1ubuntu0.1
404 Not Found [IP: 91.189.91.14 80]
Err http://security.ubuntu.com/ubuntu/ trusty-security/main git i386 1:1.9.1-1ubuntu0.1
404 Not Found [IP: 91.189.91.14 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git-man_1.9.1-1ubuntu0.1_all.deb 404 Not Found [IP: 91.189.91.14 80]

E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git_1.9.1-1ubuntu0.1_i386.deb 404 Not Found [IP: 91.189.91.14 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

参考:

Installing Latest version of git in ubuntu(http://stackoverflow.com/questions/19109542/installing-latest- version-of-git-in-ubuntu)中给出的PPA源。

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

wu@ubuntu:~/opt/tmp$ git --version
git version 2.7.3

2、安装maven

wu@ubuntu:~/opt$ tar -xzvf apache-maven-3.0.4-bin.tar.gz

设置环境变量

wu@ubuntu:~/opt$ sudo gedit /etc/profile

在文件末尾追加:

# set maven environment
export M2_HOME=/home/wu/opt/apache-maven-3.0.4
export PATH=M2HOME/bin:

PATH

是环境变量生效:
wu@ubuntu:~/opt$ source /etc/profile

验证证maven是否安装成功:

wu@ubuntu:~/opt$ mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800)
Maven home: /home/wu/opt/apache-maven-3.0.4
Java version: 1.6.0_24, vendor: Sun Microsystems Inc.
Java home: /home/wu/jdk1.6.0_24/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-32-generic", arch: "i386", family: "unix"

3、按照下面顺序开始编译项目:

wu@ubuntu:/tmp$ git clone git://github.com/larsgeorge/hbase-book.git

Cloning into 'hbase-book'...
remote: Counting objects: 3148, done.
remote: Total 3148 (delta 0), reused 0 (delta 0), pack-reused 3148
Receiving objects: 100% (3148/3148), 1.60 MiB | 66.00 KiB/s, done.
Resolving deltas: 100% (1412/1412), done.
Checking connectivity... done.

wu@ubuntu:/tmpcdhbase−book/wu@ubuntu:/tmp/hbase−book

mvn package -DskipTests=true

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] HBase Book
[INFO] HBase Book Common Code
[INFO] HBase Book Chapter 3
[INFO] HBase Book Chapter 4
[INFO] HBase Book Chapter 5
[INFO] HBase Book Chapter 6
[INFO] HBase Book Chapter 7
[INFO] HBase Book Chapter 8
[INFO] HBase Book Chapter 9
[INFO] HBase Book Chapter 11
[INFO] HBase URL Shortener
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building HBase Book 2.0
[INFO] ------------------------------------------------------------------------
……

[INFO] Reactor Summary:
[INFO]
[INFO] HBase Book ........................................ SUCCESS [0.002s]
[INFO] HBase Book Common Code ............................ SUCCESS [4.846s]
[INFO] HBase Book Chapter 3 .............................. SUCCESS [1.592s]
[INFO] HBase Book Chapter 4 .............................. SUCCESS [2.331s]
[INFO] HBase Book Chapter 5 .............................. SUCCESS [1.119s]
[INFO] HBase Book Chapter 6 .............................. SUCCESS [8.721s]
[INFO] HBase Book Chapter 7 .............................. SUCCESS [1.620s]
[INFO] HBase Book Chapter 8 .............................. SUCCESS [1.172s]
[INFO] HBase Book Chapter 9 .............................. SUCCESS [0.528s]
[INFO] HBase Book Chapter 11 ............................. SUCCESS [0.575s]
[INFO] HBase URL Shortener ............................... SUCCESS [19.475s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.526s
[INFO] Finished at: Wed Mar 16 20:15:39 PDT 2016
[INFO] Final Memory: 37M/168M
[INFO] ------------------------------------------------------------------------

如果你在虚拟机中运行,中途出错,可能是jdk的版本问题,可以将jdk1.6换为jdk1.7

或者是网络问题,多运行几次就OK

wu@ubuntu:~/opt/tmp/hbase-book$ ls -l ch04/target/
total 188
drwxrwxr-x 5 wu wu 4096 Mar 16 20:15 classes
drwxrwxr-x 3 wu wu 4096 Mar 16 20:15 generated-sources
-rw-rw-r-- 1 wu wu 168340 Mar 16 20:15 hbase-book-ch04-2.0.jar
drwxrwxr-x 2 wu wu 4096 Mar 16 20:15 maven-archiver
drwxrwxr-x 3 wu wu 4096 Mar 16 20:15 maven-status
drwxrwxr-x 2 wu wu 4096 Mar 16 20:15 surefire

相关实践学习
lindorm多模间数据无缝流转
展现了Lindorm多模融合能力——用kafka API写入,无缝流转在各引擎内进行数据存储和计算的实验。
云数据库HBase版使用教程
  相关的阿里云产品:云数据库 HBase 版 面向大数据领域的一站式NoSQL服务,100%兼容开源HBase并深度扩展,支持海量数据下的实时存储、高并发吞吐、轻SQL分析、全文检索、时序时空查询等能力,是风控、推荐、广告、物联网、车联网、Feeds流、数据大屏等场景首选数据库,是为淘宝、支付宝、菜鸟等众多阿里核心业务提供关键支撑的数据库。 了解产品详情: https://cn.aliyun.com/product/hbase   ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
存储 大数据 分布式数据库
《HBase权威指南》一导读
你阅读本书的理由可能有很多。可能是因为听说了Hadoop,并了解到它能够在合理的时间范围内处理PB级的数据,在研读Hadoop的过程中发现了一个处理随机读写的系统,它叫做HBase。或者将其称为目前流行的一种新的数据存储架构,传统数据库解决大数据问题时成本更高,更适合的技术范围是NoSQL。
2509 0
|
JavaScript 前端开发 分布式数据库
|
缓存 Hbase 分布式数据库
|
分布式数据库 Hbase 存储