2018-08-21 17:02:50 +08:00
|
|
|
presto
|
|
|
|
======
|
|
|
|
|
2019-06-16 16:59:02 +08:00
|
|
|
[Presto][1] is a distributed SQL query engine designed to query large data sets
|
|
|
|
distributed over one or more heterogeneous data sources.
|
|
|
|
|
2019-09-28 13:11:51 +08:00
|
|
|
## standalone mode
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
presto:
|
|
|
|
image: vimagick/presto
|
|
|
|
ports:
|
|
|
|
- "8080:8080"
|
|
|
|
volumes:
|
|
|
|
- ./conf/standalone:/opt/presto/etc:ro
|
|
|
|
- /data:/data
|
|
|
|
restart: unless-stopped
|
|
|
|
```
|
|
|
|
|
|
|
|
## cluster mode
|
2019-06-16 16:59:02 +08:00
|
|
|
|
|
|
|
```bash
|
2019-09-28 13:06:26 +08:00
|
|
|
$ ansible all -a 'mkdir -p /data'
|
|
|
|
|
|
|
|
$ docker stack deploy -c docker-stack.yml presto
|
|
|
|
|
|
|
|
$ docker service update --replicas-max-per-node=1 presto_worker
|
2019-06-16 17:07:52 +08:00
|
|
|
|
2019-09-28 13:06:26 +08:00
|
|
|
$ 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
|
2019-06-16 17:07:52 +08:00
|
|
|
>>> show schemas;
|
|
|
|
>>> show tables from tiny;
|
|
|
|
>>> select * from tiny.customer limit 10;
|
|
|
|
>>> quit
|
|
|
|
|
2019-09-28 13:06:26 +08:00
|
|
|
$ curl http://localhost:8080/ui/
|
|
|
|
|
2019-06-16 18:45:52 +08:00
|
|
|
$ curl http://localhost:8080/v1/service/presto/general
|
2019-06-16 16:59:02 +08:00
|
|
|
```
|
|
|
|
|
2019-09-28 13:06:26 +08:00
|
|
|
> :warning: If volume settings are changed, you need to remove them manually on all nodes.
|
|
|
|
|
2019-06-16 16:59:02 +08:00
|
|
|
[1]: https://prestodb.io/
|