From a4ef1e22d6f73fb066b2eac763243e4f996f4f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 13 Apr 2015 07:55:07 +0200 Subject: [PATCH] Updated docs --- docs/mkdocs.yml | 2 +- docs/sources/installation/debian.md | 13 ++++- docs/sources/installation/docker.md | 25 +++++++++ docs/sources/installation/index.md | 80 ++++------------------------- docs/sources/installation/rpm.md | 66 ++++++++++++++++++++++++ packaging/deb/control/postinst | 2 +- 6 files changed, 114 insertions(+), 74 deletions(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 0da02314aae..2ff90577f07 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -29,8 +29,8 @@ pages: - ['installation/index.md', 'Installation', 'Installation'] - ['installation/debian.md', 'Installation', 'Installing on Debian / Ubuntu'] - ['installation/rpm.md', 'Installation', 'Installing on RPM-based Linux'] -- ['installation/windows.md', 'Installation', 'Installing on Windows'] - ['installation/mac.md', 'Installation', 'Installing on Mac OS X'] +- ['installation/windows.md', 'Installation', 'Installing on Windows'] - ['installation/docker.md', 'Installation', 'Installing on Docker'] - ['installation/configuration.md', 'Installation', 'Configuration'] diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md index 628f72f24a8..d1a4745dc12 100644 --- a/docs/sources/installation/debian.md +++ b/docs/sources/installation/debian.md @@ -49,7 +49,7 @@ variables. ### Logging -By default grafana will log to /var/log/grafana +By default grafana will log to ``/var/log/grafana` ## Configuration @@ -62,3 +62,14 @@ on all those options. - [InfluxDB](../datasources/influxdb.md) - [OpenTSDB](../datasources/opentsdb.md) +## Installing from binary tar file + +Start by [downloading](http://grafana.org/download/builds) the latest `.tar.gz` file 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 config file named `custom.ini` to the `conf` folder and override any of the settings defined in +`conf/defaults.ini`. Start grafana by excecuting `./grafana web`. The grafana binary needs the working directory +to be the root install dir (where the binary is and the public folder is located). + + diff --git a/docs/sources/installation/docker.md b/docs/sources/installation/docker.md index 9773d93e9f5..0b94544ecf9 100644 --- a/docs/sources/installation/docker.md +++ b/docs/sources/installation/docker.md @@ -6,4 +6,29 @@ page_keywords: grafana, installation, docker, container, guide # Installing using Docker +## Install from offical docker image + +Grafana has an offical docker container. + + $ docker run -i -p 3000:3000 grafana/grafana + +All grafana configuration settings can be defined using ENVIRONMENT variables, this is especially useful when using the +above container. + +## Docker volumes & ENV config + +The docker container exposes two volumes, the sqlite3 database in the folder `/opt/grafana/data` and +configuration files in the `/opt/grafana/conf` folder. You can map these volumes to host folders when you start the container: + + $ docker run -d -p 3000:3000 \ + -v /var/grafana/data:/opt/grafana/data \ + -e "GF_SECURITY_ADMIN_PASSWORD=secret \ + grafana/grafana:develop + +In the above example I map the data folder and set a config option via an `ENV` variable. + +## Configuration + +The backend web server has a number of configuration options. Go the [Configuration](configuration) page for details +on all those options. diff --git a/docs/sources/installation/index.md b/docs/sources/installation/index.md index ed250a0a530..f54de988a9b 100644 --- a/docs/sources/installation/index.md +++ b/docs/sources/installation/index.md @@ -5,62 +5,19 @@ page_keywords: grafana, installation, documentation --- # Installation + Grafana is easily installed via a Debian/Ubuntu package (.deb), via Redhat/Centos package (.rpm) or manually via a tar that contains all required files and binaries. If you can't find a package or binary for your platform you might be able to build one your self, read [build from source](../project/building_from_source) instructions for more information. -## Ubuntu & Debian -Start by [downloading](http://grafana.org/download) the latest `.deb` package. +- [Installing on Debian / Ubuntu](debian.md) +- [Installing on RPM-based Linux (CentOS, Fedora, OpenSuse, RedHat)](rpm.md) +- [Installing on Mac OS X](mac.md) +- [Installing on Windows](windows.md) +- [Installing on Docker](docker.md) -To install the package - $ sudo apt-get install -y adduser libfontconfig - $ sudo dpkg -i grafana_latest_amd64.deb - -## Redhat & Centos -Start by [downloading](http://grafana.org/download) the latest `.rpm` package. - - $ sudo yum install initscripts fontconfig - $ sudo rpm -Uvh grafana-latest-1.x86_64.rpm - -On Redhat/RHEL 5.10 you need to add the grafana user before executing the above. -Execute this to add a grafana user: - - sudo useradd -r grafana - -### Package details -The `.deb` and the `rpm` package install will do the following - -- Install binary to `/usr/sbin/grafana-server` -- Init.d script to `/etc/init.d/grafana-server` -- Default file (environment vars) to `/etc/default/grafana-server` (deb package) or `/etc/sysconfig/grafana-server` (for the rpm package) -- Configuration file to `/etc/grafana/grafana.ini` -- Systemd service (if systemd is available) name `grafana-server.service` -- The default configuration specifies log file at `/var/log/grafana/grafana.log` -- The default configuration specifies sqlite3 db at `/var/lib/grafana/grafana.db` - -### Start the server (init.d service) - -- Start grafana by `sudo service grafana-server start` -- This will start the grafana-server process as the `grafana` user (created during package install) -- Default http port is `3000`, and default user is admin/admin - -### Start the server (via systemd) - - $ systemctl daemon-reload - $ systemctl start grafana-server - $ systemctl status grafana-server - -## Manual install from binary tar file -Start by [downloading](http://grafana.org/download/builds) the latest `.tar.gz` file 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 config file named `custom.ini` to the `conf` folder and override any of the settings defined in -`conf/defaults.ini`. Start grafana by excecuting `./grafana web`. The grafana binary needs the working directory -to be the root install dir (where the binary is and the public folder is located). - -## Dependencies +# Dependencies There are no dependencies with the default configuration. You can switch from a sqlite3 database to mysql or postgres but that is optional. For small to medium setups sqlite3 should suffice. @@ -68,29 +25,10 @@ that is optional. For small to medium setups sqlite3 should suffice. If you prefer to install grafana via Puppet, Ansible, Docker or Chef. [This page](provisioning) has compiled a list of repositories for different provisioning systems -## Install from offical docker image - -Grafana has an offical docker container. - - $ docker run -i -p 3000:3000 grafana/grafana - -All grafana configuration settings can be defined using ENVIRONMENT variables, this is especially useful when using the -above container. - -### Docker volumes & ENV config - -The docker container exposes two volumes, the sqlite3 database in the folder `/opt/grafana/data` and -configuration files in the `/opt/grafana/conf` folder. You can map these volumes to host folders when you start the container: - - $ docker run -d -p 3000:3000 \ - -v /var/grafana/data:/opt/grafana/data \ - -e "GF_SECURITY_ADMIN_PASSWORD=secret \ - grafana/grafana:develop - -In the above example I map the data folder and set a config option via an `ENV` variable. - ## Configuration The backend web server has a number of configuration options. Go the [Configuration](configuration) page for details on all those options. + + diff --git a/docs/sources/installation/rpm.md b/docs/sources/installation/rpm.md index e69de29bb2d..f169bc01b73 100644 --- a/docs/sources/installation/rpm.md +++ b/docs/sources/installation/rpm.md @@ -0,0 +1,66 @@ +--- +page_title: Installing on RPM-based Linux +page_description: Grafana Installation guide for Centos, Fedora, Redhat. +page_keywords: grafana, installation, centos, fedora, opensuse, redhat, guide +--- + +# Installing on RPM-based Linux (CentOS, Fedora, OpenSuse, RedHat) + +## Download + +Description | Download +------------ | ------------- +.RPM for Fedora / RHEL / CentOS Linux | [grafana-2.0.0_beta3-1.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-2.0.0_beta3-1.x86_64.rpm) + +## Install +To install the package + + $ wget https://grafanarel.s3.amazonaws.com/builds/grafana-2.0.0_beta3-1.x86_64.rpm + $ sudo yum install initscripts fontconfig + $ sudo rpm -Uvh grafana-latest-1.x86_64.rpm + +## Package details + +- Installs binary to `/usr/sbin/grafana-server` +- Init.d script to `/etc/init.d/grafana-server` +- Default file (environment vars) to `/etc/sysconfig/grafana-server` +- Configuration file to `/etc/grafana/grafana.ini` +- Systemd service (if systemd is available) name `grafana-server.service` +- The default configuration specifies log file at `/var/log/grafana/grafana.log` +- The default configuration specifies sqlite3 db at `/var/lib/grafana/grafana.db` + +## Start the server (init.d service) + +- Start grafana by `sudo service grafana-server start` +- This will start the grafana-server process as the `grafana` user (created during package install) +- Default http port is `3000`, and default user is admin/admin +- To configure grafana server to start at boot time: `sudo ` + +## Start the server (via systemd) + + $ systemctl daemon-reload + $ systemctl start grafana-server + $ systemctl status grafana-server + +## 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 backend. Here you can override log directory, data directory and other +variables. + +### Logging + +By default grafana will log to /var/log/grafana + +## Configuration + +The configuration file is located at `/etc/grafana/grafana.ini`. Go the [Configuration](configuration) page for details +on all those options. + +### Adding data sources + +- [Graphite](../datasources/graphite.md) +- [InfluxDB](../datasources/influxdb.md) +- [OpenTSDB](../datasources/opentsdb.md) + + diff --git a/packaging/deb/control/postinst b/packaging/deb/control/postinst index f0d25c4345f..edb163ba7fb 100755 --- a/packaging/deb/control/postinst +++ b/packaging/deb/control/postinst @@ -54,7 +54,7 @@ case "$1" in # this is a fresh installation elif [ -z $2 ] ; then if [ -x /bin/systemctl ] ; then - echo "### NOT starting on installation, please execute the following statements to configure elasticsearch to start automatically using systemd" + echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd" echo " sudo /bin/systemctl daemon-reload" echo " sudo /bin/systemctl enable grafana-server.service" echo "### You can start grafana-server by executing"