{"id":3239,"date":"2020-04-19T17:13:53","date_gmt":"2020-04-19T17:13:53","guid":{"rendered":"http:\/\/www.jameseduard.com\/?p=3239"},"modified":"2020-04-19T17:13:53","modified_gmt":"2020-04-19T17:13:53","slug":"how-to-install-influxdb-on-centos-8-rhel-8","status":"publish","type":"post","link":"https:\/\/www.jameseduard.com\/?p=3239","title":{"rendered":"How To Install InfluxDB on CentOS 8 \/ RHEL 8"},"content":{"rendered":"<p>[vc_row][vc_column][vc_column_text]In this article will guide you on how to install InfluxDB on CentOS 8 \/ RHEL 8 to start monitoring and visualization of your network Infrastructure.<br \/>\nInfluxDB provides the repository for installing InfluxDB on CentOS 8 or RHEL 8<\/p>\n<p>InfluxDB is an open-source time series database developed written in Go by InfluxData. InfluxDB is optimized for fast, high-availability storage and retrieval of time series data for metrics analysis. This can be installed on a single server or a clustered.<\/p>\n<p>1. Add InfluxDB repository to your system,run the following command with sudo privileged.<br \/>\n[simterm]<br \/>\n$ sudo tee \/etc\/yum.repos.d\/influxdb.repo&lt;&lt;EOF<br \/>\n[influxdb]<br \/>\nname = InfluxDB Repository<br \/>\nbaseurl = https:\/\/repos.influxdata.com\/rhel\/7\/x86_64\/stable\/<br \/>\nenabled = 1<br \/>\ngpgcheck = 1<br \/>\ngpgkey = https:\/\/repos.influxdata.com\/influxdb.key<br \/>\nEOF<br \/>\n[\/simterm]<\/p>\n<p>2. Update your cache and confirm that the repository is working fine:<br \/>\n[simterm]<br \/>\n$ sudo dnf makecache<br \/>\n[\/simterm]<\/p>\n<p>3. You can now install InfluxDB since we added already on repositories<br \/>\nTo install InfluxDB run the following command.<br \/>\n[simterm]<br \/>\n$ sudo dnf -y install influxdb<br \/>\n[\/simterm]<\/p>\n<p>Result:<br \/>\n[simterm]<br \/>\nLast metadata expiration check: 0:10:57 ago on Mon 20 Apr 2020 12:50:15 AM PST.<br \/>\nDependencies resolved.<br \/>\n=============================================================================================================================================================================<br \/>\nPackage Architecture Version Repository Size<br \/>\n=============================================================================================================================================================================<br \/>\nInstalling:<br \/>\ninfluxdb x86_64 1.8.0-1 influxdb 60 M<\/p>\n<p>Transaction Summary<br \/>\n=============================================================================================================================================================================<br \/>\nInstall 1 Package<\/p>\n<p>Total download size: 60 M<br \/>\nInstalled size: 164 M<br \/>\nDownloading Packages:<br \/>\ninfluxdb-1.8.0.x86_64.rpm 1.9 MB\/s | 60 MB 00:31<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nTotal 1.9 MB\/s | 60 MB 00:31<br \/>\nwarning: \/var\/cache\/dnf\/influxdb-5468cd5ca80e07dd\/packages\/influxdb-1.8.0.x86_64.rpm: Header V4 RSA\/SHA256 Signature, key ID 2582e0c5: NOKEY<br \/>\nInfluxDB Repository 3.7 kB\/s | 3.0 kB 00:00<br \/>\nImporting GPG key 0x2582E0C5:<br \/>\nUserid : &#8220;InfluxDB Packaging Service &lt;support@influxdb.com&gt;&#8221;<br \/>\nFingerprint: 05CE 1508 5FC0 9D18 E99E FB22 684A 14CF 2582 E0C5<br \/>\nFrom : https:\/\/repos.influxdata.com\/influxdb.key<br \/>\nKey imported successfully<br \/>\nRunning transaction check<br \/>\nTransaction check succeeded.<br \/>\nRunning transaction test<br \/>\nTransaction test succeeded.<br \/>\nRunning transaction<br \/>\nPreparing : 1\/1<br \/>\nRunning scriptlet: influxdb-1.8.0-1.x86_64 1\/1<br \/>\nInstalling : influxdb-1.8.0-1.x86_64 1\/1<br \/>\nRunning scriptlet: influxdb-1.8.0-1.x86_64 1\/1<br \/>\nCreated symlink \/etc\/systemd\/system\/influxd.service \u2192 \/usr\/lib\/systemd\/system\/influxdb.service.<br \/>\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/influxdb.service \u2192 \/usr\/lib\/systemd\/system\/influxdb.service.<\/p>\n<p>Verifying : influxdb-1.8.0-1.x86_64 1\/1<\/p>\n<p>Installed:<br \/>\ninfluxdb-1.8.0-1.x86_64<\/p>\n<p>Complete!<br \/>\n[\/simterm]<\/p>\n<p>4. Checked installed package details by running the command.<br \/>\n[simterm]<br \/>\n$ rpm -qi influxdb<\/p>\n<p>Name : influxdb<br \/>\nVersion : 1.8.0<br \/>\nRelease : 1<br \/>\nArchitecture: x86_64<br \/>\nInstall Date: Mon 20 Apr 2020 01:01:48 AM PST<br \/>\nGroup : default<br \/>\nSize : 171708035<br \/>\nLicense : Proprietary<br \/>\nSignature : RSA\/SHA256, Sat 18 Apr 2020 09:41:56 AM PST, Key ID 684a14cf2582e0c5<br \/>\nSource RPM : influxdb-1.8.0-1.src.rpm<br \/>\nBuild Date : Sun 12 Apr 2020 03:56:55 PM PST<br \/>\nBuild Host : 0e5416f9f2d6<br \/>\nRelocations : \/<br \/>\nPackager : support@influxdb.com<br \/>\nVendor : InfluxData<br \/>\nURL : https:\/\/influxdata.com<br \/>\nSummary : Distributed time-series database.<br \/>\nDescription :<br \/>\nDistributed time-series database.<br \/>\n[\/simterm]<\/p>\n<p>5.Start and enable InfluxDB service on CentOS 8 \/ RHEL 8 by running the command:<br \/>\n[simterm]<br \/>\n$ sudo systemctl enable &#8211;now influxdb<br \/>\n[\/simterm]<\/p>\n<p>6. Now check InfluxDB status to confirm it is running on the system.<br \/>\n[simterm]<br \/>\n$ systemctl status influxdb<\/p>\n<p>\u25cf influxdb.service &#8211; InfluxDB is an open-source, distributed, time series database<br \/>\nLoaded: loaded (\/usr\/lib\/systemd\/system\/influxdb.service; enabled; vendor preset: disabled)<br \/>\nActive: active (running) since Mon 2020-04-20 01:06:03 PST; 1min 45s ago<br \/>\nDocs: https:\/\/docs.influxdata.com\/influxdb\/<br \/>\nMain PID: 7277 (influxd)<br \/>\nTasks: 18 (limit: 26213)<br \/>\nMemory: 19.2M<br \/>\nCGroup: \/system.slice\/influxdb.service<br \/>\n\u2514\u25007277 \/usr\/bin\/influxd -config \/etc\/influxdb\/influxdb.conf<\/p>\n<p>[\/simterm]<\/p>\n<p>7. Configure InfluxDB on the system firewall on CentOS 8 \/ RHEL 8, Allow or open the InfluxDB services on port 3000 via TCP on your server, by adding new firewall rules and by default, InfluxDB uses the following network ports:<\/p>\n<p>TCP port 8086 is used for client-server communication over InfluxDB\u2019s HTTP API<br \/>\nTCP port 8088 is used for the RPC service for backup and restore.<\/p>\n<p>To open it on the firewall, use the command:<br \/>\n[simterm]<br \/>\n$ sudo firewall-cmd &#8211;add-port=8086\/tcp &#8211;permanent<br \/>\n$ sudo firewall-cmd &#8211;reload<br \/>\n[\/simterm]<\/p>\n<p>8. Port mappings can be modified by changing the file \/etc\/influxdb\/influxdb.conf &amp; If you make any change in the configuration file, restart influxdb service.<br \/>\n[simterm]<br \/>\n$ sudo systemctl restart influxdb<br \/>\n[\/simterm][\/vc_column_text][vc_column_text]9. Configure InfluxDB http Authentication<br \/>\nIf you need http authentication, modify influxdb http section to contain the following and un comment # auth-enabled<br \/>\n[simterm]<br \/>\n$ sudo vi \/etc\/influxdb\/influxdb.conf<br \/>\n[\/simterm]<\/p>\n<p>[simterm]<br \/>\n[http]<br \/>\n# Determines whether user authentication is enabled over HTTP\/HTTPS. -pr3p<br \/>\n# auth-enabled = true<\/p>\n<p>[\/simterm]<br \/>\n10. Restart InfluxDB services<br \/>\n[simterm]<br \/>\n$ sudo systemctl restart influxdb<br \/>\n[\/simterm]<\/p>\n<p>11. Create a user with an authentication password:<br \/>\n[simterm]<br \/>\ncurl -XPOST &#8220;http:\/\/localhost:8086\/query&#8221; &#8211;data-urlencode &#8220;q=CREATE USER \\<br \/>\nusername WITH PASSWORD &#8216;strongpassword&#8217; WITH ALL PRIVILEGES&#8221;<br \/>\n[\/simterm]<\/p>\n<p>Note:<br \/>\n\u2013 username with your own username<br \/>\n\u2013 strongpassword with your own password &amp;note that the password requires single quotes<\/p>\n<p>Now whenever you need to run any influxdb commands on the terminal, you need to specify username using -username and password using -password options.<br \/>\n[simterm]<br \/>\ninflux -username &#8216;username&#8217; -password &#8216;password&#8217;<br \/>\n[\/simterm]<\/p>\n<p>For curl, use -u to specify username and password separated by a colon.<br \/>\n[simterm]<br \/>\ncurl -G http:\/\/localhost:8086\/query -u username:password &#8211;data-urlencode &#8220;q=SHOW DATABASES&#8221;<br \/>\n[\/simterm]<\/p>\n<p>By default, influxdb service is listening on all interfaces on port 8086.<br \/>\n[simterm]<br \/>\n$ ss -tunelp | grep 8086<br \/>\ntcp LISTEN 0 128 *:8086 *:* users:((&#8220;influxd&#8221;,pid=2072,fd=5)) uid:985 ino:37787 sk:6 v6only:0 &lt;-&gt;<br \/>\n[\/simterm]<\/p>\n<p>Congrats you have successfully installed and configured InfluxDB installed on CentOS 8 or RHEL 8[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][vc_column_text]In this article will guide you on how to install InfluxDB on CentOS 8 \/ RHEL 8 to start monitoring and visualization of your network Infrastructure. InfluxDB provides the repository for installing InfluxDB on CentOS 8 or RHEL 8 InfluxDB is an open-source time series database developed written in Go by InfluxData. InfluxDB is optimized<\/p>\n","protected":false},"author":1,"featured_media":3242,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3,47,407],"tags":[156,784,4],"class_list":["post-3239","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-grafana","category-how-tos","category-rhel","tag-grafana","tag-influxdb","tag-monitoring"],"_links":{"self":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/3239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3239"}],"version-history":[{"count":0,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=\/wp\/v2\/posts\/3239\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jameseduard.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}