请教Tidb部署完成后Grafana正常登陆但没有任何动态数据显示

  • 系统版本 & kernel 版本:Red Hat Enterprise Linux 7.3 & 3.10.0-514.el7.x86_64
  • TiDB 版本:v2.1.6
  • 磁盘型号:SSD
  • 集群节点分布:3台物理机器 第一台1 tikv 1 tidb 1 pd 其他 1 tikv 1 tidb
  • 集群IOPS:单台2.5~2.8w

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 160
On-line CPU(s) list: 0-159
Thread(s) per core: 2
Core(s) per socket: 20
座: 4
NUMA 节点: 4
厂商 ID: GenuineIntel
CPU 系列: 6
型号: 85
型号名称: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
步进: 4
CPU MHz: 1293.000
BogoMIPS: 4806.94
虚拟化: VT-x
L1d 缓存: 32K
L1i 缓存: 32K
L2 缓存: 1024K
L3 缓存: 28160K
NUMA 节点0 CPU: 0-19,80-99
NUMA 节点1 CPU: 20-39,100-119
NUMA 节点2 CPU: 40-59,120-139
NUMA 节点3 CPU: 60-79,140-159

Mem:
total used free shared buff/cache available
Mem: 754 10 740 0 4 743
Swap: 0 0 0

  • 问题描述:

1、按照安装指导部署了Tidb数据库,首次通过IE访问,Grafana显示为空白,通过更换Chrome浏览器后发现能够登陆到Grafana,但没有任何动态数据显示,如图

2、检查防火墙、SElinux、iptables均已经关闭。

3、在部署完数据库启动Tidb数据库,有一段信息,和其他正常启动有差异,但是最终还是显示All goes well. :-),尝试重启后续提示消失,但Grafana任然没有任何动态数据。
TASK [Create grafana API key file] *************************************************************************************************************************************************
changed: [xx.xxx.xxx.xxx → localhost] => (item={u’status’: 200, u’content_length’: u’126’, u’cookies’: {}, u’changed’: False, ‘_ansible_no_log’: False, ‘item’: {u’role’: u’Admin’, u’name’: u’grafana_apikey’}, u’url’: u’http://xx.xxx.xxx.xxx:3000/api/auth/keys’, ‘_ansible_item_result’: True, u’json’: {u’name’: u’grafana_apikey’, u’key’: u’eyJrIjoiYzBmMlBpTU5ycGZDS0Z3N2pObzB5UUZNVVVpbXRUcGMiLCJuIjoiZ3JhZmFuYV9h=‘}, ‘failed’: False, u’connection’: u’close’, ‘_ansible_parsed’: True, u’content_type’: u’application/json’, u’invocation’: {u’module_args’: {u’directory_mode’: None, u’force’: False, u’remote_src’: None, u’follow_redirects’: u’safe’, u’body_format’: u’json’, u’owner’: None, u’follow’: False, u’client_key’: None, u’group’: None, u’use_proxy’: True, u’unsafe_writes’: None, u’serole’: None, u’content’: None, u’setype’: None, u’status_code’: [200], u’return_content’: False, u’method’: u’POST’, u’body’: u’{“role”: “Admin”, “name”: “grafana_apikey”}‘, u’url_username’: u’VALUE_SPECIFIED_IN_NO_LOG_PARAMETER’, u’src’: None, u’dest’: None, u’selevel’: None, u’force_basic_auth’: True, u’removes’: None, u’http_agent’: u’ansible-httpget’, u’user’: u’VALUE_SPECIFIED_IN_NO_LOG_PARAMETER’, u’regexp’: None, u’password’: u’VALUE_SPECIFIED_IN_NO_LOG_PARAMETER’, u’url_password’: u’VALUE_SPECIFIED_IN_NO_LOG_PARAMETER’, u’url’: u’http://xx.xxx.xxx.xxx:3000/api/auth/keys’, u’validate_certs’: True, u’seuser’: None, u’client_cert’: None, u’creates’: None, u’headers’: {u’Content-Type’: u’application/json’, u’Authorization’: u’Basic YWRtaW46=‘}, u’delimiter’: None, u’mode’: None, u’timeout’: 30, u’attributes’: None, u’backup’: None}}, u’date’: u’Tue, 03 Sep 2019 09:33:59 GMT’, u’redirected’: False, ‘_ansible_ignore_errors’: None, u’msg’: u’OK (126 bytes)'})

4、检查了Grafana.log,并和其他环境下Grafana正常访问的进行比较,发现许多相似的错误,无明显的提示。

5、检查系统日志和node_exporter.log有关于CPU的报错,
系统日志:
Sep 3 19:21:40 tidb1 dbus-daemon: dbus[2388]: [system] Successfully activated service ‘org.freedesktop.problems’
Sep 3 19:21:43 tidb1 run_node_exporter.sh: time=“2019-09-03T19:21:43+08:00” level=error msg=“ERROR: cpu collector failed after 0.018346s: open /sys/bus/cpu/devices/cpu0/cpufreq/scaling_cur_freq: no such file or directory” source=“collector.go:123”
Sep 3 19:21:58 tidb1 run_node_exporter.sh: time=“2019-09-03T19:21:58+08:00” level=error msg=“ERROR: cpu collector failed after 0.018568s: open /sys/bus/cpu/devices/cpu0/cpufreq/scaling_cur_freq: no such file or directory” source=“collector.go:123”

node_exporter.log:
time=“2019-09-03T01:30:14+08:00” level=error msg=“Error on statfs() system call for “/run/user/42/gvfs”: permission denied” source=“filesystem_linux.go:57”
time=“2019-09-03T01:30:14+08:00” level=error msg=“ERROR: cpu collector failed after 0.015550s: open /sys/bus/cpu/devices/cpu0/cpufreq/scaling_cur_freq: no such file or directory” source=“collector.go:123”

6、尝试排除CPU的报错影响,绑核nohup taskset -c 0-19,80-99 /data1/deploy/bin/tidb-server以及修改Tidb参数,但是CPU的报错任然存在。

7、尝试部署v3.0.0-beta版本,Grafana任然没有任何动态数据。

8、尝试过部署多个Tikv实例,并修改conf参数任然存在问题,为便于查找原因,采用单个Tikv的部署。

请教一下要如何进行排查,谢谢!

首先需要看下 每个节点上 node_exporter 是否都正常运行。

监控中查看的数据流程大概是这样:

3.0 版本的:prometheus 会从 tidb/tikv/pd 抓取数据,存放到 prometheus 里面,之后 grafana 再去 prometheus 里面查询并将结果显示到 grafana 监控面板上。

如出现上图中监控项看不到数据,可以从两个方向排查

1.检查下 prometheus 中是否存在数据,如不存在,排查下 prometheus 抓取数据时有问题

2.如 prometheus 中存在数据,而 grafana 中去查询时,没有数据显示,可能是 json 配置有问题,可以检查下

排查了两个方向的日志,将监控的浏览器服务器时间和数据库服务器保持一致Grafana能够正常显示动态数据。

你的数据库时间是多少,浏览器应该是用的本地时间?

部署数据库所在服务器时间和浏览器所在服务器时间相差十多个小时,浏览器用的是本地时间

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。