

作者简介:张拓拓,瑞蓝创数据库工程师
原创内容未经授权不得随意使用,转载请联系小编并注明来源
OceanBase 数据库的basic exporter 突然处于 inactive 状态,这直接导致数据库关键监控数据断联,无法及时掌握集群运行健康度,给运维工作带来极大隐患。
版本:OCP 版本 4.3.3
经过技术团队排查,症结在于 OCP 4.3.3 版本新增的 P99 延迟采集功能,该功能开启后,内核返回的监控数据量太大,导致 agent 处理超时,最终引发 exporter 异常下线。
目前该问题已在 OCP 4.3.4 版本中完成优化修复。但对于暂时无法升级版本,又急需恢复监控的用户,我们整理了一套「暂时关闭 P99 采集」的应急操作方法。
操作方法如下:
1.在主机上新建⼀个tmp目录,将/home/admin/ocp_agent/conf/module_config/monitor_ob.yaml 拷贝到tmp目录下,同时建议另外建⼀个backup目录先备份下这个配置文件。
2.修改 monitor_ob.yaml 的内容,在ob_query_rt 的采集配置下增加 “disabled: true”来停止该指标的采集,即下面截图中的内容

3.在 tmp 目录下创建⼀个push.py 的执行推送的脚本,脚本内容如下:
#!/usr/bin/python
import base64
import json
import http.client
import sys
defmain():
host = sys.argv[1]
userPswd = sys.argv[2]
op = sys.argv[3].lower()
c = http.client.HTTPConnection(host)
header = {
"Authorization": "Basic " + base64.b64encode(userPswd.encode()).decode(),
"Content-Type":"application/json"
}
ifop== "get":
c.request("GET", "/api/v2/compute/hospits/moduleConfigChanges", None, header)
else:
fileName = sys.argv[4]
content = ""
ifop== "set":
content = sys.stdin.read()
print("%s %s" % (op, fileName))
q = {
"changes":[{
"operation": op,
"scopeType":"global",
"scope":"",
"fileName": fileName,
"content": content,
}]
}
body = json.dumps(q)
c.request("POST", "/api/v2/compute/hospits/moduleConfigChanges", body, header)
r = c.getresponse()
print(r.status)
print(r.read().decode())
if__name__== '__main__':
main()4.依次执行下面两条命令推送配置⽂件,需要将命令中的ip、port、username、password 替换成OCP的ip、端口、用户名、密码。
python push.py ip:port username:password set monitor_ob.yaml < monitor_ob.yaml
5.然后到主机上确认下agent的 monitor_ob.yaml 中的内容是否已经更新;
6.最后需要到OCP metadb 中compute_host_agent_module_config_change 表里的对应记录删除,否则会影响后⾯的ocp-agent升级。执行语句如下:
deletefrom compute_host_agent_module_config_change where file_name in ('monitor_ob.yaml');7.重启ocp_agent
以上就是 OceanBase 数据库在 OCP 4.3.3 版本中,因 P99 延迟采集导致 agent 超时、basic exporter inactive 时,暂时关停 P99 采集的完整方案。若你正受此问题困扰,可按步骤操作缓解故障;
后续我们还会持续分享 OceanBase 数据库的运维技巧与故障排查方案,更多技术分享可扫码关注查看

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70047467/viewspace-3096788/ ,如需转载,请注明出处,否则将追究法律责任。