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" title = "Install on RPM-based Linux"
description = "Grafana Installation guide for Centos, Fedora, OpenSuse, Redhat." description = "Grafana Installation guide for RPM-based Linux, such as Centos, Fedora, OpenSuse, and Red Hat."
keywords = ["grafana", "installation", "documentation", "centos", "fedora", "opensuse", "redhat"] keywords = ["grafana", "installation", "documentation", "centos", "fedora", "opensuse", "redhat"]
aliases = ["/docs/grafana/latest/installation/installation/rpm"] aliases = ["/docs/grafana/latest/installation/installation/rpm"]
type = "docs" type = "docs"
[menu.docs] [menu.docs]
name = "Installing on Centos / Redhat" name = "Install on RPM-based Linux"
identifier = "rpm" identifier = "rpm"
parent = "installation" parent = "installation"
weight = 300 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 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.
installation.
## 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 ## 1. Download and install
links.
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 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.
sudo yum install <rpm package url>
```
You will find package URLs on the [download page](https://grafana.com/grafana/download?platform=linux).
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 ```bash
wget <rpm package url> wget <rpm package url>
sudo yum localinstall <local rpm package>
``` ```
You can also install Grafana using YUM directly:
### On CentOS / Fedora / Redhat:
```bash ```bash
sudo yum install initscripts urw-fonts sudo yum install <rpm package url>
sudo rpm -Uvh <local rpm package>
``` ```
### On OpenSuse: ### Install from YUM repository
```bash If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo yum update`.
sudo rpm -i --nodeps <local rpm package>
```
## Install via YUM Repository
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 ```bash
[grafana] [grafana]
name=grafana name=grafana
...@@ -64,9 +67,7 @@ gpgkey=https://packages.grafana.com/gpg.key ...@@ -64,9 +67,7 @@ gpgkey=https://packages.grafana.com/gpg.key
sslverify=1 sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt sslcacert=/etc/pki/tls/certs/ca-bundle.crt
``` ```
For beta releases:
There is a separate repository if you want beta releases.
```bash ```bash
[grafana] [grafana]
name=grafana name=grafana
...@@ -78,48 +79,59 @@ gpgkey=https://packages.grafana.com/gpg.key ...@@ -78,48 +79,59 @@ gpgkey=https://packages.grafana.com/gpg.key
sslverify=1 sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt sslcacert=/etc/pki/tls/certs/ca-bundle.crt
``` ```
3. Install Grafana.
Then install Grafana via the `yum` command.
```bash ```bash
sudo yum install grafana 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 **Note:** The .rpm files are signed, you can verify the signature with this [public GPG key](https://packages.grafana.com/gpg.key).
- 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`
## 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 ```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, **On OpenSUSE or SUSE:**
which is created during package installation. The default HTTP port is
`3000`, and default user and group is `admin`.
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 ```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 ```bash
sudo systemctl daemon-reload sudo systemctl daemon-reload
...@@ -127,71 +139,52 @@ sudo systemctl start grafana-server ...@@ -127,71 +139,52 @@ sudo systemctl start grafana-server
sudo systemctl status grafana-server sudo systemctl status grafana-server
``` ```
### Enable the systemd service to start at boot Configure the Grafana server to start at boot:
```bash ```bash
sudo systemctl enable grafana-server.service sudo systemctl enable grafana-server.service
``` ```
## Environment file > **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 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
The default configuration specifies a sqlite3 database located at ### Start the server with init.d
`/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" >}}).
## Configuration To start the service and verify that the service has started:
The configuration file is located at `/etc/grafana/grafana.ini`. Go the ```bash
[Configuration]({{< relref "configuration.md" >}}) page for details on all sudo service grafana-server start
those options. sudo service grafana-server status
```
### Adding data sources
- [Graphite]({{< relref "../features/datasources/graphite.md" >}}) Configure the Grafana server to start at boot:
- [InfluxDB]({{< relref "../features/datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "../features/datasources/opentsdb.md" >}})
- [Prometheus]({{< relref "../features/datasources/prometheus.md" >}})
### 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, ### Execute the binary
for example in alert notifications.
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 ```bash
sudo yum install fontconfig ./bin/grafana-server web
sudo yum install freetype*
sudo yum install urw-fonts
``` ```
## Installing from binary tar file ## Package details
Download [the latest `.tar.gz` file](https://grafana.com/get) and - Installs binary to `/usr/sbin/grafana-server`
extract it. This will extract into a folder named after the version you - Copies init.d script to `/etc/init.d/grafana-server`
downloaded. This folder contains all files required to run Grafana. There are - Installs default file (environment vars) to `/etc/sysconfig/grafana-server`
no init scripts or install scripts in this package. - 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 ## Next steps
`conf` folder and override any of the settings defined in
`conf/defaults.ini`.
Start Grafana by executing `./bin/grafana-server web`. The `grafana-server` Refer to the [Getting Started]({{< relref "../guides/getting_started/" >}}) guide for information about logging in, setting up data sources, and so on.
binary needs the working directory to be the root install directory (where the
binary and the `public` folder is located).
## 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" >}}). Refer the [Configuration]({{< relref "configuration.md" >}}) page for details on options for customizing your environment, logging, database, and so on.
Then follow the instructions [here]({{< relref "../guides/getting_started/" >}}).
...@@ -56,6 +56,18 @@ export GF_DIAGNOSTICS_PROFILING_PORT=8080 ...@@ -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. 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 ### 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: 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