1.确保hbase、Python已经安装好。我的版本分别是:hbase-1.2.6,Python-2.7.x
2.安装thrift
- 下载thrift,网址:http://archive.apache.org/dist/thrift/
- 解压缩: tar -zxvf thrift-0.10.0.tar.gz
- 安装thrift依赖和其他软件包
使用sudo yum install 安装sudo yum install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev
-
开始安装thrift
a) 执行命令: ./configure 如果报 error: Bison version 2.5 or higher must be installed on the system! 需安装Bison 2.5版本以上,下载网址:http://ftp.gnu.org/gnu/bison/ ,选择2.5以上的版本下载即可。
安装Bison
① 解压缩:tar -zxvf bison-2.5.1.tar.gz
② cd bison-2.5.1
③ ./configure --prefix=/usr
④ make
⑤ make install
b) 使用make命令进行编译
make // 如果报 “make: *** 没有指明目标并且找不到 makefile。 停止。”错误,可能是以下几种原因
① 执行 ./configure失败, ./configure: line 2370: config.log: Permission denied,即config.log文件的访问权限不足,修改权限即可,sudo chmod 777 文件名,之后在执行 ./configure
② 系统未安装 gcc导致的。 执行命令:yum install gcc-c++ -y 即可。然后再执行一次 ./configure
c) 使用make install命令进行安装 sudo make install,如果报make: *** [install-recursive] Error 1错误,是因为没有使用sudo make install导致的。直接在root权限下执行。 -
检查thrift是否安装成功
thrif -version -
启动thrift
hbase-daemons.sh start thrift (集群版启动)
hbase-daemon.sh start thrift (单机版启动) -
关闭thrift
hbase-daemons.sh stop thrift (集群版启动)
hbase-daemon.sh stop thrift (单机版启动)