centos、mac的grafana安装和简单使用
1、安装:
参考官方文档安装说明:https://grafana.com/grafana/download
Redhat & Centos(64 Bit):
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.4-1.x86_64.rpm
sudo yum localinstall grafana-5.0.4-1.x86_64.rpm
Mac:
brew update
brew install grafana
brew reinstall grafana
安装成功提示:
To have launchd start grafana now and restart at login:
brew services start/restart grafana
Or, if you don't want/need a background service you can just run:
grafana-server --config=/usr/local/etc/grafana/grafana.ini --homepath /usr/local/share/grafana cfg:default.paths.logs=/usr/local/var/log/grafana cfg:default.paths.data=/usr/local/var/lib/grafana cfg:default.paths.plugins=/usr/local/var/lib/grafana/plugins
2、启动:
linux下加入开机启动
# /sbin/chkconfig --add grafana-server
启动
# service grafana-server start
重启:
sudo service grafana-server restart
mac下启动:
brew services start grafana
重启:
brew services restart grafana
3、访问登录:
访问地址 ip:3000 初始帐号密码 admin/admin
4、配置文件:
mac位置:/usr/local/etc/grafana/grafana.ini
mac下貌似默认没有ldap的配置文件,没有关系,在grafana.ini指定ldap.toml的位置,然后找个ldap.toml的模板,配置一下即可
linux的grafana的ldap配置文件位置:/etc/grafana/ldap.toml
linux位置:默认的配置文件是/etc/grafana/grafana.ini
5、Mac下grafana安装数据源插件open-falcon
官方推荐方法 :grafana-cli plugins install grafana-openfalcon-datasource,其实不行
使用命令查看可用插件列表:grafana-cli plugins list-remote,发先openfalcon为名字fastweb-openfalcon-datasource
grafana-cli plugins install fastweb-openfalcon-datasource
6、离线安装:http://docs.grafana.org/plugins/installation/
由于服务器所在网络无法访问外网,需要把下载好的插件导入后再安装
grafana-cli --pluginUrl https://local/<plugin-id>-<plugin-version>.zip plugins install <plugin-id>
或者把插件直接解压到安装目录也可以,亲测可行:
mac下的插件目录:/usr/local/var/lib/grafana/plugins
log目录:/usr/local/var/log/grafana
linux的插件目录:/var/lib/grafana/plugins
log目录:/var/log/grafana
7、多说几句,这几个步奏都不难,说下Invite your team吧
默认帐号admin/admin,然后可以发出邀请用户申请
发出邮件邀请的前提当然需要开启grafana发邮件的功能,配置文件grafana.ini找smtp的配置,说下含义:
开启功能:enabled=true
邮件服务器地址:host
登录邮件服务器的帐号和密码 user、password
去除ssl验证:skip_verify=true
发件人地址:from_address
一切配置正确的话,被邀请人就会收到如下形式的邮件,根据链接提示完成信息填写,即算邀请成功:
前方高能,注意注意:
错误一:
t=2018-04-17T16:28:12+0800 lvl=eror msg="Async sent email 0 succeed, not send emails: xx@xxx err: x509: certificate is valid for *.xxx, xxx, not xx"
解决方法:skip_verify = true 去除校验
参考:https://github.com/grafana/grafana/issues/7189
错误二:
t=2018-04-17T16:33:10+0800 lvl=eror msg="Async sent email 0 succeed, not send emails: xx@xx err: gomail: could not send email 1: 553 Mail from must equal authorized user"
解决方法:配置from_address要和user一致
grafana5.x版本的Dashboard Features不再有Templating的概念,增加了Variables的概念
管理员拥有配置数据源、安装插件、邀请用户等操作,普通用户没有
参考:
1、https://blog.csdn.net/clevercode/article/details/78001654
2、https://blog.csdn.net/yajie_12/article/details/79005783