pyhive client链接hive报错处理:Could not start SASL

原本一切就绪,镜像里已安装以下主要的pip包。html

pyhive configparser pandas hdfs thrift sqlparse sasl thrift-sasl

但,使用pyhive client去真正链接hive服务器时,仍是会报以下错误:linux

thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found'

这个问题,有点大条了,按网上centos的解决方式,如下安装包便可解决:sql

yum install cyrus-sasl-plain  cyrus-sasl-devel  cyrus-sasl-gssapi

但个人镜像是UBUNTU,由于tensorflow官方镜像就是ubuntu 1804。因此,这条路不错。docker

又参考了网上一些ubuntu的方法,安装sasl2-bin等这些软件包,都没有解决问题。ubuntu

最后,仍是实打实的来到http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/cyrus-sasl.htmlcentos

源码安装好Cyrus SASL-2.1.27,这个问题才搞定。api

非docker的安装命令:服务器

./configure --prefix=/usr \ --sysconfdir=/etc \ --enable-auth-sasldb \ --with-dbpath=/var/lib/sasl/sasldb2 \ --with-saslauthd=/var/run/saslauthd &&
make -j1 make install &&
install -v -dm755                          /usr/share/doc/cyrus-sasl-2.1.27/html &&
install -v -m644  saslauthd/LDAP_SASLAUTHD /usr/share/doc/cyrus-sasl-2.1.27      &&
install -v -m644  doc/legacy/*.html /usr/share/doc/cyrus-sasl-2.1.27/html && install -v -dm700 /var/lib/sasl

 

附上将cyrus sasl编译进镜像的dockerfile.post

FROM harbor.xxx.com.cn/3rd_part/tensorflow:xxx MAINTAINER xxx COPY cyrus-sasl-2.1.27 /tmp/cyrus-sasl-2.1.27

RUN export http_proxy=http://xxx:8080 \
    && export https_proxy=http://xxx:8080 \
    && export ftp_proxy=http://xxx:8080 \ 
    && cd /tmp/cyrus-sasl-2.1.27 \ && ls -lh /tmp/ \ && ls -lh /tmp/cyrus-sasl-2.1.27/ \ && ./configure --prefix=/usr --sysconfdir=/etc --enable-auth-sasldb --with-dbpath=/var/lib/sasl/sasldb2 --with-saslauthd=/var/run/saslauthd \ && make -j1 \ && make install \ && install -v -dm755 /usr/share/doc/cyrus-sasl-2.1.27/html \ && install -v -m644 saslauthd/LDAP_SASLAUTHD /usr/share/doc/cyrus-sasl-2.1.27 \ && install -v -m644 doc/legacy/*.html /usr/share/doc/cyrus-sasl-2.1.27/html \ && install -v -dm700 /var/lib/sasl \ && echo "finished!!!"
相关文章
相关标签/搜索