NigelsPowerDevopGrafana625Fixup

Nigels fixup of the powerDevops compiled version of Grafana 6.2.5

Get the Grafana for RHEL file - there is a different file for Ubuntu

  • mkdir temp
    cd temp
    wget https://dl.power-devops.com/grafana-6.2.5.rhel7-ppc64le.tar.gz
    

AS ROOT in a tempory directory

  1. Partly instructions from https://www.power-devops.com/blog
  2. Remove the complexity of a separate VG and non-standard Grafana directories
    • lets to bog-standard before the fancy stuff
  3. Remove prompts so its easier to run as a script (not recommended) or cut'n'paste

Get the code and some extra bits we need

  • wget https://dl.power-devops.com/grafana-6.2.5.rhel7-ppc64le.tar.gz
    
    curl -o /etc/sysconfig/grafana-server https://raw.githubusercontent.com/grafana/grafana/master/packaging/rpm/sysconfig/grafana-server
    
    curl -o /etc/systemd/system/grafana-server.service https://raw.githubusercontent.com/grafana/grafana/master/packaging/rpm/systemd/grafana-server.service
    
    export TOP=/usr/share/grafana
    mkdir $TOP
    
    cp $TOP/bin/grafana-server /usr/sbin
    cp $TOP/bin/grafana-cli    /usr/sbin
    

Add a separate user for grafana:

  • useradd -c 'grafana user' -d $TOP -M -s /sbin/nologin -U -r grafana
    

Now unpack grafana tarball and make initial configuration:

  • Uses a fancy way to remove the top level directory from the tar files
  • cd $TOP
    tar --strip-components=1 -xzf grafana-6.2.5.rhel7-ppc64le.tar.gz
    

Set up some files and file permssions

  • mkdir /var/log/grafana /etc/grafana /etc/grafana/provisioning /var/lib/grafana
    
    chown grafana:grafana /var/log/grafana /var/lib/grafana
    cp $TOP/conf/sample.ini /etc/grafana/grafana.ini
    cp $TOP/conf/ldap.toml /etc/grafana/ldap.toml
    
    mkdir /etc/grafana/provisioning/dashboards /etc/grafana/provisioning/datasources
    cp $TOP/conf/provisioning/dashboards/sample.yaml /etc/grafana/provisioning/dashboards/sample.yaml
    cp $TOP/conf/provisioning/datasources/sample.yaml /etc/grafana/provisioning/datasources/sample.yaml
    
    mkdir /etc/grafana/provisioning/notifiers
    cp $TOP/conf/provisioning/notifiers/sample.yaml /etc/grafana/provisioning/notifiers/sample.yaml
    
    chown -Rh root:grafana /etc/grafana/*
    chmod 755 /etc/grafana
    find /etc/grafana -type f -exec chmod 640 {} ';'
    find /etc/grafana -type d -exec chmod 755 {} ';'
    

And now we can configure and start grafana plus don't forget about firewall if you have it:

  • systemctl daemon-reload
    systemctl enable grafana-server
    
    systemctl start grafana-server
    systemctl status grafana-server
    
    ps -ef | grep grafana | grep -v grep
    
    firewall-cmd --add-port 3000/tcp
    firewall-cmd --add-port 3000/tcp --permanent
    

Now browse to: http://your.server.com:3000

  • and log in using admin password admin

Best of luck!