代码改变世界

presto更改端口遇到的问题

2017-12-05 21:36  HeHongtao-key  阅读(2698)  评论(0编辑  收藏  举报

临时有更改presto端口的需求,配置文件config.properties,

配置文件所在路径:/home/bigdata/local/presto/presto-data/etc

coordinator=true
node-scheduler.include-coordinator=false
http-server.http.port=8091
query.max-memory=96GB
query.max-memory-per-node=16GB
discovery-server.enabled=true
discovery.uri=http://hostname:8091

#hostname:presto主节点

简单将8091替换为8095端口,用salt下发到所有的presto节点,然后出现presto服务不可用的情况。

1.查看presto的worker节点,日志中出现:

2017-12-05T18:12:35.394+0800 DEBUG Query-20171205_101235_00029_9p57n-243 com.facebook.presto.execution.QueryStateMachine Query 20171205_101235_00029_9p57n failed
com.facebook.presto.spi.PrestoException: No worker nodes available
at com.facebook.presto.util.Failures.checkCondition(Failures.java:87)
at com.facebook.presto.sql.planner.SystemPartitioningHandle.getNodePartitionMap(SystemPartitioningHandle.java:149)
at com.facebook.presto.sql.planner.NodePartitioningManager.getNodePartitioningMap(NodePartitioningManager.java:105)
at com.facebook.presto.execution.scheduler.SqlQueryScheduler.lambda$null$0(SqlQueryScheduler.java:140)
at java.util.HashMap.computeIfAbsent(HashMap.java:1126)
at com.facebook.presto.execution.scheduler.SqlQueryScheduler.lambda$new$1(SqlQueryScheduler.java:140)
at com.facebook.presto.execution.scheduler.SqlQueryScheduler.createStages(SqlQueryScheduler.java:241)
at com.facebook.presto.execution.scheduler.SqlQueryScheduler.<init>(SqlQueryScheduler.java:131)
at com.facebook.presto.execution.SqlQueryExecution.planDistribution(SqlQueryExecution.java:434)
at com.facebook.presto.execution.SqlQueryExecution.start(SqlQueryExecution.java:274)
at com.facebook.presto.execution.QueuedExecution.lambda$start$1(QueuedExecution.java:62)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

2017-12-05T18:31:37.551+0800 WARN http-worker-240 com.facebook.presto.execution.SqlTaskManager Switching coordinator affinity from x4cpe to tendi
2017-12-05T18:31:37.613+0800 WARN http-worker-239 com.facebook.presto.execution.SqlTaskManager Switching coordinator affinity from tendi to qgh2a
2017-12-05T18:31:37.764+0800 WARN http-worker-240 com.facebook.presto.execution.SqlTaskManager Switching coordinator affinity from qgh2a to mfu69

原因:worker节点配置文件错误,错把coordinator设置为true。这样就启动了多个master节点,导致master不断切换。

主节点的配置coordinator=true

worker节点的配置coordinator=false

重新替换后presto工作正常。

2.启动的worker节点数少于预期,部分work节点仍然无法启动。

日志中出现:

Caused by: java.net.BindException: Address already in use

常见错误,端口被其他应用占用。

使用lsof -i:8095 查看到tomcat在使用该接口(需切换到root用户下 )。