{"id":11030,"date":"2021-10-15T10:56:07","date_gmt":"2021-10-15T10:56:07","guid":{"rendered":"https:\/\/linuxways.net\/?p=11030"},"modified":"2021-10-15T10:56:07","modified_gmt":"2021-10-15T10:56:07","slug":"how-to-install-grafana-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/red-hat\/how-to-install-grafana-on-rocky-linux-8\/","title":{"rendered":"How to Install Grafana on Rocky Linux 8"},"content":{"rendered":"<p>Written in Go and Typescript, <a href=\"https:\/\/grafana.com\/\">Grafana<\/a> is an opensource monitoring &amp; alerting tool that is widely used by companies for monitoring, data visualization, and analytics . It provides highly customizable and feature-rich dashboards which can be configured to visualize data from a wide range of data sources. Grafana can be integrated with popular tools such as InfluxDB, Graphite and Prometheus to enhance monitoring and visualization of metrics.<\/p>\n<p>In this instructional guide, we will walk you through installing Grafana on Rocky Linux.<\/p>\n<h2><strong>Step 1: Add Grafana repository on Rocky Linux<\/strong><\/h2>\n<p>To get started, we will add the Grafana repository on our local system to take advantage of updates as they are rolled out. Therefore, create a repository file as shown.<\/p>\n<pre><strong>$ sudo vim \/etc\/yum.repos.d\/grafana.repo<\/strong><\/pre>\n<p>Next, paste the entire code provided below on the file and save the changes.<\/p>\n<pre><strong>[grafana]<\/strong>\r\n\r\n<strong>name=grafana<\/strong>\r\n\r\n<strong>baseurl=https:\/\/packages.grafana.com\/oss\/rpm<\/strong>\r\n\r\n<strong>repo_gpgcheck=1<\/strong>\r\n\r\n<strong>enabled=1<\/strong>\r\n\r\n<strong>gpgcheck=1<\/strong>\r\n\r\n<strong>gpgkey=https:\/\/packages.grafana.com\/gpg.key<\/strong>\r\n\r\n<strong>sslverify=1<\/strong>\r\n\r\n<strong>sslcacert=\/etc\/pki\/tls\/certs\/ca-bundle.crt<\/strong><\/pre>\n<p>Next, update your Rocky Linux repositories to sync with the newly added Grafana repository.<\/p>\n<pre><strong>$ sudo dnf update<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"409\" class=\"wp-image-11031\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-185.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-185.png 902w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-185-300x136.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-185-768x348.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/strong><\/p>\n<p>Along the way, you will be prompted to import the GPG key. Simply type \u2018y\u2019 and hit ENTER to proceed with importing the key.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"244\" class=\"wp-image-11032\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-186.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-186.png 896w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-186-300x82.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-186-768x209.png 768w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/strong><\/p>\n<h2><strong>Step 2: Install Grafana on Rocky Linux<\/strong><\/h2>\n<p>Once the Grafana repository is added, the only thing remaining is to use the DNF package manager to install Grafana. Therefore, invoke the command:<\/p>\n<pre><strong>$ sudo dnf install grafana<\/strong><\/pre>\n<p>The command installs Grafana alongside a host of other dependencies.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"313\" class=\"wp-image-11033\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-187.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-187.png 902w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-187-300x104.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-187-768x267.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/strong><\/p>\n<p>You can probe the details of the version of Grafana installed using the command provided<\/p>\n<pre><strong>$ rpm -qi<\/strong><\/pre>\n<p>This prints out details of Grafana such as the name, version, release number and installation date to mention just a few of the details.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"704\" height=\"331\" class=\"wp-image-11034\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-188.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-188.png 704w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-188-300x141.png 300w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/strong><\/p>\n<h2><strong>Step 3: Start and Enable Grafana<\/strong><\/h2>\n<p>The Grafana service is, by default, inactive upon installation. We need to get it up and running using the command:<\/p>\n<pre><strong>$ sudo systemctl start grafana-server<\/strong><\/pre>\n<p>To enable Grafana server so that it comes on automatically on boot or upon a reboot, invoke the command:<\/p>\n<pre><strong>$ sudo systemctl enable grafana-server<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"184\" class=\"wp-image-11035\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-189.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-189.png 896w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-189-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-189-768x158.png 768w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/strong><\/p>\n<p>Just to be sure that Grafana is running, execute the command:<\/p>\n<pre><strong>$ sudo systemctl status grafana-server<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"829\" height=\"155\" class=\"wp-image-11036\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-190.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-190.png 829w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-190-300x56.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-190-768x144.png 768w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/strong><\/p>\n<h2><strong>Step 4: Configure Firewall<\/strong><\/h2>\n<p>To access the Grafana GUI monitoring dashboard, we need to go an extra step and allow port 3000 on the firewall. This is the port that Grafana listens on by default. You can use the netstat command to verify this as shown.<\/p>\n<pre><strong>$ sudo netstat -pnltu<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"861\" height=\"169\" class=\"wp-image-11037\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-191.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-191.png 861w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-191-300x59.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-191-768x151.png 768w\" sizes=\"auto, (max-width: 861px) 100vw, 861px\" \/><\/strong><\/p>\n<p>Therefore, run the following commands to allow the port across the firewall.<\/p>\n<pre><strong>$ sudo firewall-cmd --add-port=3000\/tcp --permanent<\/strong><\/pre>\n<pre><strong>$ sudo firewall-cmd --reload<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"377\" class=\"wp-image-11038\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-192.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-192.png 744w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-192-300x152.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/strong><\/p>\n<p>To verify that the port has been allowed on the firewall, run the command:<\/p>\n<pre><strong>$ sudo firewall-cmd --list-all | grep ports<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"646\" height=\"138\" class=\"wp-image-11039\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-193.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-193.png 646w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-193-300x64.png 300w\" sizes=\"auto, (max-width: 646px) 100vw, 646px\" \/><\/strong><\/p>\n<h2><strong>Step 5: Access Grafana dashboard<\/strong><\/h2>\n<p>After all is said and done, the final task is to login to the Grafana dashboard. So launch your browser and browser the URL:<\/p>\n<pre><strong>http:\/\/server-ip:3000<\/strong><\/pre>\n<p>You will be redirected to the Grafana login page shown. The default credentials are<\/p>\n<p>Email \/ Username: <strong>Admin<\/strong><\/p>\n<p>Password: <strong>Admin<\/strong><\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1309\" height=\"649\" class=\"wp-image-11040\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-194.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-194.png 1309w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-194-300x149.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-194-1024x508.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-194-768x381.png 768w\" sizes=\"auto, (max-width: 1309px) 100vw, 1309px\" \/><\/strong><\/p>\n<p>For security purposes, you will be required to reset the password and provide a stronger password to prevent possible breaches.<\/p>\n<p>Finally, you will be ushered to the Grafana dashboard as shown.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1307\" height=\"696\" class=\"wp-image-11041\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-195.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-195.png 1307w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-195-300x160.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-195-1024x545.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-195-768x409.png 768w\" sizes=\"auto, (max-width: 1307px) 100vw, 1307px\" \/><\/strong><\/p>\n<p>From here, you can add data sources from a myriad of environments and start monitoring your applications. It\u2019s our sincere hope that you can now install Grafana on Rocky Linux 8.<\/p>","protected":false},"excerpt":{"rendered":"<p>Written in Go and Typescript, Grafana is an opensource monitoring &amp; alerting tool that is widely used by companies for monitoring, data visualization, and analytics . It provides&hellip;<\/p>","protected":false},"author":1,"featured_media":11199,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165],"tags":[420,436],"class_list":["post-11030","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-red-hat","tag-grafana","tag-rocky-linux-8"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=11030"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11030\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11199"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=11030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=11030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=11030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}