In the above example you see two InfluxDB datasources, one for metrics and a seperate used for dashboard storage. You can use the same InfluxDB
sudo dpkg -i grafana_latest_amd64.deb
database for both. But it is probably a good idea to keep them seperate. The InfluxDB databases need to exist, grafana does not create
them.
### Graphite & Elasticsearch setup example
```javascript
datasources:{
graphite:{
type:'graphite',
url:"http://my.graphite.server.com:8080",
},
elasticsearch:{
type:'elasticsearch',
url:"http://my.elastic.server.com:9200",
index:'grafana-dash',
grafanaDB:true,
}
},
```
```
If you use Graphite you need Elasticsearch if you want to store & search dashboards. You can also use json and scripted dashboards if
you really do not want to setup Elasticsearch.
### OpenTSDB & Elasticsearch setup example
```javascript
datasources:{
opentsdb:{
type:'opentsdb',
url:"http://my.opentsdb.server.com:4242",
},
elasticsearch:{
type:'elasticsearch',
url:"http://my.elastic.server.com:9200",
index:'grafana-dash',
grafanaDB:true,
}
},
```
Please view [this page](/docs/features/opentsdb) for details on how to configure OpenTSDB to work with Grafana.
### Elasticsearch & CORS
## From Redhat & Centos package
As of Elasticsearch v1.4 CORS is disabled by default. This needs to be enabled in the Elasticsearch config file, otherwise grafana will not be able to access Elasticsearch.
Start by [downloading](http://grafana.org/download/builds) the latest `.rpm` package.
```
```
http.cors.enabled: true
sudo rpm -Uvh grafana-latest-1.x86_64.rpm
http.cors.allow-origin: *
```
```
Instead of the wildcard you can put your full grafana webserver address (including http:// and port)
On Redhat/RHEL 5.10 you need to add the grafana user before executing the above.
Execute this to add a grafana user:
### Basic authentication
If your Graphite or Elasticsearch server require basic authentication you can specify the username and password in the url.
For example `"http://admin:secret@my.graphite.com"`
## Global configuration options
```javascript
// specify the limit for dashboard search results
search:{
max_results:20
},
// default start dashboard
default_route:'/dashboard/file/default.json',
// set to false to disable unsaved changes warning
```
unsaved_changes_warning:true,
sudo useradd -r grafana
// set the default timespan for the playlist feature
```
// Example: "1m", "1h"
playlist_timespan:"1m",
// If you want to specify password before saving, please specify it bellow
### Package details
// The purpose of this password is not security, but to stop some users from accidentally changing dashboards
The `.deb` and the `rpm` package install will do the following
admin:{
password:''
},
// Add your own custom pannels
- Install binaries and frontend files under `/opt/grafana/versions/<version>`
plugins:{
- Symlink dir `/opt/grafana/current` to `/opt/grafana/versions/<version>`
panels:[]
- Symlink `/etc/init.d/grafana` to `/opt/grafana/current/scripts/init.sh`
}
- Add config file to `/etc/grafana/grafana.ini` , this is where you specify your config settings
```
- Default configuration is in `/opt/grafana/current/conf/defaults.ini`, do not modify that file
- The default configuration specifies log file at `/var/log/grafana/grafana.log`
- The default configuration specifies sqlite3 db at `/opt/grafana/data/grafana.db`
## Graphite server config
### Start the backend & web server
If you haven't used an alternative dashboard for graphite before you need to enable CORS (Cross Origin Resource Sharing).
This is only required if Grafana is hosted on a different web domain from your graphite-web.
For Apache 2.x:
- Start grafana by `sudo service grafana start`
- This will start the grafana process as the `grafana` user (created during package install)
- Default http port is `3000`, and default user is admin/admin
```javascript
## Manual install from tar file
HeadersetAccess-Control-Allow-Origin"*"
Start by [downloading](http://grafana.org/download/builds) the latest `.tar.gz` file and extract it.