Presto进程管理实现监控及自动重启

星期四, 2021-10-21 | Author: Lee | JAVA-and-J2EE, 大数据 | 1,264 views

具体搭建就不说了可以参考官方文档

https://prestodb.io/docs/current/

其他查询接口也列下:

默认UI是:根据更改的端口调整
http://xxx:8080

获取集群状态 接口:
http://xxx/v1/cluster

获取NODE信息:接口:
http://xxx/v1/node

访问/v1/info/state, 直接从worker处获取worker的状态

取各节点的版本详情 获取节点信息的接口:
http://xxx/v1/service

具体监控信息如下:

#!/bin/bash
. /etc/profile
restart() {
  /opt/cloudera/parcels/presto/bin/launcher restart &
}
pid=$(ps -ef |grep PrestoServer |grep -v "grep"| awk '{print $2}')
if [[ `expr match "$pid" "[0-9][0-9]*$"` == 0 ]];
then
    echo "-----------------------------------------"
    echo $(date +"%y-%m-%d %H:%M:%S") >> /web/apps/presto/presto_monitor.log
    restart
    echo "Presto crash,restart finish." >> /web/apps/presto/presto_monitor.log
fi
 
#做定时任务监控后自动重启
 
*/10 * * * * sh /web/apps/presto/presto_monitor.sh
 
##编辑定时任务新增
crontab -e 
 
# 重启crond
systemctl reload crond
systemctl restart crond
 
# 查看当前用户定时任务
crontab -l
 
# 通过日志查看是否生效
tail -100 /var/log/cron

Tags:

文章作者: Lee

本文地址: https://www.pomelolee.com/2211.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta