我对docker很陌生,我想做一件很简单的事。至于标题,我想从docker文件运行一个impala脚本。我的dockerfile如下所示:
FROM cloudera/quickstart:latest
COPY /home/dodo/script/ /home/cloudera/script
WORKDIR /home/cloudera/script
RUN service impala-state-store start \
&& service impala-catalog start \
&& service impala-server start \
&& impala-shell -f script.sql --quiet -i localhost
在构建映像时,关于impala shell连接,我一直存在以下错误:
连接时出错:ttTransportException,无法连接到localhost:21000
我试着在容器中用相同的命令运行相同的脚本,结果成功了。
你知道我该如何解决这个问题吗,哪个主机传递给 Impala 壳?
1条答案
按热度按时间uplii1fm1#
看来你需要补充一些东西
我创建了以下dockerfile
FROM cloudera/quickstart:latest RUN mkdir /script COPY service.sh /script ENTRYPOINT ["/script/service.sh"]
文件service.sh包含#!/bin/bash service impala-state-store start \ && service impala-catalog start \ && service impala-server start \ && impala-shell -f script.sql --quiet -i localhost
然后我建造它docker build -t impala .
我负责管理docker run impala
它显示了Started Impala State Store Server (statestored):[ OK ] Started Impala Catalog Server (catalogd) :[ OK ] Started Impala Server (impalad):[ OK ] Starting Impala Shell without Kerberos authentication Error: [Errno 2] No such file or directory: 'script.sql'
所以它还需要一些工作,比如提供.sql文件。您看到入口点需要启动启动容器的命令`