本来一切就绪,镜像里已安装如下主要的pip包。
pyhive
configparser
pandas
hdfs
thrift
sqlparse
sasl
thrift-sasl
但,使用pyhive client去真正连接hive服务器时,还是会报如下错误:
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的解决方式,以下安装包即可解决:
yum install cyrus-sasl-plain cyrus-sasl-devel cyrus-sasl-gssapi
但我的镜像是UBUNTU,因为tensorflow官方镜像就是ubuntu 1804。所以,这条路不错。
又参考了网上一些ubuntu的方法,安装sasl2-bin等这些软件包,都没有解决问题。
最后,还是实打实的来到http://www.sxzhongrui.com/blfs/view/cvs/postlfs/cyrus-sasl.html,
源码安装好Cyrus SASL-2.1.27,这个问题才搞定。
非docker的安装命令:
./configure --prefix=/usr \
--sysconfdir=/etc \
--enable-auth-sasldb \
--with-dbpath=/var/lib/sasl/sasldb2 \
--with-saslauthd=/var/run/saslauthd &&
make -j1
make install &&
/html &&
&&
install -v -m644 doc/legacy/*.html /usr/share/doc/cyrus-sasl-2.1.27/html &&
install -v -dm700 /var/lib/sasl
附上将cyrus sasl编译进镜像的dockerfile.
FROM www.sxzhongrui.com/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!!!"
-->
![赞赏](/zb_users/theme/maoc_grace/images/zs.png)