Presto-0.228

介绍

Presto是一个运行在机器集群上的分布式系统。完整的安装包括一个协调程序和多个工作程序。查询从客户端(如Presto CLI)提交到协调器。协调器解析、分析和计划查询执行,然后将处理分配给工作者。

 

安装包下载

https://repo1.maven.org/maven2/com/facebook/presto

 

新建etc目录

mkdir -p /opt/presto-server/etc

 

新建文件:etc/node.properties

node.environment=production
node.id=hadoop
node.data-dir=/opt/presto-server/data

 

新建文件:etc/jvm.config

-server
-Xmx1G
-XX:+UseG1GC
-XX:G1HeapRegionSize=8M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError

 

新建文件:etc/config.properties

coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=9090
query.max-memory=1GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=1GB
discovery-server.enabled=true
discovery.uri=http://hadoop:9090

 

新建文件:etc/log.properties

com.facebook.presto=INFO

 

connectors配置

新建目录:etc/catalog,配置hive.properties

connector.name=hive
hive.metastore.uri=thrift://hadoop:9083
hive.parquet.fail-on-corrupted-statistics=false

 

启动Presto

bin/launcher start

 

查看http://hadoop:9090/ui/

 

Presto-cli的使用【将presto-cli-0.228-executable.jar重命名presto-cli即可】

[root@hadoop presto]# ./presto-cli --server hadoop:9090 --catalog hive
presto> help

Supported commands:
QUIT
EXPLAIN [ ( option [, ...] ) ] <query>
    options: FORMAT { TEXT | GRAPHVIZ }
             TYPE { LOGICAL | DISTRIBUTED }
DESCRIBE <table>
SHOW COLUMNS FROM <table>
SHOW FUNCTIONS
SHOW CATALOGS [LIKE <pattern>]
SHOW SCHEMAS [FROM <catalog>] [LIKE <pattern>]
SHOW TABLES [FROM <schema>] [LIKE <pattern>]
USE [<catalog>.]<schema>

presto> show schemas;
       Schema       
--------------------
 default            
 edw                
 information_schema 
(3 rows)

Query 20200218_101852_00000_wmc57, FINISHED, 1 node
Splits: 19 total, 19 done (100.00%)
0:02 [3 rows, 43B] [1 rows/s, 23B/s]

presto> use edw;
USE
presto:edw> show tables;
      Table       
------------------
 t_mkt_custr_info 
 t_mkt_event_info 
(2 rows)

Query 20200218_101910_00002_wmc57, FINISHED, 1 node
Splits: 19 total, 19 done (100.00%)
0:01 [2 rows, 58B] [1 rows/s, 43B/s]

presto:edw> quit

 

