sudo sqlite2 /var/lib/grafana/grafana.db
update user set password = '59acf18b94d7eb0694c61e60ce44c110c7a683ac6a8f09580d626f90f4a242000746579358d77dd9e570e83fa24faa88a8a6', salt = 'F3FAxVm33R' where login = 'admin';
create database grafana;
GRANT ALL PRIVILEGES ON grafana.* TO 'grafana'@'localhost' IDENTIFIED BY 'grafana';
GRANT ALL PRIVILEGES ON grafana.* TO 'grafana'@'%' IDENTIFIED BY 'grafana';
如果报No 'Access-Control-Allow-Origin' header is present类似于这样的错误,则需要在graphite的apache配置文件中加上
Header set Access-Control-Allow-Origin "http://mygrafana.com:5656"
Header set Access-Control-Allow-Methods "GET, OPTIONS"
Header set Access-Control-Allow-Headers "origin, authorization, accept"
Header set Access-Control-Allow-Credentials true
使用如下命令可以重置grafana的管理员密码
注意:如果只是暂时重置管理员密码,最好记录下之前的password字符串以及对应的
salt
,等操作完成后,可以再重置回去。TroubleShooting
在执行更新grafana的panels的时候提示401错误 http://docs.grafana.org/installation/configuration/#session
将grafana的session的provider配置为
mysql
而不是默认的file
/etc/grafana/grafana.ini
provider_config = grafana:grafana@tcp(127.0.0.1:3306)/grafana
grafana-dashboard update /opt/project-config/grafana/nodepool.yaml grafana-dashboard update /opt/project-config/grafana/zuul-status.yaml
如果报
No 'Access-Control-Allow-Origin' header is present
类似于这样的错误,则需要在graphite的apache配置文件中加上并且a2enmod headers, 然后重启apache