presto部署连接postgresql

  • Presto配置

依据官网介绍(https://prestodb.io/docs/current/installation/deployment.html)按步骤配置并启动presto。

  1. 下载presto-server并解压重命名为presto,进入presto并新建etc、data文件夹;
  2. 依据官网介绍,在etc文件夹下增加并配置presto各配置文件。

    3. 增加postgresql的配置文件,配置文件路径为presto/etc/catalog/postgresql.properties,配置内容为

postgresql.properties

connector.name=postgresql

connection-url=jdbc:postgresql://192.168.1.40:5432/gisdb

connection-user=postgres

connection-password=123456

其中gisdb为已安装的postgresql数据库的建的库

  • 启动presto

在presto文件夹下,执行如下命令启动presto

./bin/launcher start

扫描二维码关注公众号,回复: 4724268 查看本文章

./bin/launcher run

  • 配置cli

Presto-cli下载路径为

https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.214/presto-cli-0.214-executable.jar

  1. 新建prestocli文件夹,将presto-cli-0.214-executable.jar移到该文件夹下,并将presto-cli-0.214-executable.jar重命名为presto
  2. 执行如下命令连接presto server的postgresql数据库

./presto --server localhost:8080 --catalog postgresql --schema gisdb

其中gisdb为本机的数据库

参考执行查询命令

SHOW SCHEMAS FROM postgresql;

SHOW TABLES FROM postgresql.public;

其中postgresql和postgresql.public是本次postgresql建立的数据库

  • 参考:

Deploying Presto

https://prestodb.io/docs/current/installation/deployment.html

PostgreSQL Connector

https://prestodb.io/docs/current/connector/postgresql.html

猜你喜欢

转载自blog.csdn.net/zilong230905/article/details/85262667