chapter 7 :grafana¶
7.1 Basic install¶
7.1.1 influxdb+grafana¶
https://gist.github.com/ashrithr/9224450
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh epel-release-6*.rpm
yum install pycairo Django14 python-ldap python-memcached python-sqlite2 bitmap bitmap-fonts-compat \
python-devel python-crypto pyOpenSSL gcc python-zope-filesystem python-zope-interface git gcc-c++ \
zlib-static MySQL-python python-txamqp python-setuptools python-psycopg2 mod_wsgi
. *instal grafana with rpm http://docs.grafana.org/installation/rpm/
Install from package file
You can install Grafana using Yum directly.
$ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.1.3-1.x86_64.rpm
Or install manually using rpm.
$ sudo yum install initscripts fontconfig $ sudo rpm -Uvh grafana-2.1.3-1.x86_64.rpm
Install via YUM Repository
Add the following to a new file at /etc/yum.repos.d/grafana.repo
[grafana] name=grafana baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch repo_gpgcheck=1 enabled=1 gpgcheck=1 gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt
There is also a testing repository if you want beta or release candidates.
baseurl=https://packagecloud.io/grafana/testing/el/6/$basearch
Then install Grafana via the yum command.
$ sudo yum install grafana
RPM GPG Key
The RPMs are signed, you can verify the signature with this public GPG key. 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
Start the server (init.d service)
You can start Grafana by running:
$ sudo service grafana-server start
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.
To configure the Grafana server to start at boot time:
$ sudo /sbin/chkconfig –add grafana-server
Start the server (via systemd)
$ systemctl daemon-reload $ systemctl start grafana-server $ systemctl status grafana-server
Enable the systemd service to start at boot
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. Configuration
The configuration file is located at /etc/grafana/grafana.ini. Go the Configuration page for details on all those options. Adding data sources
Graphite InfluxDB OpenTSDB
- install InfluxDB
wget http://get.influxdb.org.s3.amazonaws.com/influxdb-0.8.9-1.x86_64.rpm wget http://influxdb.s3.amazonaws.com/influxdb-0.9.2-1.x86_64.rpm
sudo yum localinstall influxdb-0.8.9-1.x86_64.rpm
sudo /etc/init.d/influxdb start
7.2 logstash forwarder¶
logstash forwarder + logstash + elasticsearch+ kibana
logstash forwarder + logstash +graphite +grafana
graphite = Carbon cache+whisper+graphite web
stagemonitor + graphite+grafana
7.2.2 logstach forwarder¶
git clone git://github.com/elasticsearch/logstash-forwarder.git
cd logstash-forwarder
go build -o logstash-forwarder
. *centos go language setup in epel
yum install golang
. Packaging it (optional)
gem install bundler
bundle install
. * gem
yum install ruby
yum install rubygems
. * install ruby 1.9.3 http://tecadmin.net/install-ruby-1-9-3-or-multiple-ruby-verson-on-centos-6-3-using-rvm/
yum install rpm-build
make rpm
.
7.2.3 logstach forwarder¶
test
7.2.4 sta¶
test
7.3 ELK¶
7.3.1 ELK on CentOS7¶
centos 6 https://gist.github.com/ashrithr/c5c03950ef631ac63c43