From b48eefc5479a2b7253e39ab8449a00378d88ff7d Mon Sep 17 00:00:00 2001 From: kev Date: Mon, 21 Oct 2019 11:36:26 +0800 Subject: [PATCH] split presto to prestodb+prestosql --- README.md | 3 +- presto/README.md | 47 ----------------- {presto => prestodb}/Dockerfile.alpine | 4 +- .../Dockerfile => prestodb/Dockerfile.debian | 4 +- prestodb/README.md | 48 ++++++++++++++++++ .../conf/coordinator/catalog/jmx.properties | 0 .../conf/coordinator/catalog/tpcds.properties | 0 .../conf/coordinator/catalog/tpch.properties | 0 .../conf/coordinator/config.properties | 0 .../conf/coordinator/jvm.config | 0 .../conf/coordinator/log.properties | 0 .../conf/coordinator/node.properties | 0 .../conf/standalone/catalog/jmx.properties | 0 .../conf/standalone/catalog/tpcds.properties | 0 .../conf/standalone/catalog/tpch.properties | 0 .../conf/standalone/config.properties | 0 .../conf/standalone/jvm.config | 0 .../conf/standalone/log.properties | 0 .../conf/standalone/node.properties | 0 .../conf/worker/catalog/jmx.properties | 0 .../conf/worker/catalog/tpcds.properties | 0 .../conf/worker/catalog/tpch.properties | 0 .../conf/worker/config.properties | 0 {presto => prestodb}/conf/worker/jvm.config | 0 .../conf/worker/log.properties | 0 .../conf/worker/node.properties | 0 {presto => prestodb}/docker-compose.yml | 4 +- {presto => prestodb}/docker-stack.yml | 16 +++--- .../Dockerfile.alpine | 2 +- .../Dockerfile.debian | 0 prestosql/README.md | 6 +++ prestosql/docker-stack.yml | 50 +++++++++++++++++++ 32 files changed, 121 insertions(+), 63 deletions(-) delete mode 100644 presto/README.md rename {presto => prestodb}/Dockerfile.alpine (93%) rename presto/Dockerfile => prestodb/Dockerfile.debian (94%) create mode 100644 prestodb/README.md rename {presto => prestodb}/conf/coordinator/catalog/jmx.properties (100%) rename {presto => prestodb}/conf/coordinator/catalog/tpcds.properties (100%) rename {presto => prestodb}/conf/coordinator/catalog/tpch.properties (100%) rename {presto => prestodb}/conf/coordinator/config.properties (100%) rename {presto => prestodb}/conf/coordinator/jvm.config (100%) rename {presto => prestodb}/conf/coordinator/log.properties (100%) rename {presto => prestodb}/conf/coordinator/node.properties (100%) rename {presto => prestodb}/conf/standalone/catalog/jmx.properties (100%) rename {presto => prestodb}/conf/standalone/catalog/tpcds.properties (100%) rename {presto => prestodb}/conf/standalone/catalog/tpch.properties (100%) rename {presto => prestodb}/conf/standalone/config.properties (100%) rename {presto => prestodb}/conf/standalone/jvm.config (100%) rename {presto => prestodb}/conf/standalone/log.properties (100%) rename {presto => prestodb}/conf/standalone/node.properties (100%) rename {presto => prestodb}/conf/worker/catalog/jmx.properties (100%) rename {presto => prestodb}/conf/worker/catalog/tpcds.properties (100%) rename {presto => prestodb}/conf/worker/catalog/tpch.properties (100%) rename {presto => prestodb}/conf/worker/config.properties (100%) rename {presto => prestodb}/conf/worker/jvm.config (100%) rename {presto => prestodb}/conf/worker/log.properties (100%) rename {presto => prestodb}/conf/worker/node.properties (100%) rename {presto => prestodb}/docker-compose.yml (73%) rename {presto => prestodb}/docker-stack.yml (71%) rename presto/Dockerfile.alpine-ce => prestosql/Dockerfile.alpine (96%) rename presto/Dockerfile.debian-ce => prestosql/Dockerfile.debian (100%) create mode 100644 prestosql/README.md create mode 100644 prestosql/docker-stack.yml diff --git a/README.md b/README.md index c3dc646..1c85c31 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,8 @@ A collection of delicious docker recipes. - [x] ambari - [x] kafka-arm - [x] kafka-manager -- [x] presto +- [x] prestodb (official) +- [x] prestosql (community) - [x] superset-arm - [x] zookeeper-arm diff --git a/presto/README.md b/presto/README.md deleted file mode 100644 index 5dfdffc..0000000 --- a/presto/README.md +++ /dev/null @@ -1,47 +0,0 @@ -presto -====== - -[Presto][1] is a distributed SQL query engine designed to query large data sets -distributed over one or more heterogeneous data sources. - -## standalone mode - -```yaml -presto: - image: vimagick/presto - ports: - - "8080:8080" - volumes: - - ./conf/standalone:/opt/presto/etc:ro - - /data:/data - restart: unless-stopped -``` - -## cluster mode - -```bash -$ ansible all -a 'mkdir -p /data' - -$ docker stack deploy -c docker-stack.yml presto - -$ docker service update --replicas-max-per-node=1 presto_worker - -$ docker service update --replicas 10 presto_worker - -$ docker ps | grep presto_coordinator | awk '{print $1}' -4cc5c6c420d7 - -$ docker exec -it 4cc5c6c420d7 presto --server localhost:8080 --catalog tpch ->>> show schemas; ->>> show tables from tiny; ->>> select * from tiny.customer limit 10; ->>> quit - -$ curl http://localhost:8080/ui/ - -$ curl http://localhost:8080/v1/service/presto/general -``` - -> :warning: If volume settings are changed, you need to remove them manually on all nodes. - -[1]: https://prestodb.io/ diff --git a/presto/Dockerfile.alpine b/prestodb/Dockerfile.alpine similarity index 93% rename from presto/Dockerfile.alpine rename to prestodb/Dockerfile.alpine index c1991ae..67b81e3 100644 --- a/presto/Dockerfile.alpine +++ b/prestodb/Dockerfile.alpine @@ -1,11 +1,11 @@ # -# Dockerfile for presto +# Dockerfile for prestodb # FROM openjdk:8-jre-alpine MAINTAINER kev -ENV PRESTO_VERSION=0.226 +ENV PRESTO_VERSION=0.227 ENV PRESTO_SERVER_URL=https://repo1.maven.org/maven2/com/facebook/presto/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz ENV PRESTO_CLI_URL=https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/${PRESTO_VERSION}/presto-cli-${PRESTO_VERSION}-executable.jar ENV PRESTO_HOME=/opt/presto diff --git a/presto/Dockerfile b/prestodb/Dockerfile.debian similarity index 94% rename from presto/Dockerfile rename to prestodb/Dockerfile.debian index 3675ba4..b6c30d9 100644 --- a/presto/Dockerfile +++ b/prestodb/Dockerfile.debian @@ -1,11 +1,11 @@ # -# Dockerfile for presto +# Dockerfile for prestodb # FROM openjdk:8-jre-slim-buster MAINTAINER kev -ENV PRESTO_VERSION=0.226 +ENV PRESTO_VERSION=0.227 ENV PRESTO_SERVER_URL=https://repo1.maven.org/maven2/com/facebook/presto/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz ENV PRESTO_CLI_URL=https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/${PRESTO_VERSION}/presto-cli-${PRESTO_VERSION}-executable.jar ENV PRESTO_HOME=/opt/presto diff --git a/prestodb/README.md b/prestodb/README.md new file mode 100644 index 0000000..85ebde5 --- /dev/null +++ b/prestodb/README.md @@ -0,0 +1,48 @@ +prestodb +======== + +[Presto][1] is an open source distributed SQL query engine for running +interactive analytic queries against data sources of all sizes ranging from +gigabytes to petabytes. + +## standalone mode + +```yaml +prestodb: + image: vimagick/prestodb + ports: + - "8080:8080" + volumes: + - ./conf/standalone:/opt/presto/etc:ro + - /data:/data + restart: unless-stopped +``` + +## cluster mode + +```bash +$ ansible all -a 'mkdir -p /data' + +$ docker stack deploy -c docker-stack.yml prestodb + +$ docker service update --replicas-max-per-node=1 prestodb_worker + +$ docker service update --replicas 10 prestodb_worker + +$ docker ps | grep prestodb_coordinator | awk '{print $1}' +4cc5c6c420d7 + +$ docker exec -it 4cc5c6c420d7 prestodb --server localhost:8080 --catalog tpch +>>> show schemas; +>>> show tables from tiny; +>>> select * from tiny.customer limit 10; +>>> quit + +$ curl http://localhost:8080/ui/ + +$ curl http://localhost:8080/v1/service/presto/general +``` + +> :warning: If volume settings are changed, you need to remove them manually on all nodes. + +[1]: https://prestodb.github.io/ diff --git a/presto/conf/coordinator/catalog/jmx.properties b/prestodb/conf/coordinator/catalog/jmx.properties similarity index 100% rename from presto/conf/coordinator/catalog/jmx.properties rename to prestodb/conf/coordinator/catalog/jmx.properties diff --git a/presto/conf/coordinator/catalog/tpcds.properties b/prestodb/conf/coordinator/catalog/tpcds.properties similarity index 100% rename from presto/conf/coordinator/catalog/tpcds.properties rename to prestodb/conf/coordinator/catalog/tpcds.properties diff --git a/presto/conf/coordinator/catalog/tpch.properties b/prestodb/conf/coordinator/catalog/tpch.properties similarity index 100% rename from presto/conf/coordinator/catalog/tpch.properties rename to prestodb/conf/coordinator/catalog/tpch.properties diff --git a/presto/conf/coordinator/config.properties b/prestodb/conf/coordinator/config.properties similarity index 100% rename from presto/conf/coordinator/config.properties rename to prestodb/conf/coordinator/config.properties diff --git a/presto/conf/coordinator/jvm.config b/prestodb/conf/coordinator/jvm.config similarity index 100% rename from presto/conf/coordinator/jvm.config rename to prestodb/conf/coordinator/jvm.config diff --git a/presto/conf/coordinator/log.properties b/prestodb/conf/coordinator/log.properties similarity index 100% rename from presto/conf/coordinator/log.properties rename to prestodb/conf/coordinator/log.properties diff --git a/presto/conf/coordinator/node.properties b/prestodb/conf/coordinator/node.properties similarity index 100% rename from presto/conf/coordinator/node.properties rename to prestodb/conf/coordinator/node.properties diff --git a/presto/conf/standalone/catalog/jmx.properties b/prestodb/conf/standalone/catalog/jmx.properties similarity index 100% rename from presto/conf/standalone/catalog/jmx.properties rename to prestodb/conf/standalone/catalog/jmx.properties diff --git a/presto/conf/standalone/catalog/tpcds.properties b/prestodb/conf/standalone/catalog/tpcds.properties similarity index 100% rename from presto/conf/standalone/catalog/tpcds.properties rename to prestodb/conf/standalone/catalog/tpcds.properties diff --git a/presto/conf/standalone/catalog/tpch.properties b/prestodb/conf/standalone/catalog/tpch.properties similarity index 100% rename from presto/conf/standalone/catalog/tpch.properties rename to prestodb/conf/standalone/catalog/tpch.properties diff --git a/presto/conf/standalone/config.properties b/prestodb/conf/standalone/config.properties similarity index 100% rename from presto/conf/standalone/config.properties rename to prestodb/conf/standalone/config.properties diff --git a/presto/conf/standalone/jvm.config b/prestodb/conf/standalone/jvm.config similarity index 100% rename from presto/conf/standalone/jvm.config rename to prestodb/conf/standalone/jvm.config diff --git a/presto/conf/standalone/log.properties b/prestodb/conf/standalone/log.properties similarity index 100% rename from presto/conf/standalone/log.properties rename to prestodb/conf/standalone/log.properties diff --git a/presto/conf/standalone/node.properties b/prestodb/conf/standalone/node.properties similarity index 100% rename from presto/conf/standalone/node.properties rename to prestodb/conf/standalone/node.properties diff --git a/presto/conf/worker/catalog/jmx.properties b/prestodb/conf/worker/catalog/jmx.properties similarity index 100% rename from presto/conf/worker/catalog/jmx.properties rename to prestodb/conf/worker/catalog/jmx.properties diff --git a/presto/conf/worker/catalog/tpcds.properties b/prestodb/conf/worker/catalog/tpcds.properties similarity index 100% rename from presto/conf/worker/catalog/tpcds.properties rename to prestodb/conf/worker/catalog/tpcds.properties diff --git a/presto/conf/worker/catalog/tpch.properties b/prestodb/conf/worker/catalog/tpch.properties similarity index 100% rename from presto/conf/worker/catalog/tpch.properties rename to prestodb/conf/worker/catalog/tpch.properties diff --git a/presto/conf/worker/config.properties b/prestodb/conf/worker/config.properties similarity index 100% rename from presto/conf/worker/config.properties rename to prestodb/conf/worker/config.properties diff --git a/presto/conf/worker/jvm.config b/prestodb/conf/worker/jvm.config similarity index 100% rename from presto/conf/worker/jvm.config rename to prestodb/conf/worker/jvm.config diff --git a/presto/conf/worker/log.properties b/prestodb/conf/worker/log.properties similarity index 100% rename from presto/conf/worker/log.properties rename to prestodb/conf/worker/log.properties diff --git a/presto/conf/worker/node.properties b/prestodb/conf/worker/node.properties similarity index 100% rename from presto/conf/worker/node.properties rename to prestodb/conf/worker/node.properties diff --git a/presto/docker-compose.yml b/prestodb/docker-compose.yml similarity index 73% rename from presto/docker-compose.yml rename to prestodb/docker-compose.yml index 388b06e..c55bf65 100644 --- a/presto/docker-compose.yml +++ b/prestodb/docker-compose.yml @@ -14,7 +14,7 @@ nfs: - /lib/modules:/lib/modules:ro environment: - NFS_LOG_LEVEL=DEBUG - - NFS_EXPORT_0=/export/presto/coordinator *(ro,no_subtree_check) - - NFS_EXPORT_1=/export/presto/worker1 *(ro,no_subtree_check) + - NFS_EXPORT_0=/export/prestodb/coordinator *(ro,no_subtree_check) + - NFS_EXPORT_1=/export/prestodb/worker1 *(ro,no_subtree_check) privileged: true restart: unless-stopped diff --git a/presto/docker-stack.yml b/prestodb/docker-stack.yml similarity index 71% rename from presto/docker-stack.yml rename to prestodb/docker-stack.yml index 33fae55..138f2dc 100644 --- a/presto/docker-stack.yml +++ b/prestodb/docker-stack.yml @@ -3,12 +3,12 @@ version: "3.7" services: coordinator: - image: vimagick/presto + image: vimagick/prestodb ports: - "8080:8080" volumes: - /data:/data - - presto_coordinator_conf:/opt/presto/etc + - prestodb_coordinator_conf:/opt/presto/etc deploy: replicas: 1 placement: @@ -19,10 +19,10 @@ services: condition: on-failure worker: - image: vimagick/presto + image: vimagick/prestodb volumes: - /data:/data - - presto_worker_conf:/opt/presto/etc + - prestodb_worker_conf:/opt/presto/etc deploy: replicas: 0 placement: @@ -35,16 +35,16 @@ services: volumes: - presto_coordinator_conf: + prestodb_coordinator_conf: driver: local driver_opts: type: nfs o: "addr=10.0.0.1,nolock,soft,ro" - device: ":/export/presto/coordinator" + device: ":/export/prestodb/coordinator" - presto_worker_conf: + prestodb_worker_conf: driver: local driver_opts: type: nfs o: "addr=10.0.0.1,nolock,soft,ro" - device: ":/export/presto/worker" + device: ":/export/prestodb/worker" diff --git a/presto/Dockerfile.alpine-ce b/prestosql/Dockerfile.alpine similarity index 96% rename from presto/Dockerfile.alpine-ce rename to prestosql/Dockerfile.alpine index 8c6cac4..15feed6 100644 --- a/presto/Dockerfile.alpine-ce +++ b/prestosql/Dockerfile.alpine @@ -1,5 +1,5 @@ # -# Dockerfile for presto-ce +# Dockerfile for prestosql # FROM openjdk:8-jre-alpine diff --git a/presto/Dockerfile.debian-ce b/prestosql/Dockerfile.debian similarity index 100% rename from presto/Dockerfile.debian-ce rename to prestosql/Dockerfile.debian diff --git a/prestosql/README.md b/prestosql/README.md new file mode 100644 index 0000000..ee0af6b --- /dev/null +++ b/prestosql/README.md @@ -0,0 +1,6 @@ +prestosql +========= + +[Presto][1] is a high performance, distributed SQL query engine for big data. + +[1]: https://prestosql.io diff --git a/prestosql/docker-stack.yml b/prestosql/docker-stack.yml new file mode 100644 index 0000000..cc31d3f --- /dev/null +++ b/prestosql/docker-stack.yml @@ -0,0 +1,50 @@ +version: "3.7" + +services: + + coordinator: + image: vimagick/prestosql + ports: + - "8080:8080" + volumes: + - /data:/data + - prestosql_coordinator_conf:/opt/presto/etc + deploy: + replicas: 1 + placement: + constraints: + - node.role == manager + - node.hostname == presto-coordinator + restart_policy: + condition: on-failure + + worker: + image: vimagick/prestosql + volumes: + - /data:/data + - prestosql_worker_conf:/opt/presto/etc + deploy: + replicas: 0 + placement: + constraints: + - node.role == worker + restart_policy: + condition: on-failure + depends_on: + - coordinator + +volumes: + + prestosql_coordinator_conf: + driver: local + driver_opts: + type: nfs + o: "addr=10.0.0.1,nolock,soft,ro" + device: ":/export/prestosql/coordinator" + + prestosql_worker_conf: + driver: local + driver_opts: + type: nfs + o: "addr=10.0.0.1,nolock,soft,ro" + device: ":/export/prestosql/worker"