wget https://repo1.maven.org/maven2/com/facebook/presto/presto-server/0.145/presto-server-0.145.tar.gz tar xzvf presto-server-0.145.tar.gz cd presto-server-0.145 mkdir etc
在etc目录下建立以下几个文件html
1. node.properties 2. jvm.config 3. config.properties 4. log.properties 5. Catalog Properties
node.environment=production #环境的名称,集群状况下每一个presto节点名称须要保持一致 node.id=ffffffff-ffff-ffff-ffff-ffffffffffff #presto节点惟一标示,每一个节点应该都不一样 node.data-dir=/data/store/presto #数据存放目录,presto会把日志和其余数据存这里
-server -Xmx16G -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError=kill -9 %p
#cordinator 最小配置 coordinator=true node-scheduler.include-coordinator=false http-server.http.port=8080 query.max-memory=50GB query.max-memory-per-node=1GB discovery-server.enabled=true discovery.uri=http://example.net:8080 #worker最小配置 coordinator=false http-server.http.port=8080 query.max-memory=50GB query.max-memory-per-node=1GB discovery.uri=http://example.net:8080 #一台机器作测试的时候既做为cordinator也是work那么咱们以下配置 coordinator=true node-scheduler.include-coordinator=true http-server.http.port=8080 query.max-memory=5GB query.max-memory-per-node=1GB discovery-server.enabled=true discovery.uri=http://example.net:8080
com.facebook.presto=INFO
#须要咱们再etc目录下建立catalog目录,而后根据你想用的链接器建立对应的配置文件, #好比我想用mysql链接器则建立mysql.properties #实际状况不少人去用hive链接器..后面若是有机会,在我一边学习的时候再作分享 connector.name=mysql connection-url=jdbc:mysql://localhost:3306 connection-user=root connection-password=secret 若是多个mysql怎么办呢,咱们就在catalog下面创建多个properties文件,可是须要是.properties结尾,名称不同就行
#后台启动 bin/launcher start #前台启动,能够观察输出日志 bin/launcher run #中止 bin/launcher stop
启动以后你能够在/data/store/presto目录下找到输出的日志
node
#下载 wget https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/0.146/presto-cli-0.146-executable.jar #修改文件名为 presto mv presto-cli-0.146-executable.jar presto #添加可执行权限 chmod +x presto #执行 schema 根据本身的表名而定 ./presto --server localhost:8080 --catalog mysql --schema zhanshen
由于条件的限制,没有那么多机器,没法作大数据查询的测试,我很抱歉,对本身很抱歉...我也很庆幸,庆幸...
【1】https://prestodb.io/docs/current/installation/deployment.html
【2】https://prestodb.io/docs/current/connector/mysql.html
【3】https://prestodb.io/docs/current/installation/cli.htmlmysql
本文基于署名-非商业性使用-相同方式共享 4.0许可协议发布,欢迎转载、使用、从新发布,但务必保留文章署名稻草鸟人(包含此订阅号二维码)sql