一、源码编译
一、先搭建hbase集群和R环境安装
- hbase集群搭建步骤详见:
https://mp.youkuaiyun.com/postedit/81698599
- R环境安装
https://blog.youkuaiyun.com/qq_21153619/article/details/81386166
二、rhbase安装
- 安装环境依赖
-
yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel lib-devel python-devel ruby-devel
- 安装一些Thrift相关的工具或库。有的时候,还需要安装openssl-devel(在Ubuntu下为libssl-dev),不然会提示libcrypto.so找不到
-
yum install openssl-devel
1、下载thrift
- mkdir /usr/local/thrift
- cd /usr/local/thrift
- wget http://archive.apache.org/dist/thrift/0.8.0/thrift-0.8.0.tar.gz
- tar -zxvf thrift-0.8.0.tar.gz
- cd thrift-0.8.0/
2、下载PHP支持类库和C++支持类库
- yum install php-cli
- yum install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev
3、生成编译的配置参数
-
./configure
在/configure编译的时候,可能会报错误:
configure: error: "Error: libcrypto required......”
是因为环境依赖openssl-devel未安装或者安装错误,需要重新安装一下。安装 openssl openssl-devel (centOS)
- yum -y install openssl openssl-devel
重新编译
- ./configure
4、编译和安装
- make
- make install
5、查看thrift版本
- thrift -version
-
6、启动HBase的Thrift Server
所有节点相同操作
- cd /usr/hdp/2.6.2.0-205/hbase/bin/
- ./hbase-daemon.sh start thrift
- jps
7、安装rhbase
- 下载RHbase
- R CMD INSTALL rhbase_1.1.1.tar.gz
很顺利的安装完成。
二、yum安装
1、安装thrift
yum install epel-release //扩展包更新包
yum update //更新yum源
yum -y install thrift thrift-devel
2、安装rhbase
- 需提前下载rhbase
下载rhbase包:https://github.com/RevolutionAnalytics/RHadoop/wiki/Downloads
- 进入rhbase下载的目录下
R CMD INSTALL "rhbase_1.2.1.tar.gz"
- 检测下thrift是否安装正确:
pkg-config --cflags thrift
- 若发现为空,此时则需修改/usr/lib64/pkgconfig/目录下的thrift.pc文件
- 将 includedir=/usr/include 修改成 includedir=/usr/include/thrift
- 再次检测 pkg-config --cflags thrift,如上所示为正常;再次安装rhbase
R CMD INSTALL "rhbase_1.2.1.tar.gz"
3、启动 thrift
cd /usr/hdp/2.6.2.0-205/hbase/bin/
./hbase-daemon.sh start thrift
4、检查是否启动成功
ps -aux | grep thrift