环境CentOS Linux release 7.3.1611
(查看centos版本 cat /etc/redhat-release)
安装Grafana
通过yum直接安装Grafana
sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3-1.x86_64.rpm
将grafana-server添加到系统启动项
sudo systemctl enable grafana-server.service
启动grafana-server
$ systemctl daemon-reload //#重新载入 systemd,扫描新的或有变动的单元
$ systemctl start grafana-server
$ systemctl status grafana-server
访问grafana 我是在192.168.1.1上面安装的,grafana服务端默认访问端口是3000,访问地址为192.168.1.1:3000,初次访问时打不开,查了下防火墙,发现3000端口没有打开。
[root@localhost grafana]# firewall-cmd --list-ports
5000/udp 80/tcp 5044/tcp 8080/tcp 9200/tcp 5043/tcp 9100/tcp 10050/tcp 5601/tcp 5000/tcp
给防火墙添加3000端口
[root@localhost grafana]# firewall-cmd --add-port=3000/tcp --zone=public --permanent
Success
[root@localhost grafana]# firewall-cmd --reload
success
[root@localhost grafana]# firewall-cmd --list-ports
3000/tcp 5000/udp 80/tcp 5044/tcp 8080/tcp 9200/tcp 5043/tcp 9100/tcp 10050/tcp 5601/tcp 5000/tcp
已添加3000端口,再次访问,成功。