点击上方蓝字,关注我们


腾讯云TDSQL-启停的过程分析
1
OC_AGENT启动,并自动拉起proxy,mysql相关进程
1.1 默认5分钟检测一下agent进出状态
*/5 * * * * root (cd data/oc_agent/scripts; ./agent_monitor.sh >crontab.log 2>&1
每隔5分钟检测"ewp_tdsql_proc"进程是否存在,通过以下命令启动进程。
/data/oc_agent/bin/start_agent.sh
===>启动2个进程
ewp_tdsql_proc==>ewp_tdsql_oc
(通过ewp_tdsql_proc进程拉起来,端口"8966",定期通过SSH心跳上报,<!-- 心跳上报间隔和版本号 -->)
#检查进程是否正常启动
ps -ef|grep tdsql_proc|grep -v grepps -ef|grep tdsql_oc|grep -v grep
1.2 ===>通过/data/oc_agent/conf 相关xml启动PROXY,mysql应进程
1.2.1 PROXY对应启动配置文件
#启动脚本(15001_dcagent_V2_proc.xml)
>cd /data/tdsql_run/15001;cd gateway/bin;./startdcagent_tokafka.sh ../conf/wagent_15001.xml
#启动脚本
(15001_mysqlproxy_V2_proc.xml)
>cd data/tdsql_run/15001;cd gateway/bin;./start.sh instance_15001
#启动脚本
(15001_routerupdate_V2_proc.xml)
>cd data/tdsql_run/15001;cd gateway/bin;./start_router.sh instance_15001
1.2.2 mysql对应的配置文件:
#启动脚本
(4001_binlogproduct_V2_proc.xml)
>cd /data/tdsql_run/4001;cd mysqlagent/bin;./startbinlogproduct_cgroup.sh ../conf/mysqlagent_4001.xml
#启动脚本(4001_mysqldsafe_V2_proc.xml)
>cd /data/home/tdsql/tdsqlinstall;./oc_pull_mysqld.sh 4001 /data/tdsql_run/4001 /data percona-5.7.17 1
#启动脚本(4001_mysqlreport_V2_proc.xml)
>cd /data/tdsql_run/4001;cd mysqlagent/bin;./startreport_cgroup.sh ../conf/mysqlagent_4001.xml
1.3 ===>自动拉起的进程
------>>>proxy./dcagent_tokafka./router_update./mysql-proxy----->>>mysql./mysqlreport./binlogproducter_percona./bin/mysqld_safe./bin/mysqld
2
关闭,禁止自动启动
2.1 注销/etc/crontab相关参数
#*/5 * * * * root (cd /data/oc_agent/scripts; ./agent_monitor.sh >crontab.log 2>&1)
2.2 停止
/data/oc_agent/bin/stop_agent.sh
2.3 强制停止相关进程
for i in {dcagent_tokafka,router_update,mysql-proxy,mysqlreport,binlogproducter_percona,mysqld_safe,mysqld}dofor pid in $(ps -ef|grep $i|grep -v grep|awk '{print $2}')dokill -9 $piddonedone

更多精彩请点击

扫描二维码
关注我们
电话:199-4146-4235
文章转载自云贝学院,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




