python连接hbase踩坑记录
python连接hbase踩坑记录
出现make: *** [all] Error 2
原因是Linux系统gcc版本过低,yum安装的gcc是4.8.5的。需要升级gcc,如下
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
scl enable devtoolset-9 bash
echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile
gcc -v
except IOError, io: ^ SyntaxError: invalid syntax
更换\site-packages\hbase\Hbase.py&&ttype.py
网上找到的更换地址:https://github.com/data-infra/infrastructure/tree/master/hbase
g++: error: /usr/lib64/libboost_unit_test_framework.a: No such file or directory
libboost_unit_test_framework.a是一个静态库.
需要安装一个静态boost lib:
yum install boost-devel-static
yum报错
是因为yum是python2,而我安装了python3,所以要在yum文件和它后面出现的报错文件里在第一行的python变成python2.7
重点:记得打开thrift端口
启动方法:
-
hbase thrift start -port:9090
-
在/usr/local/hbase/bin目录下hbase-daemon.sh start thrift
使用netstat -antp | grep 9090查看端口是否起来