1

有些懒,想直接用sql查询mongo,找来找去,找到了drill,于是进行docker化安装。

Dockerfile

FROM java:8
RUN     mkdir -p /drill-scripts && \
        mkdir -p /opt/drill
RUN curl -o apache-drill-1.10.0.tar.gz http://mirror.bit.edu.cn/apache/drill/drill-1.10.0/apache-drill-1.10.0.tar.gz
#COPY apache-drill-1.10.0.tar.gz apache-drill-1.10.0.tar.gz
RUN tar zxpf apache-drill-1.10.0.tar.gz -C /opt/drill

ADD bootstrap.sh /drill-scripts/bootstrap.sh
RUN chown root:root /drill-scripts/bootstrap.sh && \
    chmod 700 /drill-scripts/bootstrap.sh
ENV BOOTSTRAP /drill-scripts/bootstrap.sh


#
# Expose the Apache Drill Web UI
# https://drill.apache.org/docs/storage-plugin-registration/
#
EXPOSE 8047

bootstrap.sh

#!/bin/bash
echo ""
echo ""
echo "###############################################################################################"
echo "# Welcome to your Apache Drill v1.10.0 (Embedded mode) Docker image                            #"
echo "#                                                                                             #"
echo "# Quick start query:                                                                          #"
echo "# SELECT * FROM cp.\`employee.json\` LIMIT 5;                                                   #"
echo "#                                                                                             #"
echo "# More examples can be found at:                                                              #"
echo "# https://drill.apache.org/docs/querying-a-file-system-introduction/                          #"
echo "#                                                                                             #"
echo "# To exit:                                                                                    #"
echo "# !quit                                                                                       #"
echo "###############################################################################################"
echo ""
echo ""
echo "Starting Apache Drill v1.10.0 in embeded mode..."
echo ""
echo ""

#
# Start Apache Drill in embedded mode
# https://drill.apache.org/docs/starting-drill-on-linux-and-mac-os-x/
#

/opt/drill/apache-drill-1.10.0/bin/drill-embedded

build & run

docker build -t drill:1.10.0 .
docker run -p 8047:8047 --rm -it -e DRILL_HEAP=1G drill:1.10.0 /drill-scripts/bootstrap.sh

打开web界面

http://192.168.99.100:8047/

图片描述

doc


想获取最新内容,请关注微信公众号

图片描述


codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...


引用和评论

0 条评论