Installing Grafana on IBM Power Systems

Installing Grafana is more difficult than installing InfluxDB. We have no RPM package for ppc64le, so you have to do a lot of things manually.


As always first things first. The filesystem for grafana:


[root@myserver ~]# lvcreate -L1G -n grafana rhel

  Logical volume "grafana" created.

[root@myserver ~]# mkfs.xfs /dev/rhel/grafana

meta-data=/dev/rhel/grafana      isize=512    agcount=4, agsize=65536 blks

         =                       sectsz=512   attr=2, projid32bit=1

         =                       crc=1        finobt=0, sparse=0

data     =                       bsize=4096   blocks=262144, imaxpct=25

         =                       sunit=0      swidth=0 blks

naming   =version 2              bsize=4096   ascii-ci=0 ftype=1

log      =Internes Protokoll     bsize=4096   blocks=2560, version=2

         =                       sectsz=512   sunit=0 blks, lazy-count=1

realtime =keine                  extsz=4096   block

[root@myserver ~]# echo '/dev/mapper/rhel-grafana  /srv/grafana          xfs     defaults        0 1' >>/etc/fstab

[root@myserver ~]# mkdir /srv/grafana

[root@myserver ~]# mount /srv/grafana


Now download Grafana and some useful snippets:


[root@myserver ~]# curl -O https://dl.power-devops.com/grafana-6.2.5.rhel7-ppc64le.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 30.1M  100 30.1M    0     0   111k      0  0:04:36  0:04:36 --:--:-- 89968

[root@myserver ~]# curl -o /etc/sysconfig/grafana-server https://raw.githubusercontent.com/grafana/grafana/master/packaging/rpm/sysconfig/grafana-server

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   384  100   384    0     0   1230      0 --:--:-- --:--:-- --:--:—  1230

[root@myserver ~]# curl -o /etc/systemd/system/grafana-server.service https://raw.githubusercontent.com/grafana/grafana/master/packaging/rpm/systemd/grafana-server.service

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100  1150  100  1150    0     0   3402      0 --:--:-- --:--:-- --:--:—  3402


Update /etc/sysconfig/grafana-server with your settings:


GRAFANA_HOME=/srv/grafana

DATA_DIR=/srv/grafana/data

PLUGINS_DIR=/srv/grafana/plugins


Add a separate user for grafana:


[root@myserver ~]# useradd -c 'grafana user' -d /srv/grafana -M -s /sbin/nologin -U -r grafana


Now unpack grafana tarball and make initial configuration:


[root@myserver ~]# cd /srv/grafana

[root@myserver grafana]# tar --strip-components=1 -xzf grafana-6.2.5.rhel7-ppc64le.tar.gz

[root@myserver grafana]# mkdir /var/log/grafana /etc/grafana /etc/grafana/provisioning /srv/grafana/data /srv/grafana/plugins

[root@myserver grafana]# chown grafana:grafana /var/log/grafana /srv/grafana/data /srv/grafana/plugins

[root@myserver grafana]# cp /srv/grafana/conf/sample.ini /etc/grafana/grafana.ini

[root@myserver grafana]# cp /srv/grafana/conf/ldap.toml /etc/grafana/ldap.toml

[root@myserver grafana]# mkdir /etc/grafana/provisioning/dashboards /etc/grafana/provisioning/datasources

[root@myserver grafana]# cp /srv/grafana/conf/provisioning/dashboards/sample.yaml /etc/grafana/provisioning/dashboards/sample.yaml

[root@myserver grafana]# cp /srv/grafana/conf/provisioning/datasources/sample.yaml /etc/grafana/provisioning/datasources/sample.yaml

[root@myserver grafana]# mkdir /etc/grafana/provisioning/notifiers

[root@myserver grafana]# cp /srv/grafana/conf/provisioning/notifiers/sample.yaml /etc/grafana/provisioning/notifiers/sample.yaml

[root@myserver grafana]# chown -Rh root:grafana /etc/grafana/*

[root@myserver grafana]# chmod 755 /etc/grafana

[root@myserver grafana]# find /etc/grafana -type f -exec chmod 640 {} ';'

[root@myserver grafana]# find /etc/grafana -type d -exec chmod 755 {} ';'


Almost done. Now a small correction in /etc/systemd/system/grafana-server.service


WorkingDirectory=/srv/grafana

ExecStart=/srv/grafana/bin/grafana-server                                           \


Don't forget slash at the end!


And now we can start it.


[root@myserver ~]# systemctl daemon-reload

[root@myserver ~]# systemctl enable grafana-server

Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /etc/systemd/system/grafana-server.service.

[root@myserver ~]# systemctl start grafana-server

[root@myserver ~]# systemctl status grafana-server

● grafana-server.service - Grafana instance

   Loaded: loaded (/etc/systemd/system/grafana-server.service; enabled; vendor preset: disabled)

   Active: active (running) since Sa 2019-07-06 19:39:41 GMT; 57s ago

     Docs: http://docs.grafana.org

Main PID: 7528 (grafana-server)

   CGroup: /system.slice/grafana-server.service

           └─7528 /srv/grafana/bin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.p...


Don't forget about firewall if you have it:


[root@myserver ~]# firewall-cmd --add-port 3000/tcp

success

[root@myserver ~]# firewall-cmd --add-port 3000/tcp --permanent

success


Have fun!


#grafana #ppc64le

605 views5 comments
  • YouTube
  • Black Facebook Icon

©2019-2020 by Power-Devops.com