序
有些懒,想直接用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界面
doc
想获取最新内容,请关注微信公众号
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。