grafana 4 升级到 grafana 5错误处理
遇到2个错误:
1. UNIQUE KEY 问题
INFO[07-16|15:34:36] Executing migration logger=migrator id="Remove unique index org_id_slug"
EROR[07-16|15:34:36] Executing migration failed logger=migrator id="Remove unique index org_id_slug" error="Error 1091: Can't DROP 'UQE_dashboard_org_id_slug'; check that column/key exists"
EROR[07-16|15:34:36] Exec failed logger=migrator error="Error 1091: Can't DROP 'UQE_dashboard_org_id_slug'; check that column/key exists" sql="DROP INDEX `UQE_dashboard_org_id_slug` ON `dashboard`"
EROR[07-16|15:34:36] Server shutdown logger=server reason="Service init failed: Migration failed err: Error 1091: Can't DROP 'UQE_dashboard_org_id_slug'; check that column/key exists"
故障原因,原数据库中的`dashboard`表没有“UQE_dashboard_org_id_slug”这个UNIQUE KEY ,所以在删除的时候失败了。
2. Convert existing annotations from seconds to milliseconds问题
INFO[07-16|17:13:41] Executing migration logger=migrator id="Convert existing annotations from seconds to milliseconds"
EROR[07-16|17:13:41] Executing migration failed logger=migrator id="Convert existing annotations from seconds to milliseconds" error="Error 1264: Out of range value for column 'epoch' at row 1"
EROR[07-16|17:13:41] Exec failed logger=migrator error="Error 1264: Out of range value for column 'epoch' at row 1" sql="UPDATE annotation SET epoch = (epoch*1000) where epoch < 9999999999"
EROR[07-16|17:13:41] Server shutdown logger=server reason="Service init failed: Migration failed err: Error 1264: Out of range value for column 'epoch' at row 1"
故障原因,原表annotation的字段epoch类型是int,但是新版grafana中,需要将该字段的秒转换为毫秒,长度不够用了,执行转换的sql语句执行失败。
解决方案:
1,导出当前grafana使用的数据库内容:
mysqldump -uroot -hlocalhost -p grafana > grafana.sql
2, 编辑导出的sql文件,将int(11)替换为bigint(20)
vi grafana.sql
:%s/int(11)/int(20)/g
3,找到`dashboard`表的创建语句,添加UNIQUE KEY `UQE_dashboard_org_id_slug`,例如:
DROP TABLE IF EXISTS `dashboard`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dashboard` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` bigint(20) NOT NULL,
`slug` varchar(189) COLLATE utf8mb4_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`data` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`org_id` bigint(20) NOT NULL,
`created` datetime NOT NULL,
`updated` datetime NOT NULL,
`updated_by` bigint(20) DEFAULT NULL,
`created_by` bigint(20) DEFAULT NULL,
`gnet_id` bigint(20) DEFAULT NULL,
`plugin_id` varchar(189) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UQE_dashboard_org_id_slug` (`org_id`,`slug`),
KEY `IDX_dashboard_org_id` (`org_id`),
KEY `IDX_dashboard_gnet_id` (`gnet_id`)
) ENGINE=InnoDB AUTO_INCREMENT=187 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4, 创建新的数据库,然后导入刚刚编辑的sql文件。
create database grafana5 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
use grafana5
source ./grafana.sql;
5, 为grafana账号添加新数据库授权,然后修改新版本配置文件,使用刚创建的数据库。
然后再重新启动grafana5,启动后会自动进行旧数据转换,转换完毕访问grafana的页面,你会发现旧版所有内容都已经可以在新版上访问啦。
grafana 4 升级到 grafana 5错误处理的更多相关文章
- Win7升级Win10系统提示错误0x80070057的解决方法
Win7系统用户在通过Windows Update来升级Win10系统时,有时会出现0x80070057的错误代码从而导致无法继续升级.下面好系统重装助手就来告诉大家Win7升级Win10系统出现0x ...
- 12、Grafan 4.3升级到Grafana 5.0
Upgrading Grafana 升级Grafana We recommend everyone to upgrade Grafana often to stay up to date with t ...
- AX2012 R3升级CU8的一些错误
AX2012 R3安装升级包CU8后进入系统,系统会提示打开软件升级清单“Software update checklist”,清单列出了升级要做的一系列动作. 在进行到编译应用时“Compile a ...
- wordpress升级版本时出现错误“Maximum execution time of 30 seconds exceeded”
wordpress版本是4.9,之前升级5.0时就提示这个错误了,但因为我用的第三方主题,所以也没想去解决,也担心升级了wp版本后主题出问题. 现在wp版本已经到了5.2了,我闲着无聊就又点了升级,结 ...
- tomcat ssi配置及升级导致ssi include错误问题解决
最近tomcat升级版本时,遇到了ssi解析的问题,记录下解决的过程,还有tomcat ssi配置的要点. tomcat 配置SSI的两种方式 Tomcat有两种方式支持SSI:Servlet和Fil ...
- WDCP从php5.2升级到5.3的办法,以及升级过程中iconv错误的处理
从wdcp官方论坛我们可以找到一个询问升级的帖子,然后管理员在回复中也提供了升级方法: cd /tmp wget -c http://dl.wdlinux.cn:5180/soft/php-5.3.1 ...
- 使用electron在mac升级签名后进行升级出现“QRLUpdaterErrorDomain”的错误
现在在开发electron客户端,windows签名使用了签名狗的方式进行签名(小坑:签名狗只能对打包完的exe进行签名,而electron-builder需要在打包的时候将证书配置进去,所以需要导出 ...
- showdoc升级问题,showdoc错误日志
showdoc自带错误日志.目录位于网站根目录的server/Application/Runtime/Logs/Api目录下,如果没有任何内容需要添加可写权限. showdoc升级后,建议把MySQL ...
- 【事件中心 Azure Event Hub】关于EventHub中出现Error时候的一些问题(偶发错误,EventHub后台升级,用户端错误,Retry机制的重要性)
请问对偶发的定义是多少频率? 针对偶发的定义,主要是看发生的时间非常短,次数极少(如 10次以内),并且发生的时候EventHub其他分区或其他连接都是正常接收和发送数据.所以对于频率是没有明确的定义 ...
随机推荐
- VS Code真机测试步骤
VS Code真机测试步骤 前提:你的电脑跟你的手机是在同一个网络环境下.电脑连手机热点: 1. 在扩展里搜索live server,下载安装: 2. 打开cmd 命令窗口(快捷键是win+r): 输 ...
- CentOS 7 时间同步方法
centos 7 时间同步使用的是chrony工具 1.检测chrony包是否安装 [root@martin ~]# rpm -qa|grep chrony 2.安装chrony [root@mart ...
- Java中常用的url签名防篡改方法
实现方式:Md5(url+key) 的方式进行的. 1.key可以是任意的字符串,然后“客户端”和“服务器端”各自保留一份,千万不能外泄. 2.请求的URL 例如: name=lxl&age ...
- Hive 学习之路(六)—— Hive 视图和索引
一.视图 1.1 简介 Hive 中的视图和RDBMS中视图的概念一致,都是一组数据的逻辑表示,本质上就是一条SELECT语句的结果集.视图是纯粹的逻辑对象,没有关联的存储(Hive 3.0.0引入的 ...
- 【转】JDK 内存参数含义
Eclipse崩溃,错误提示: MyEclipse has detected that less than 5% of the 64MB of Perm Gen (Non-heap memory) ...
- Python机器学习经典实例电子版和附带源码
Python机器学习经典实例电子版和附带源码 下载:https://pan.baidu.com/s/1m6ODNJk--PWHW8Vdsdjs-g 提取码:nyc0 分享更多python数据分析相关电 ...
- Java多线程(五):死锁
死锁 概念 当线程Thread-0持有锁Lock1,Thread-1持有锁Lock2,此时Thread-0申请Lock2锁的使用权,Thread-1申请Lock1锁的使用权,Thread-0和Thre ...
- 基于Dapper的开源Lambda扩展,且支持分库分表自动生成实体之基础介绍
LnskyDB LnskyDB是基于Dapper的Lambda扩展,支持按时间分库分表,也可以自定义分库分表方法.而且可以T4生成实体类免去手写实体类的烦恼. 文档地址: https://lining ...
- Python编程菜鸟成长记--A1--03--Python 环境安装(待完成)
1.重点知识 Windows 上如何安装 Python 3 Linux 上如何安装 Python 3 Mac 上如何安装 Python 3 Windows 上如何安装 Pycharm Mac 上如何安 ...
- Codeforces 782B:The Meeting Place Cannot Be Changed(三分搜索)
http://codeforces.com/contest/782/problem/B 题意:有n个人,每个人有一个位置和速度,现在要让这n个人都走到同一个位置,问最少需要的时间是多少. 思路:看上去 ...