日期:2014-05-16  浏览次数:20602 次

安装HBase Snappy

服务器操作系统:CentOS 6.3

[talkyun@tbe192168147058 snappy-1.1.0]# uname -a

Linux tbe192168147058 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

[talkyun@tbe192168147058 snappy-1.1.0]# lsb_release -a

Description: ? ?CentOS release 6.3 (Final)

[talkyun@tbe192168147058 snappy-1.1.0]# gcc --version

bash: gcc: command not found

???

一、安装Snappy

1.检查是否已经安装

? ? ??ls /usr/local/lib/libsn*

2.安装Snappy

? ? ? 2.1.从https://code.google.com/p/snappy/下载

? ? ? ? ? ??https://code.google.com/p/snappy/downloads/list

? ? ? ? ? ??curl https://snappy.googlecode.com/files/snappy-1.1.0.tar.gz -o snappy-1.1.0.tar.gz

? ? ? 2.2.安装

? ? ? ? ? ??[talkyun@tbe192168147058?snappy]$?

? ? ? ? ? ??snappy-1.1.0.tar.gz

? ? ? ? ? ? tar xvfz?snappy-1.1.0.tar.gz

? ? ? ? ? ? cd?snappy-1.1.0

? ? ? ? ? ??[talkyun@tbe192168147058 snappy-1.1.0]$ sudo yum install gcc

? ? ? ? ? ? 错误一:

[talkyun@tbe192168147014 snappy-1.1.0]$ sudo yum install gcc
Loaded plugins: fastestmirror, security
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base
[talkyun@tbe192168147014 snappy-1.1.0]$ nslookup mirrorlist.centos.org
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached

[talkyun@tbe192168147014 snappy-1.1.0]$ cat /etc/resolv.conf

? ? ? ? ? ? 解决方案:

[talkyun@tbe192168147014 snappy-1.1.0]$ sudo vim /etc/resolv.conf
[talkyun@tbe192168147014 snappy-1.1.0]$ cat /etc/resolv.conf 
# Generated by NetworkManager
nameserver 192.168.200.19

?

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ sudo yum install autoconf

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ sudo yum install automake

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ sudo yum install libtool

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ ./configure

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ make

? ? ? ? ? ??错误二:./libtool: line 1125: g++: command not found

? ? ? ? ? ? 解决方案:sudo yum -y install gcc-c++

? ? ? ? ? ? 如果出现错误,解决之后,要删除原来的目录,重新创建和使用新的。

? ? ? ? ? ??[talkyun@tbe192168147058 snappy-1.1.0]$ cd ..

? ? ? ? ? ? [talkyun@tbe192168147058 snappy]$ rm -rf snappy-1.1.0

? ? ? ? ? ? [talkyun@tbe192168147058 snappy]$ tar xvfz snappy-1.1.0.tar.gz

? ? ? ? ? ? [talkyun@tbe192168147058 snappy]$ cd snappy-1.1.0

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ ./configure

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ make

? ? ? ? ? ? [talkyun@tbe192168147058 snappy-1.1.0]$ sudo make install

3.检查安装是否成功

? ? ??ls /usr/local/lib/libsn*

?

二、安装Hadoop Snappy

1.下载hadoop-snappy源码

? ? ??svn checkout http://hadoop-snappy.googlecode.com/svn/trunk/ hadoop-snappy

2.安装hadoop-snappy

? ? ??cd hadoop-snappy

? ? ? mvn package

? ? ??[bigdata@tbe192168147015 hadoop-snappy]$ /home/bigdata/maven/apache-maven-3.0.4/bin/mvn package

? ? ? 错误一: