---
title: "grafana的安装与启动"
author: "wlcacc"
date: "2018-07-22T08:00:02Z"
tags: []
categories: ["开源软件"]
slug: "grafana"
draft: false
lastmod: "2018-07-22T08:04:04Z"
id: 2427291
url: "https://wlcacc.iteye.com/blog/2427291"
---

环境：CentOS7.2

1、下载与安装

 

官方URL：[https://grafana.com/grafana/download](https://grafana.com/grafana/download "Download Grafana")

 

执行如下命令：

Redhat & Centos(64 Bit)

 

wget [https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.1-1.x86\_64.rpm](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.1-1.x86_64.rpm)   
sudo yum localinstall grafana-5.2.1-1.x86\_64.rpm 

 

2、启动

 

官方URL：[http://docs.grafana.org/installation/rpm/](http://docs.grafana.org/installation/rpm/ "http://docs.grafana.org/installation/rpm/")

 

## Start the server (init.d service)[¶](http://docs.grafana.org/installation/rpm/#start-the-server-init-d-service)

You can start Grafana by running:

```bash

$ sudo service grafana-server start
```

This will start the `grafana-server` process as the `grafana` user, which is created during package installation. The default HTTP port is `3000`, and default user and group is `admin`.

 

 

3、访问

 

http://localhost:3000

默认端口：3000

默认用户名密码都是admin

 

访问之前记得关闭防火墙：iptables -F

 

 

4、配置信息

 

```
[root@localhost ~]# cat /etc/sysconfig/grafana-server
GRAFANA_USER=grafana

GRAFANA_GROUP=grafana

GRAFANA_HOME=/usr/share/grafana

LOG_DIR=/var/log/grafana

DATA_DIR=/var/lib/grafana

MAX_OPEN_FILES=10000

CONF_DIR=/etc/grafana

CONF_FILE=/etc/grafana/grafana.ini

RESTART_ON_UPGRADE=true

PLUGINS_DIR=/var/lib/grafana/plugins

PROVISIONING_CFG_DIR=/etc/grafana/provisioning

# Only used on systemd systems
PID_FILE_DIR=/var/run/grafana
[root@localhost ~]#
```

 

 

从上面配置信息可以看到grafana的配置信息， 例如：

环境配置文件：/etc/sysconfig/grafana-server

日志目录：/var/log/grafana

数据目录：/var/lib/grafana