Commit 962d0f6a by Diana Payton Committed by GitHub

Docs: Update rpm install (#21475)

* Update rpm.md

* Update rpm.md

* Moved content to troubleshooting

Updated rpm.md and moved content from rpm.md to troubleshooting.md

* Update rpm.md

* Update rpm.md

* Update rpm.md

* Update rpm.md

* Update rpm.md

* Update rpm.md

* Update rpm.md

* Update docs/sources/installation/rpm.md

Co-Authored-By: Dan Cech <dcech@grafana.com>

* Update docs/sources/installation/rpm.md

Co-Authored-By: Dan Cech <dcech@grafana.com>

Co-authored-by: Dan Cech <dan@aussiedan.com>
parent bcac76f5
+++
title = "Installing on RPM-based Linux"
description = "Grafana Installation guide for Centos, Fedora, OpenSuse, Redhat."
title = "Install on RPM-based Linux"
description = "Grafana Installation guide for RPM-based Linux, such as Centos, Fedora, OpenSuse, and Red Hat."
keywords = ["grafana", "installation", "documentation", "centos", "fedora", "opensuse", "redhat"]
aliases = ["/docs/grafana/latest/installation/installation/rpm"]
type = "docs"
[menu.docs]
name = "Installing on Centos / Redhat"
name = "Install on RPM-based Linux"
identifier = "rpm"
parent = "installation"
weight = 300
+++
# Installing on RPM-based Linux (CentOS, Fedora, OpenSuse, RedHat)
# Install on RPM-based Linux (CentOS, Fedora, OpenSuse, Red Hat)
Read [Upgrading Grafana]({{< relref "upgrading.md" >}}) for tips and guidance on updating an existing
installation.
This page explains how to install Grafana dependencies, download and install Grafana, get the service up and running on your RPM-based Linux system, and the installation package details.
## Download
**Note on upgrading:** While the process for upgrading Grafana is very similar to installing Grafana, there are some key backup steps you should perform. Read [Upgrading Grafana]({{< relref "upgrading.md" >}}) for tips and guidance on updating an existing installation.
Go to the [download page](https://grafana.com/grafana/download?platform=linux) for the latest download
links.
## 1. Download and install
You can install Grafana from a YUM repository, manually using YUM, manually using RPM, or by downloading a binary `.tar.gz` file.
You can install Grafana using Yum directly:
### Install manually with YUM
```bash
sudo yum install <rpm package url>
```
You will find package URLs on the [download page](https://grafana.com/grafana/download?platform=linux).
If you install manually with YUM, then you will need to manually update Grafana for each new version. To enable automatic updates for your Grafana installation please use the instructions below to install via our YUM repository.
Or install manually using `rpm`. First execute
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
* The most recent Grafana version is selected by default.
* The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
2. Select an **Edition**.
* **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
* **Open Source** - Functionally identical to the enterprise version, but you will need to download the enterprise version if you want enterprise features.
3. Depending on which system you are running, click **Linux** or **ARM**.
4. Copy and paste the code from the installation page into your command line and run. It follows the pattern shown below.
```bash
wget <rpm package url>
sudo yum localinstall <local rpm package>
```
### On CentOS / Fedora / Redhat:
You can also install Grafana using YUM directly:
```bash
sudo yum install initscripts urw-fonts
sudo rpm -Uvh <local rpm package>
sudo yum install <rpm package url>
```
### On OpenSuse:
### Install from YUM repository
```bash
sudo rpm -i --nodeps <local rpm package>
```
## Install via YUM Repository
If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo yum update`.
Add the following to a new file at `/etc/yum.repos.d/grafana.repo`
The YUM repository installs the open source edition of Grafana.
1. Add a new file to your YUM repo using the method of your choice. The command below uses `nano`.
```bash
sudo nano /etc/yum.repos.d/grafana.repo
```
2. Enter the following information in grafana.repo and then save it.
For stable releases:
```bash
[grafana]
name=grafana
......@@ -64,9 +67,7 @@ gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
```
There is a separate repository if you want beta releases.
For beta releases:
```bash
[grafana]
name=grafana
......@@ -78,48 +79,59 @@ gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
```
Then install Grafana via the `yum` command.
3. Install Grafana.
```bash
sudo yum install grafana
```
### RPM GPG Key
### Install with RPM
The RPMs are signed, you can verify the signature with this [public GPG key](https://packages.grafana.com/gpg.key).
If you install with RPM, then you will need to manually update Grafana for each new version. This method varies according to which Linux OS you are running. Read the instructions fully before you begin.
## Package details
- Installs binary to `/usr/sbin/grafana-server`
- Copies init.d script to `/etc/init.d/grafana-server`
- Installs default file (environment vars) to `/etc/sysconfig/grafana-server`
- Copies configuration file to `/etc/grafana/grafana.ini`
- Installs systemd service (if systemd is available) name `grafana-server.service`
- The default configuration uses a log file at `/var/log/grafana/grafana.log`
- The default configuration specifies an sqlite3 database at `/var/lib/grafana/grafana.db`
**Note:** The .rpm files are signed, you can verify the signature with this [public GPG key](https://packages.grafana.com/gpg.key).
## Start the server (init.d service)
1. On the [Grafana download page](https://grafana.com/grafana/download), select the Grafana version you want to install.
* The most recent Grafana version is selected by default.
* The **Version** field displays only finished releases. If you want to install a beta version, click **Nightly Builds** and then select a version.
2. Select an **Edition**.
* **Enterprise** - Recommended download. Functionally identical to the open source version, but includes features you can unlock with a license if you so choose.
* **Open Source** - Functionally identical to the enterprise version, but you will need to download the enterprise version if you want enterprise features.
3. Depending on which system you are running, click **Linux** or **ARM**.
4. Copy and paste the .rpm package URL and the local .rpm package information from the installation page into the pattern shown below, then run the commands.
You can start Grafana by running:
**On CentOS, Fedora, Red Hat, or RHEL:**
```bash
sudo service grafana-server start
sudo yum install initscripts urw-fonts wget
wget <rpm package url>
sudo rpm -Uvh <local rpm package>
```
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`.
**On OpenSUSE or SUSE:**
Default login and password `admin`/ `admin`
```bash
wget <rpm package url>
sudo rpm -i --nodeps <local rpm package>
```
## Install from binary .tar.gz file
To configure the Grafana server to start at boot time:
Download the latest [`.tar.gz` file](https://grafana.com/grafana/download?platform=linux) and extract it. The files extract into a folder named after the Grafana version that you downloaded. This folder contains all files required to run Grafana. There are no init scripts or install scripts in this package.
```bash
$ sudo /sbin/chkconfig --add grafana-server
wget <tar.gz package url>
sudo tar -zxvf <tar.gz package>
```
## Start the server (via systemd)
## 2. Start the server
This starts the `grafana-server` process as the `grafana` user, which was created during the package installation. The systemd commands work in most cases, but some older Linux systems might require init.d. The installer should prompt you with the correct commands.
If you installed with an `.rpm` package, then you can start the server using `systemd` or `init.d`. If you installed a binary `.tar.gz` file, then you need to execute the binary.
### Start the server with systemd
To start the service and verify that the service has started:
```bash
sudo systemctl daemon-reload
......@@ -127,71 +139,52 @@ sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
### Enable the systemd service to start at boot
Configure the Grafana server to start at boot:
```bash
sudo systemctl enable grafana-server.service
```
## Environment file
The systemd service file and init.d script both use the file located at
`/etc/sysconfig/grafana-server` for environment variables used when
starting the back-end. Here you can override log directory, data
directory and other variables.
### Logging
By default Grafana will log to `/var/log/grafana`
### Database
> **SUSE or OpenSUSE users:** You might need to start the server with the systemd method, then then use the init.d method to configure Grafana to start at boot.
The default configuration specifies a sqlite3 database located at
`/var/lib/grafana/grafana.db`. Please backup this database before
upgrades. You can also use MySQL or Postgres as the Grafana database, as detailed on [the configuration page]({{< relref "configuration.md#database" >}}).
### Start the server with init.d
## Configuration
To start the service and verify that the service has started:
The configuration file is located at `/etc/grafana/grafana.ini`. Go the
[Configuration]({{< relref "configuration.md" >}}) page for details on all
those options.
### Adding data sources
```bash
sudo service grafana-server start
sudo service grafana-server status
```
- [Graphite]({{< relref "../features/datasources/graphite.md" >}})
- [InfluxDB]({{< relref "../features/datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "../features/datasources/opentsdb.md" >}})
- [Prometheus]({{< relref "../features/datasources/prometheus.md" >}})
Configure the Grafana server to start at boot:
### Server side image rendering
```bash
sudo /sbin/chkconfig --add grafana-server
```
Server side image (png) rendering is a feature that is optional but very useful when sharing visualizations,
for example in alert notifications.
### Execute the binary
If the image is missing text make sure you have font packages installed.
The `grafana-server` binary needs the working directory to be the root install directory where the binary and the `public` folder are located.
Start Grafana by running:
```bash
sudo yum install fontconfig
sudo yum install freetype*
sudo yum install urw-fonts
./bin/grafana-server web
```
## Installing from binary tar file
## Package details
Download [the latest `.tar.gz` file](https://grafana.com/get) and
extract it. This will extract into a folder named after the version you
downloaded. This folder contains all files required to run Grafana. There are
no init scripts or install scripts in this package.
- Installs binary to `/usr/sbin/grafana-server`
- Copies init.d script to `/etc/init.d/grafana-server`
- Installs default file (environment vars) to `/etc/sysconfig/grafana-server`
- Copies configuration file to `/etc/grafana/grafana.ini`
- Installs systemd service (if systemd is available) name `grafana-server.service`
- The default configuration uses a log file at `/var/log/grafana/grafana.log`
- The default configuration specifies an sqlite3 database at `/var/lib/grafana/grafana.db`
To configure Grafana add a configuration file named `custom.ini` to the
`conf` folder and override any of the settings defined in
`conf/defaults.ini`.
## Next steps
Start Grafana by executing `./bin/grafana-server web`. The `grafana-server`
binary needs the working directory to be the root install directory (where the
binary and the `public` folder is located).
Refer to the [Getting Started]({{< relref "../guides/getting_started/" >}}) guide for information about logging in, setting up data sources, and so on.
## Logging in for the first time
## Configure Grafana
To run Grafana open your browser and go to http://localhost:3000/. 3000 is the default HTTP port that Grafana listens to if you haven't [configured a different port]({{< relref "configuration/#http-port" >}}).
Then follow the instructions [here]({{< relref "../guides/getting_started/" >}}).
Refer the [Configuration]({{< relref "configuration.md" >}}) page for details on options for customizing your environment, logging, database, and so on.
......@@ -56,6 +56,18 @@ export GF_DIAGNOSTICS_PROFILING_PORT=8080
Refer to [Go command pprof](https://golang.org/cmd/pprof/) for more information about how to collect and analyze profiling data.
### Server side image rendering (RPM-based Linux)
Server side image (png) rendering is a feature that is optional but very useful when sharing visualizations, for example in alert notifications.
If the image is missing text make sure you have font packages installed.
```bash
sudo yum install fontconfig
sudo yum install freetype*
sudo yum install urw-fonts
```
### Tracing
The `grafana-server` can be started with the arguments `-tracing` to enable tracing and `-tracing-file` to override the default trace file (`trace.out`) where trace result is written to. For example:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment