{"id":13295,"date":"2022-01-03T15:01:32","date_gmt":"2022-01-03T15:01:32","guid":{"rendered":"https:\/\/linuxways.net\/?p=13295"},"modified":"2022-01-03T15:01:32","modified_gmt":"2022-01-03T15:01:32","slug":"how-to-install-grafana-on-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-install-grafana-on-centos-8\/","title":{"rendered":"How to Install Grafana on CentOS 8"},"content":{"rendered":"<p>Grafana is an open-source and one of the most commonly used monitoring dashboards of 2019 that is used by PayPal, eBay, and Red Hat. Grafana is a good choice for all engineers who want to use a scalable and robust dashboard-monitoring tool. This monitoring tool monitors various data sources. Using Grafana, you can bind time-series databases like Prometheus or Influx DB and relational databases like PostgreSQL or MySQL.<\/p>\n<p>We will elaborate in this article on how to Grafana monitoring dashboard on CentOS 8.<\/p>\n<h2><strong>Prerequisites<\/strong><\/h2>\n<p>You are required to log in as a root user on your system for running all administrative commands.<\/p>\n<h2><strong>Installation of Grafana on CentOS 8 Linux distribution<\/strong><\/h2>\n<p>Grafana installation complete into the number of steps that are mentioned below:<\/p>\n<h3><strong>Step 1: Add Grafana Yum repository<\/strong><\/h3>\n<p>To install Grafana using the yum package manager, add the Grafana repository to the local yum repository. For this purpose, open the terminal using the \u2018Activities\u2019 sections and click on the terminal icon from the left sidebar of the CentOS 8 desktop. Now, create a new file \u2018grafana.repo\u2019 in the Yum repository and execute the following commands with administrative privileges on the terminal application:<\/p>\n<pre>$ cat &lt;&lt;EOF | sudo tee \/etc\/yum.repos.d\/grafana.repo<\/pre>\n<pre>[grafana]\r\n\r\nname=grafana\r\n\r\nbaseurl=https:\/\/packages.grafana.com\/oss\/rpm\r\n\r\nrepo_gpgcheck=1\r\n\r\nenabled=1\r\n\r\ngpgcheck=1\r\n\r\ngpgkey=https:\/\/packages.grafana.com\/gpg.key\r\n\r\nsslverify=1\r\n\r\nsslcacert=\/etc\/pki\/tls\/certs\/ca-bundle.crt\r\n\r\nEOF<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"762\" class=\"wp-image-13296\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-473.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-473.png 1200w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-473-300x191.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-473-1024x650.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-473-768x488.png 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>Enter the sudo password and the following output shows on the terminal:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1199\" height=\"306\" class=\"wp-image-13297\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-474.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-474.png 1199w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-474-300x77.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-474-1024x261.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-474-768x196.png 768w\" sizes=\"auto, (max-width: 1199px) 100vw, 1199px\" \/><\/p>\n<h3><strong>Step 2: Update yum repository<\/strong><\/h3>\n<p>Update the available system packages by using the below-given command:<\/p>\n<pre>$ sudo dnf makecache<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1103\" height=\"410\" class=\"wp-image-13298\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-475.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-475.png 1103w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-475-300x112.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-475-1024x381.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-475-768x285.png 768w\" sizes=\"auto, (max-width: 1103px) 100vw, 1103px\" \/><\/p>\n<p>Now, all packages of your system are updated.<\/p>\n<h3><strong>Step 3:\u00a0 Install Grafana using Yum<\/strong><\/h3>\n<p>Once the grafana repository is added and configured on your system, install the grafana by executing the below-mentioned command:<\/p>\n<pre>$ sudo dnf -y install grafana<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1204\" height=\"756\" class=\"wp-image-13299\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-476.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-476.png 1204w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-476-300x188.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-476-1024x643.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-476-768x482.png 768w\" sizes=\"auto, (max-width: 1204px) 100vw, 1204px\" \/><\/p>\n<p>The above command imports the GPG key and installs all required grafana packages on CentOS 8.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1198\" height=\"676\" class=\"wp-image-13300\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-477.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-477.png 1198w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-477-300x169.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-477-1024x578.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-477-768x433.png 768w\" sizes=\"auto, (max-width: 1198px) 100vw, 1198px\" \/><\/p>\n<p>Once the installation of grafana is completed, use the below-mentioned command to verify the installation and see the details of grafana package:<\/p>\n<pre>$ rpm -qi grafana<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1094\" height=\"598\" class=\"wp-image-13301\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-478.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-478.png 1094w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-478-300x164.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-478-1024x560.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-478-768x420.png 768w\" sizes=\"auto, (max-width: 1094px) 100vw, 1094px\" \/><\/p>\n<h3><strong>Step 4: Check the Grafana systemd service\u00a0<\/strong><\/h3>\n<p>The systemd manages the grafana service on your system. Therefore, enable it by running the \u2018systemctl\u2019 command as follows:<\/p>\n<pre>$ sudo systemctl enable --now grafana-server.service<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1097\" height=\"222\" class=\"wp-image-13302\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-479.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-479.png 1097w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-479-300x61.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-479-1024x207.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-479-768x155.png 768w\" sizes=\"auto, (max-width: 1097px) 100vw, 1097px\" \/><\/p>\n<h3><strong>Step 5: Start Grafana systemd service<\/strong><\/h3>\n<p>Now, grafana systemd service is enabled. Start service and then check \u2018running or Active\u2019 status of grafana service by running the below-mentioned commands:<\/p>\n<pre>$ systemctl start grafana-server.service<\/pre>\n<pre>$ systemctl status grafana-server.service<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1103\" height=\"626\" class=\"wp-image-13303\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-480.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-480.png 1103w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-480-300x170.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-480-1024x581.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-480-768x436.png 768w\" sizes=\"auto, (max-width: 1103px) 100vw, 1103px\" \/><\/p>\n<h3><strong>Step 6: Enable firewall rules<\/strong><\/h3>\n<p>By default, the grafana service runs on port 3000. So, if firewalld service is running on your system then, run the following command to allow access to port 3000 for grafana service:<\/p>\n<pre>\u00a0$ sudo firewall-cmd --add-port=3000\/tcp --permanent<\/pre>\n<pre>$ sudo firewall-cmd \u2013reload<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1105\" height=\"117\" class=\"wp-image-13304\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-481.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-481.png 1105w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-481-300x32.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-481-1024x108.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-481-768x81.png 768w\" sizes=\"auto, (max-width: 1105px) 100vw, 1105px\" \/><\/p>\n<p>To make sure everything is working correctly, use the below-given command:<\/p>\n<pre>$ sudo firewall-cmd --list-all | grep ports<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1098\" height=\"137\" class=\"wp-image-13305\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-482.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-482.png 1098w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-482-300x37.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-482-1024x128.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-482-768x96.png 768w\" sizes=\"auto, (max-width: 1098px) 100vw, 1098px\" \/><\/p>\n<h3><strong>Step 7: Grafana Configurations<\/strong><\/h3>\n<p>All grafana configurations related to port and path are stored in the \u2018\/etc\/grafana\/grafana.ini\u2019 configuration file. You can modify \u2018http_port = 3000\u2019\u00a0according to your system requirements. The grafana log is by default written in the \u2018\/var\/log\/grafana\u2019 directory. The grafana SQLite database can be found under \u2018\/var\/lib\/grafana\/grafana.db\u2019.<\/p>\n<h3><strong>Step 8:\u00a0 Launch Grafana on CentOS 8 through Web UI<\/strong><\/h3>\n<p>Launch the Grafana web user interface on CentOS 8. Open the browser and type the following URL in the address bar:<\/p>\n<pre>http:\/\/localhost:3000<\/pre>\n<p>Or<\/p>\n<pre><a href=\"http:\/\/server-ip:3000\">http:\/\/server-ip:3000<\/a><\/pre>\n<p>The Grafana web UI shows in your browser as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"424\" class=\"wp-image-13306\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-483.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-483.png 756w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-483-300x168.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/p>\n<p>Enter the username=admin and password= admin to access the Grafana dashboard. After that, the following Grafana dashboard display in the browser:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1234\" height=\"757\" class=\"wp-image-13307\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-484.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-484.png 1234w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-484-300x184.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-484-1024x628.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/12\/word-image-484-768x471.png 768w\" sizes=\"auto, (max-width: 1234px) 100vw, 1234px\" \/><\/p>\n<p>Congratulations! Grafana installation is completed. Now, you can use the grafana monitoring dashboard on CentOS 8 system.<\/p>\n<h2><strong>Remove or Uninstall Grafana monitoring tool from CentOS 8<\/strong><\/h2>\n<p>After using Grafana on your system, you can uninstall this monitoring tool dashboard from CentOS 8 by using the below-given command:<\/p>\n<pre>$ sudo yum \u2013y remove grafana<\/pre>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Today, this article has installed the Grafana monitoring dashboard through the command line on CentOS 8 system in this article. Moreover, we have discussed how to enable and change the configurations of grafana according to your ease. Grafana alone is not very useful. Therefore, you will have to install grafana along with other tools such as Prometheus or Influx DB. Send us your queries via comments.<\/p>","protected":false},"excerpt":{"rendered":"<p>Grafana is an open-source and one of the most commonly used monitoring dashboards of 2019 that is used by PayPal, eBay, and Red Hat. Grafana is a good&hellip;<\/p>","protected":false},"author":1,"featured_media":13542,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,420],"class_list":["post-13295","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-8","tag-grafana"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13295","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=13295"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/13295\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/13542"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=13295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=13295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=13295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}