Hadoop(十二)Presto 搭建
source link: https://blog.csdn.net/mingyunxiaohai/article/details/80937401
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Presto是一个开源的分布式SQL查询引擎,用于针对各种大小(从千兆字节到千兆字节)的数据源运行交互式分析查询。
官方部署文档
https://prestodb.io/docs/current/installation/deployment.html
https://prestodb.io/docs/current/installation/cli.html
下载 presto-server 文件和 client 客户端
解压 presto-server-0.205.tar.gz
tar -zxvf presto-server-0.205.tar.gz
进入解压根目录创建配置文件目录 etc
mkdir etc
cd etc
在 etc 下创建多个配置文件
touch config.properties jvm.config node.properties
mkdir catalog
touch catalog/hive.properties
config.properties
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=512MB
query.max-memory-per-node=512MB
discovery-server.enabled=true
discovery.uri=http://bigdata:8080
jvm.config
-server
-Xmx2G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
node.properties
node.environment=production
node.id=master
node.data-dir=/home/chs/software/presto-server-0.205-SNAPSHOT/tmp/presto-data
catalog/hive.properties
connector.name=hive-hadoop2
hive.metastore.uri=thrift://master:9083
hive.config.resources=/home/chs/hadoop-2.7.3/etc/hadoop/core-site.xml,/home/chs/hadoop-2.7.3/etc/hadoop/hdfs-site.xml
运行客户端测试
启动服务
在安装目录下运行 ./bin/launcher start
给下载的客户端文件重命名方便调用 mv presto-cli-0.166-executable.jar presto
给他放到bin目录下
把它的权限改为可执行 chmod 777 ./presto
运行客户端 ./bin/presto --server master:8080 --catalog hive --schema default
最后访问 http://master:8080 能看到下面的界面说明启动成功
下面启动hive 按照https://blog.csdn.net/mingyunxiaohai/article/details/80368336 中的第二种方法远程仓库启动并连接
进入客户端后查看表show tables;
可以看到我这里面有两个表
0: jdbc:hive2://master:10000/default> show tables;
+-----------------+--+
| tab_name |
+-----------------+--+
| record |
| user_dimension |
+-----------------+--+
2 rows selected (1.584 seconds)
0: jdbc:hive2://master:10000/default>
在进入presto的的客户端中查看表 show tables;
presto:default> show tables;
Table
----------------
record
user_dimension
(2 rows)
Query 20180706_023420_00003_5mvp2, FINISHED, 1 node
Splits: 18 total, 18 done (100.00%)
0:01 [2 rows, 54B] [1 rows/s, 41B/s]
presto:default>
如果如上面也能看到那两张表 说明成功。
OK完事。
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK