$ docker run -d --name=grafana -p 3000:3000 grafana/grafanaA Grafana server container should now be up and running on your host. To confirm that, run the following command.$ docker container ls grep grafanaYou can also make sure that it is correctly listening on port 3000.$ netstat -tulpn grep 3000
If you are unfamiliar with basics of InfluxDB and what IFQL is, check my ultimate InfluxDB guide for beginners. It contains good explanations regarding everything that you need to know: -definitive-guide-to-influxdb-in-2019/
influxdb telegraf grafana ,
Head over to Grafana download page, download the zip and unzip it wherever you want. Similarly to what you did with InfluxDB, head over to the folder where you stored your executables and run the Grafana server (grafana-server.exe in bin folder).
InfluxDB is an open-source time series database written in Go. Optimized for fast, high-availability storage and used as a data store for any use case involving large amounts of time-stamped data, including DevOps monitoring, log data, application metrics, IoT sensor data, and real-time analytics.if(typeof ez_ad_units!='undefined')ez_ad_units.push([[728,90],'howtoforge_com-box-3','ezslot_8',106,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-box-3-0');Telegraf is an agent for collecting, processing, aggregating, and writing metrics. It supports various output plugins such as influxdb, Graphite, Kafka, OpenTSDB etc.if(typeof ez_ad_units!='undefined')ez_ad_units.push([[728,90],'howtoforge_com-medrectangle-3','ezslot_7',121,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-medrectangle-3-0');Grafana is an open source data visualization and monitoring suite. It offers support for Graphite, Elasticsearch, Prometheus, influxdb, and many more databases. The tool provides a beautiful dashboard and metric analytics, with the ability to manage and create your own dashboard for your apps or infrastructure performance monitoring.In this tutorial, I will show you how to install and configure the TIG Stack (Telegraf, influxdb, and Grafana) using a single Ubuntu 18.04 Server. We will be using the TIG Stack for monitoring the system loads such as Network, RAM Memory, Uptime etc.PrerequisitesUbuntu 18.04Root privilegesWhat we will do?Install InfluxDBCreate InfluxDB Database and UserInstall Telegraf AgentConfigure TelegrafInstall GrafanaSetup Grafana Data SourceSetup Grafana DashboardStep 1 - Install InfluxDBIn this first step, we will install the time series database influxdb on the Ubuntu system. We will install both 'influxdb' and the 'telegraf' from the same 'influxdata' Repository, both software were created by the same organization.Add the influxdata Key.(adsbygoogle=window.adsbygoogle[]).push();sudo curl -sL sudo apt-key add -Add the influxdata repository.source /etc/lsb-releaseecho "deb $DISTRIB_ID,, $DISTRIB_CODENAME stable" sudo tee /etc/apt/sources.list.d/influxdb.listNow update the repository and install the 'influxdb' package using the apt command below.sudo apt updatesudo apt install influxdb -yAfter the installation is complete, start the influxdb service and enable it to launch every time at system boot.if(typeof ez_ad_units!='undefined')ez_ad_units.push([[728,90],'howtoforge_com-medrectangle-4','ezslot_1',108,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-medrectangle-4-0');sudo systemctl start influxdbsudo systemctl enable influxdbNow check the opened ports on the system.netstat -plntuAnd make sure you get influxdb ports '8088'and '8086' on the 'LISTEN' state.Step 2 - Create InfluxDB Database and UserIn order to store all data from telegraf agents, we need to set up the influxdb database and user.InfluxDB provides the CLI tool named 'influx' for interacting with an InfluxDB server. Influx command is like the 'mysql' on MySQL, and 'mongo' on the MongoDB database.if(typeof ez_ad_units!='undefined')ez_ad_units.push([[580,400],'howtoforge_com-box-4','ezslot_6',110,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-box-4-0');Run the 'influx' command below.influxNow you are connected to the default influxdb server on port '8086'.Create a new database and user 'telegraf' with the password 'hakase-ndlr' by running influxdb queries below.create database telegrafcreate user telegraf with password 'hakase-ndlr'Now check the database and user.show databasesshow usersMake sure you get the database and user named 'telegraf' on the influxdb server.Advertisement.banner-1text-align:center;padding-top:10px!important;padding-bottom:10px!important;padding-left:0!important;padding-right:0!important;width:100%!important;box-sizing:border-box!important;background-color:#eee!important;outline:1px solid #dfdfdf;min-height:125px!importantif(typeof ez_ad_units!='undefined')ez_ad_units.push([[728,90],'howtoforge_com-banner-1','ezslot_9',111,'0','0']);__ez_fad_position('div-gpt-ad-howtoforge_com-banner-1-0');Step 3 - Install Telegraf AgentTelegraf was created by 'influxdata', same organization which created the influxdb. So when we add the influxdata key and repository to the system, it means we can install both applications.Install the telegraf package using the apt command below.sudo apt install telegraf -yAfter the installation is complete, start the telegraf service and enable it to launch everytime at system startup.sudo systemctl start telegrafsudo systemctl enable telegrafThe telegraf agent is up and running, check it using the command below.sudo systemctl status telegrafStep 4 - Configure TelegrafTelegraf is a plugin-driven agent and has 4 concept plugins type.Using the 'Input Plugins' to collect metrics.Using the 'Processor Plugins' to transform, decorate, and filter metrics.Using the 'Aggregator Plugins' to create and aggregate metrics.And using the 'Output Plugins' to write metrics to various destinations, including influxdb.In this step, we will configure the Telegraf to use basic input plugins for collecting system metric of the server and using the influxdb as the output plugin.Go to the '/etc/telegraf' directory and rename the default configuration file.cd /etc/telegraf/mv telegraf.conf telegraf.conf.defaultNow create a new other configuration 'telegraf.conf' using vim editor.vim telegraf.confPaste configurations below.# Global Agent Configuration[agent] hostname = "hakase-tig" flush_interval = "15s" interval = "15s"# Input Plugins[[inputs.cpu]] percpu = true totalcpu = true collect_cpu_time = false report_active = false[[inputs.disk]] ignore_fs = ["tmpfs", "devtmpfs", "devfs"][[inputs.io]][[inputs.mem]][[inputs.net]][[inputs.system]][[inputs.swap]][[inputs.netstat]][[inputs.processes]][[inputs.kernel]]# Output Plugin InfluxDB[[outputs.influxdb]] database = "telegraf" urls = [ " :8086" ] username = "telegraf" password = "hakase-ndlr"Save and exit.Note:Telegraf provides telegraf command to manage the configuration, including generate the configuration itself, run the command as below.telegraf config -input-filter cpu:mem:disk:swap:system -output-filter influxdb > telegraf.confcat telegraf.confRestart the telegraf service and make sure there is no error.sudo systemctl restart telegrafNow test the telegraf settings using the command below.sudo telegraf -test -config /etc/telegraf/telegraf.conf --input-filter cpusudo telegraf -test -config /etc/telegraf/telegraf.conf --input-filter netsudo telegraf -test -config /etc/telegraf/telegraf.conf --input-filter memThe InfluxDB and Telegraf configuration has been completed.Step 6 - Install GrafanaIn this step, we will install the beautiful Grafana Dashboard for data visualization.Add the grafana key and repository.sudo curl sudo apt-key add -echo 'deb stretch main' > /etc/apt/sources.list.d/grafana.listUpdate the repository and install the grafana package using the apt command below.sudo apt updatesudo apt install grafana -yAfter the installation is complete, start the grafana service and enable it to launch everytime at system boot.sudo systemctl start grafana-serversudo systemctl enable grafana-serverThe grafana-server is up and running on default port '3000', check it using netstat.netstat -plntuAnd you will get the result as below.Step 7 - Setup Grafana Data SourceOpen your web browser and type the server IP address with port 3000. :3000/Login with the default user 'admin' and password 'admin'.Now you will be prompted with the page for changing the default password, type your new password and click the 'Save' button.And you will be redirected to the default Grafana Dashboard.Click the 'Add data source' button to add the influxdb data source.Type details about the influxdb server configurations.Name: influxdbType: influxdbURL: :8086/Scroll to the bottom page and type details of influxdb database settings.Database: telegrafUser: telegrafPassword: 'hakase-ndlr'Click the 'Save and Test' button and make sure you get the 'Data source is working' result.The InfluxDB data source has been added to the Grafana server.Step 8 - Setup Grafana DashboardAfter adding the influxdb as a data source to the grafana server, in this step we will import the grafana dashboard based on our Telegraf input plugins setup.Grafana provides the repository for grafana plugins and dashboards.Grafana Plugins Grafana DashboardsTo import the grafana dashboard, click on the '+' menu on the left panel and click 'Import'.Now open the sample Grafana dashboard from URL ' ' and click the 'Copy the ID to Clipboard' button.Paste the dashboard id.And you will be redirected automatically to the dashboard setup.On the options section, click the InfluxDB and choose your influxdb server, then click 'Import' button.And below are some screenshots from the imported dashboard.The TIG Stack (Telegraf, InfluxDB, and Grafana) installation on Ubuntu 18.04 has been completed successfully.Reference About Muhammad ArulMuhammad Arul is a freelance system administrator and technical writer. He is working with Linux Environments for more than 5 years, an Open Source enthusiast and highly motivated on Linux installation and troubleshooting. Mostly working with RedHat/CentOS Linux and Ubuntu/Debian, Nginx and Apache web server, Proxmox, Zimbra Administration, and Website Optimization. Currently learning about OpenStack and Container Technology. view as pdf printShare this page:Suggested articles21 Comment(s)Add commentName *Email *tinymce.init(selector:"textarea#commentedit",theme:"modern",height:100,apply_source_formatting:true,remove_linebreaks:false,menubar:false,plugins:["link"],content_css:" ",toolbar:"undo redo );CommentsBy: Chris Kozma Reply Hi! This works wonderfully, however the 'net' test command for telegraf returns 'Error: no inputs found, did you provide a valid configuration file?'. How can I resolve this issue? Thanks again for the wonderful guide!By: Mayur Patel Reply Hello,Your website is very helpful and one of the best website in open source ,,,but i need install telegraf , grafana and influxdb in docker and visulise graf so if possible please upload process.. thanks By: MattG Reply Grafana has moved their repository... here's there notes. By: bubee Reply 2ff7e9595c
Comments