alertsnitch+grafana_prometheus告警数据持久化到MySQL 的问题
参照
https://blog.csdn.net/L_15156024189/article/details/124858301
https://blog.51cto.com/u_13747676/5323538
https://grafana.com/grafana/dashboards/15833-prometheus-alert-history/
安装alertsnitch 安装完毕后
始终报错 db query error: Error 1146: Table 'alertsnitch.alert' doesn't exist,除了这个其他一切正常
mysql> use alertsnitch;
mysql> show tables;
+-----------------------+
| Tables_in_alertsnitch |
+-----------------------+
| Alert |
| AlertAnnotation |
| AlertGroup |
| AlertLabel |
| CommonAnnotation |
| CommonLabel |
| GroupLabel |
| Model |
+-----------------------+
8 rows in set (0.00 sec)
mysql> select * from Alert ;
Empty set (0.00 sec)
mysql> repair table alertsnitch.alert;
+-------------------+--------+----------+-----------------------------------------+
| Table | Op | Msg_type | Msg_text |
+-------------------+--------+----------+-----------------------------------------+
| alertsnitch.alert | repair | Error | Table 'alertsnitch.alert' doesn't exist |
| alertsnitch.alert | repair | status | Operation failed |
+-------------------+--------+----------+-----------------------------------------+
2 rows in set (0.01 sec)
原因
1、可能跟MYSQL版本是别的table表名大小写有关
2、可能跟数据库的一些配置有关
解决方法
可能跟mysql服务器和配置文件有关
如有问题及时沟通
alert这张表数据文件所在磁盘之前可能有非常规卸载,手工挂载,导致文件异常,物理文件已经被删除了,只剩结构文件了
重启服务器试一下呢