链接presto异常:java.sql.SQLException: Authentication using username/password requires SSL to be enabled at com.facebook.presto.jdbc.PrestoDriverUri.setupClient(PrestoDriverUri.java:244) at com.facebook.presto.jdbc.PrestoDriver.connect(PrestoDriver.java:89) at ai.chat2db.spi.sql.IDriverManager.getConnection(IDriverManager.java:87) at ai.chat2db.spi.sql.IDriverManager.getConnection(IDriverManager.java:72) at ai.chat2db.spi.util.JdbcUtils.testConnect(JdbcUtils.java:165) at ai.chat2db.server.domain.core.impl.DataSourceServiceImpl.preConnect(DataSourceServiceImpl.java:59) at ai.chat2db.server.web.api.controller.data.source.DataSourceController.preConnect(DataSourceController.java:118) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) at ai.chat2db.server.web.api.aspect.ConnectionInfoHandler.connectionInfoHandler(ConnectionInfoHandler.java:108) at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89) at ai.chat2db.server.web.api.aspect.ControllerHandler.handle(ControllerHandler.java:49) at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:637) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:627) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:71) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:702) at ai.chat2db.server.web.api.controller.data.source.DataSourceController$$SpringCGLIB$$0.preConnect(<generated>) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at ai.chat2db.server.web.api.config.controller.console.ConsoleHelper.doController(ConsoleHelper.java:389) at ai.chat2db.server.web.api.config.controller.console.ConsoleHelper.lambda$onMessage$2(ConsoleHelper.java:228) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840)
08-15
[root@localhost ~]# cd Downloads/ [root@localhost Downloads]# yum install java-1.8.0-openjdk-devel Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: ftp-stud.hs-esslingen.de * extras: mirrors.aliyun.com * updates: mirrors.aliyun.com Resolving Dependencies --> Running transaction check ---> Package java-1.8.0-openjdk-devel.x86_64 1:1.8.0.412.b08-1.el7_9 will be installed --> Processing Dependency: java-1.8.0-openjdk(x86-64) = 1:1.8.0.412.b08-1.el7_9 for package: 1:java-1.8.0-openjdk-devel-1.8.0.412.b08-1.el7_9.x86_64 --> Running transaction check ---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.332.b09-1.el7_9 will be updated ---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.412.b08-1.el7_9 will be an update --> Processing Dependency: java-1.8.0-openjdk-headless(x86-64) = 1:1.8.0.412.b08-1.el7_9 for package: 1:java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64 --> Running transaction check ---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.332.b09-1.el7_9 will be updated ---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.412.b08-1.el7_9 will be an update --> Processing Dependency: tzdata-java >= 2023d for package: 1:java-1.8.0-openjdk-headless-1.8.0.412.b08-1.el7_9.x86_64 --> Running transaction check ---> Package tzdata-java.noarch 0:2022a-1.el7 will be updated ---> Package tzdata-java.noarch 0:2024a-1.el7 will be an update --> Finished Dependency Resolution /var/cache/yum/x86_64/7/base/gen/comps.xml: no element found: line 1, column 0 Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: java-1.8.0-openjdk-devel x86_64 1:1.8.0.412.b08-1.el7_9 updates 9.9 M Updating for dependencies: java-1.8.0-openjdk x86_64 1:1.8.0.412.b08-1.el7_9 updates 325 k java-1.8.0-openjdk-headless x86_64 1:1.8.0.412.b08-1.el7_9 updates 33 M tzdata-java noarch 2024a-1.el7 updates 187 k Transaction Summary ================================================================================ Install 1 Package Upgrade ( 3 Dependent packages) Total download size: 44 M Is this ok [y/d/N]: y Downloading packages: No Presto metadata available for updates (1/4): java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64.rpm | 325 kB 00:00 (2/4): java-1.8.0-openjdk-devel-1.8.0.412.b08-1.el7_9.x86_ | 9.9 MB 00:21 (3/4): tzdata-java-2024a-1.el7.noarch.rpm | 187 kB 00:00 (4/4): java-1.8.0-openjdk-headless-1.8.0.412.b08-1.el7_9.x | 33 MB 01:12 -------------------------------------------------------------------------------- Total 608 kB/s | 44 MB 01:13 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : tzdata-java-2024a-1.el7.noarch 1/7 Updating : 1:java-1.8.0-openjdk-headless-1.8.0.412.b08-1.el7_9.x86_64 2/7 warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.policy created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.policy.rpmnew warning: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.security created as /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.security.rpmnew restored /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.policy.rpmnew to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.policy restored /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.security.rpmnew to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64/jre/lib/security/java.security Updating : 1:java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64 3/7 Installing : 1:java-1.8.0-openjdk-devel-1.8.0.412.b08-1.el7_9.x86_64 4/7 Cleanup : 1:java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64 5/7 Cleanup : 1:java-1.8.0-openjdk-headless-1.8.0.332.b09-1.el7_9.x86_64 6/7 Cleanup : tzdata-java-2022a-1.el7.noarch 7/7 Verifying : 1:java-1.8.0-openjdk-headless-1.8.0.412.b08-1.el7_9.x86_64 1/7 Verifying : tzdata-java-2024a-1.el7.noarch 2/7 Verifying : 1:java-1.8.0-openjdk-devel-1.8.0.412.b08-1.el7_9.x86_64 3/7 Verifying : 1:java-1.8.0-openjdk-1.8.0.412.b08-1.el7_9.x86_64 4/7 Verifying : tzdata-java-2022a-1.el7.noarch 5/7 Verifying : 1:java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64 6/7 Verifying : 1:java-1.8.0-openjdk-headless-1.8.0.332.b09-1.el7_9.x86_64 7/7 Installed: java-1.8.0-openjdk-devel.x86_64 1:1.8.0.412.b08-1.el7_9 Dependency Updated: java-1.8.0-openjdk.x86_64 1:1.8.0.412.b08-1.el7_9 java-1.8.0-openjdk-headless.x86_64 1:1.8.0.412.b08-1.el7_9 tzdata-java.noarch 0:2024a-1.el7 Complete! [root@localhost Downloads]# history 1 yum -y install gcc gcc-c++ openssl-devel 2 cd Downloads/ 3 wget https://nodejs.org/dist/v6.9.2/node-v6.9.2.tar.gz 4 ls 5 cd .. 6 ls 7 mkdir node 8 cd node 9 tar -xzf ~/Downloads/node-v6.9.2.tar.gz -C ./ 10 ls -l 11 cd .. 12 cd Downloads/ 13 cd node-v6.9.2.tar.gz 14 ls 15 cd node-v6.9.2.tar.gzcd .. 16 cd .. 17 cd node 18 ls 19 cd node-v6.9.2/ 20 ./configure 21 make -j$(nproc) 22 history 23 make install 24 node -v 25 npm -v 26 node --version 27 gcc --version 28 cd .. 29 mkdir -p /data/redis 30 cd /data/redis 31 wget https://download.redis.io/releases/redis-7.0.2.tar.gz 32 ls 33 tar -zxvf redis-7.0.2.tar.gz 34 ls -l 35 cd redis-7.0.2 36 make 37 sudo mkdir -p /etc/redis 38 sudo mkdir -p /var/lib/redis 39 ls -l 40 sudo cp redis.conf /etc/redis/ 41 cd .. 42 l -l 43 ls -l 44 cd .. 45 ls -l 46 cd .. 47 ls -l 48 cd etc/ 49 ls -l 50 cd redis 51 ls -l 52 vi redis.conf 53 redis-server /etc/redis/redis.conf 54 redis-server /redis.conf 55 cd .. 56 cd data 57 cd redis 58 sudo cp /data/redis/redis-7.0.2/src/redis-server /usr/bin/ 59 sudo cp /data/redis/redis-7.0.2/src/redis-cli /usr/bin/ 60 sudo cp /data/redis/redis-7.0.2/src/redis-benchmark /usr/bin/ 61 sudo cp /data/redis/redis-7.0.2/src/redis-check-aof /usr/bin/ 62 sudo cp /data/redis/redis-7.0.2/src/redis-check-rdb /usr/bin/ 63 sudo cp /data/redis/redis-7.0.2/src/redis-sentinel /usr/bin/ 64 cd /user/bin 65 cd .. 66 cd user 67 pwd 68 cd root 69 cd bin 70 ls 71 cd .. 72 ls 73 cd bin 74 ls -l 75 redis-server /etc/redis/redis.conf 76 cd .. 77 cd etc 78 ls -l 79 vi sysctl.conf 80 sysctl -p 81 cd .. 82 redis-server /etc/redis/redis.conf 83* redis-cil ping./ 84 cd bin 85* 86 ls l 87 ls -l 88 redis-server /etc/redis/redis.conf 89 cd .. 90 ls -l 91 cd root 92 cd Downloads/ 93 yum install java-1.8.0-openjdk-devel 94 history [root@localhost Downloads]# ls -l total 25904 -rw-r--r--. 1 root root 26522709 Dec 7 2016 node-v6.9.2.tar.gz [root@localhost Downloads]#
最新发布
10-24
### Java 1.8开发环境安装 可以选择安装系统自带的 JDK 或者从 Oracle 下载 JDK 进行安装。 #### 安装系统自带的 JDK ```bash yum install java-1.8.0-openjdk* -y ``` 若之前安装过系统自带的 JDK 想要卸载,可按如下操作: ```bash # 查询系统安装的 java8 rpm -qa | grep java # (.noarch 可不删除) rpm -e --nodeps java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64 rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64 ``` #### 安装从 Oracle 下载的 JDK ```bash # 下载 wget https://download.oracle.com/otn-pub/java/jdk/8u311-b11/d7fc238d0cbf4b0dac67be84580cfb4b/jdk-8u311-linux-x64.tar.gz # 可能下载不了,建议直接去 oracle 下载后上传到 linux 上 # 解压 tar -zxvf jdk-8u311-linux-x64.tar.gz # 配置环境变量 vim /etc/profile # 进入后改成对应路径即可 export JAVA_HOME=/usr/local/java/jdk1.8.0_271 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin export PATH=$PATH:${JAVA_PATH} # 配置完使用,刷新环境变量 source /etc/profile # 查看是否安装好 java -version ``` **可能存在的问题及解决办法**: - 下载 Oracle JDK 时可能遇到网络问题无法下载,可手动从 Oracle 官网下载后上传到 Linux 系统。 - 配置环境变量时路径填写错误,需仔细检查 `JAVA_HOME` 等路径是否正确。 ### Node.js 安装 通常可以使用包管理器来安装 Node.js,以 `yum` 为例: ```bash # 添加 NodeSource 仓库 curl -sL https://rpm.nodesource.com/setup_14.x | bash - # 安装 Node.js 和 npm yum install -y nodejs # 验证安装 node -v npm -v ``` **可能存在的问题及解决办法**: - 网络问题导致无法添加 NodeSource 仓库,可检查网络连接或手动配置仓库源。 - 安装过程中可能遇到依赖问题,可尝试更新系统包管理器 `yum update` 后再安装。 ### Redis 安装 ```bash # 将下载好的安装包上传到 bigdata04 机器的 /data/soft 目录下 # 解压 tar -zxvf redis-5.0.9.tar.gz # 编译+安装 cd redis-5.0.9 make make install ``` 由于 Redis 需要依赖于 C 语言环境,如果 Centos 镜像是精简版,会缺失 C 语言的依赖,需要安装 C 语言环境才可以编译成功。 ```bash # 安装 C 语言环境 yum install -y gcc ``` ```bash # 修改 redis.conf 配置文件 vi redis.conf # 修改内容如下 daemonize yes logfile /data/soft/redis-5.0.9/log bind 127.0.0.1 192.168.61.103 ``` **可能存在的问题及解决办法**: - 编译时缺少 C 语言环境,安装 `gcc` 即可。 - 配置文件修改错误可能导致 Redis 无法正常启动,需仔细检查配置项。 ### 优化操作步骤 - 可以将安装脚本封装成一个自动化脚本,减少手动操作。 - 对于依赖安装,可在脚本开头先检查是否已安装,未安装则进行安装。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值