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>
This commit is contained in:
Diana Payton 2020-01-13 14:46:32 -08:00 committed by GitHub
parent bcac76f5d4
commit 962d0f6a0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 137 additions and 132 deletions

View File

@ -1,58 +1,61 @@
+++ +++
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
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.
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>
```
You can also install Grafana using YUM directly:
```bash ```bash
sudo yum install <rpm package url> sudo yum install <rpm package url>
``` ```
You will find package URLs on the [download page](https://grafana.com/grafana/download?platform=linux). ### Install from YUM repository
Or install manually using `rpm`. First execute If you install from the YUM repository, then Grafana is automatically updated every time you run `sudo yum update`.
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 ```bash
wget <rpm package url> sudo nano /etc/yum.repos.d/grafana.repo
``` ```
2. Enter the following information in grafana.repo and then save it.
### On CentOS / Fedora / Redhat: For stable releases:
```bash
sudo yum install initscripts urw-fonts
sudo rpm -Uvh <local rpm package>
```
### On OpenSuse:
```bash
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`
```bash ```bash
[grafana] [grafana]
name=grafana name=grafana
@ -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,16 +79,97 @@ 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.
**Note:** The .rpm files are signed, you can verify the signature with this [public GPG key](https://packages.grafana.com/gpg.key).
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.
**On CentOS, Fedora, Red Hat, or RHEL:**
```bash
sudo yum install initscripts urw-fonts wget
wget <rpm package url>
sudo rpm -Uvh <local rpm package>
```
**On OpenSUSE or SUSE:**
```bash
wget <rpm package url>
sudo rpm -i --nodeps <local rpm package>
```
## Install from binary .tar.gz file
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
wget <tar.gz package url>
sudo tar -zxvf <tar.gz package>
```
## 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
sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
Configure the Grafana server to start at boot:
```bash
sudo systemctl enable grafana-server.service
```
> **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.
### Start the server with init.d
To start the service and verify that the service has started:
```bash
sudo service grafana-server start
sudo service grafana-server status
```
Configure the Grafana server to start at boot:
```bash
sudo /sbin/chkconfig --add grafana-server
```
### Execute the binary
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
./bin/grafana-server web
```
## Package details ## Package details
@ -99,99 +181,10 @@ The RPMs are signed, you can verify the signature with this [public GPG key](htt
- The default configuration uses a log file at `/var/log/grafana/grafana.log` - 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` - The default configuration specifies an sqlite3 database at `/var/lib/grafana/grafana.db`
## Start the server (init.d service) ## Next steps
You can start Grafana by running: Refer to the [Getting Started]({{< relref "../guides/getting_started/" >}}) guide for information about logging in, setting up data sources, and so on.
```bash ## Configure Grafana
sudo service grafana-server start
```
This will start the `grafana-server` process as the `grafana` user, Refer the [Configuration]({{< relref "configuration.md" >}}) page for details on options for customizing your environment, logging, database, and so on.
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`
To configure the Grafana server to start at boot time:
```bash
$ sudo /sbin/chkconfig --add grafana-server
```
## Start the server (via systemd)
```bash
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
```
### Enable the systemd service 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
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" >}}).
## Configuration
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
- [Graphite]({{< relref "../features/datasources/graphite.md" >}})
- [InfluxDB]({{< relref "../features/datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "../features/datasources/opentsdb.md" >}})
- [Prometheus]({{< relref "../features/datasources/prometheus.md" >}})
### Server side image rendering
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
```
## Installing from binary tar file
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.
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`.
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).
## Logging in for the first time
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/" >}}).

View File

@ -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: