搭建简易开源BI平台(一)

2019-11-08  本文已影响0人  M_75d0

一、clickhouse

1.下载docker镜像

docker pull yandex/clickhouse-server:latest

2.修改配置文件允许远程连接 config.xml

复制默认的配置文件,找到listen_host位置修改成下面的情况

    <!-- Default values - try listen localhost on ipv4 and ipv6: -->
    <!--
    <listen_host>::1</listen_host>
    <listen_host>127.0.0.1</listen_host>

3.docker run

docker run -d --name some-clickhouse-server \
--ulimit nofile=262144:262144 \
-v $PWD/config.xml:/etc/clickhouse-server/config.xml \
-v $PWD/data:/var/lib/clickhouse  yandex/clickhouse-server 

二、metabase

1.install metabase clickhouse plugin

metabse没有官方的clickhouse插件,使用第三方开发的插件https://github.com/enqueue/metabase-clickhouse-driver
Dockfile
注意第三方用的是metabse开发版本,开发版本和realeases版本插件的位置不一样
注意add 进去的包是root用户,需要给metabase加上可读权限,否则不能加载插件

FROM metabase/metabase:v0.33.4
  ADD https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.6/clickhouse.metabase-driver.jar /plugins/
  RUN chmod a+rwx /plugins

dockerbuild

docker build  -t yzh/metabase-with-clickhouse .

2.docker run mysql

mysql

docker run --name mysql \
-v /data/www/mysql/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-e MYSQL_DATABASE=metabase \
-p 3306:3306 \
-d mysql:5.7 \
--character-set-server=utf8mb4 \
--collation-server=utf8mb4_unicode_ci

3.docker run metabase

https://www.metabase.com/docs/latest/operations-guide/running-metabase-on-docker.html

docker run -d --name metabase  -p 80:3000 \
-e MB_DB_CONNECTION_URI="mysql://mysql:3306/metabase?user=root&password=root" \
 yzh/metabase-with-clickhouse:1.0.2

三、streamsets

docker image

docker pull streamsets/datacollector:3.9.1

1.安装jdbc package

Dockerfile

ARG SDC_VERSION=3.9.1
FROM streamsets/datacollector:${SDC_VERSION}
 
ARG SDC_LIBS
RUN "${SDC_DIST}/bin/streamsets" stagelibs -install="${SDC_LIBS}"

docker build

docker build -t yzh/datacollector:3.9.1 --build-arg SDC_VERSION=3.9.1 --build-arg SDC_LIBS=streamsets-datacollector-jdbc-lib .

2.安装mysql、clickhouse jdbcjar包

https://github.com/dangerous1990/docker/tree/master/streamsets/lib
jar包下载地址

3.docker run

docker run -d -p 18630:18630  \
-v $PWD/lib:/opt/streamsets-datacollector-3.9.1/streamsets-libs-extras/streamsets-datacollector-jdbc-lib/lib/ \
-v $PWD/data:/data \
--name streamsets
yzh/datacollector:3.9.1
上一篇下一篇

猜你喜欢

热点阅读