陈老师:1415968548 郑老师:2735197625 乐老师:354331153
客服热线:
19941464235/19906632509(微信同号)

客服微信

腾讯云分布式数据库TDSQL如何实现开机自动启动

作者:许玉冲
原创
发布时间:2021-01-18 13:15
浏览量:352






TDSQL 如何实现开机自动启动



01.



zookeeper



开机自动启动脚本

/server/scripts/check_supervisor_alive.sh

通过supervisor程序保障zookpeeper的存活。

zookeeper配置文件:

[root@tdsql1 supervisord.d]# pwd/etc/supervisord.d[root@tdsql1 supervisord.d]# lssupervisord_zookeeper.conf

02.



agent,mysql,proxy



开机自动启动脚本:

*/5 * * * * (cd /data/oc_agent/scripts; ./agent_monitor.sh >crontab.log 2>&1)

通过"ewp_tdsql_proc"程序启动,该程序是agent的父进程,负责启动如下2个进程。

root 16641     1  0 Dec16 ?        00:07:30 ./ewp_tdsql_proc /data/oc_agent/binroot 16733     1  0 Dec16 ?        00:29:04 ./ewp_tdsql_oc /data/oc_agent/bin --config=../conf/oc_agent.xml

agent 启动之后,根据配置文件自动启动mysql,proxy相关进程

[root@tdsql1 conf]# ls15001_dcagent_V2_proc.xml 15002_routerupdate_V2_proc.xml 4004_mysqldsafe_V2_proc.xml collection_conf15001_mysqlproxy_V2_proc.xml 4001_binlogproduct_V2_proc.xml 4004_mysqlreport_V2_proc.xml crontab_scripts.conf15001_routerupdate_V2_proc.xml 4001_mysqldsafe_V2_proc.xml 4005_binlogproduct_V2_proc.xml ewp_agent.xml15002_dcagent_V2_proc.xml 4001_mysqlreport_V2_proc.xml 4005_mysqldsafe_V2_proc.xml nested_scripts.conf15002_mysqlproxy_V2_proc.xml 4004_binlogproduct_V2_proc.xml 4005_mysqlreport_V2_proc.xml oc_agent.xml[root@tdsql1 conf]#


03.



scheduler



开机自动启动脚本

/server/scripts/check_scheduler_alive.sh


04.



oss



开机自动启动脚本

/server/scripts/check_oss_alive.sh


05.



collector 和analyze



开机自动启动脚本

/server/scripts/check_coll_any_alive.sh


06.



clouddba



开机自动启动脚本

/server/scripts/check_clo_alive.sh


07.



onlineddl



开机自动启动脚本

/server/scripts/check_onlineddl_alive.sh


08.



chitu



开机自动启动脚本

/server/scripts/check_supervisor_alive.sh
[root@tdsql2 supervisord.d]# pwd/etc/supervisord.d[root@tdsql2 supervisord.d]# lssupervisord_nginx.conf  supervisord_php.conf


09.



crontab 设置检查



开机自动启动脚本

  • zk,db,proxy节点

*/5 * * * * (cd /data/oc_agent/scripts; ./agent_monitor.sh >crontab.log 2>&1)30 4 * * * find /data/coredump -type f -mtime +2 |xargs rm -f &>/dev/null*/3 * * * * /bin/bash /server/scripts/check_supervisor_alive.sh0 0 * * * (cd /data1/monitorcmd; ./monitoriotop.sh)
  • db,proxy,oss,chitu,monitor,clouddba,onlineddl,chitu节点

*/5 * * * * (cd /data/oc_agent/scripts; ./agent_monitor.sh >crontab.log 2>&1)30 4 * * * find /data/coredump -type f -mtime +2 |xargs rm -f &>/dev/null*/3 * * * * /bin/bash /server/scripts/check_supervisor_alive.sh0 0 * * * (cd /data1/monitorcmd; ./monitoriotop.sh)*/3 * * * * /bin/bash /server/scripts/check_scheduler_alive.sh30 4 * * * find /data/scheduler_log -type f -mtime +7 |xargs rm -f &>/dev/null5 */2 * * * ( cd /data/application/scheduler/bin;./backupZkInfo >/dev/null 2>&1 )3 2 * * * ( find /data/zkbak/zkbackup -type f -mtime +30 |xargs rm )*/3 * * * * /bin/bash /server/scripts/check_oss_alive.sh*/4 * * * * /bin/bash /server/scripts/check_coll_any_alive.sh*/3 * * * * /bin/bash /server/scripts/check_clo_alive.sh*/3 * * * * /bin/bash /server/scripts/check_onlineddl_alive.sh


*禁止转载,可转发(转发原创文章请注明出处)