How to Monitor Elasticsearch with Prometheus and Grafana | Install Elasticsearch Prometheus Exporter

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys so in this session we are going to learn how to monitor elastic search with Prometheus and graph okay so here we are going to learn how to monitor elastic search with Prometheus and graph so first of all we need to we need a instance right so here as you can see here I launch my instance with the uh operating system is Linux as you can see to right so as you can see are successfully connected to my instance you can see to 22.4 LTS okay so let's monitor elastic search with Prometheus and graph so for that as you can see here I mention some steps to monitor elastic search with Prometheus and graph so let's start so first of all we need to install jdk Java development kit right so to monitor elastic search we need to install jdk first so first of all I'm going to update my system package using this Pudo AP command sudo AP update so as you can see it's done now the next step is we need to here you can see elastic search require Java to run so we need to install open jdk8 by running the following command so here to monitor elastic search we need to install open jdk8 so that's why here I'm going to install open jdk8 using this command so as you can see it's installing so it take few seconds to install so wait for a few seconds okay it's almost done yeah it's done so now I'm going to clear my screen first okay now the next step is we need to set this Java home environment variables okay so for that we need to run this two commands to set the Java home environment okay it's done now the next step is here step number second we need to install elastic search on UB to so let's install elastic search on okay so first here I'm going to update my system package using this sudo APD update command so as you can see updating okay now the next step is let's download this de file for elastic search so I'm going to run this command using Wate command okay it's done if I run the ls command so as you can see so we need to extract this file using this following command we need to install this dpk file okay it's done now the next step we we need to Let's set up this network configuration for that open this elastic search. file so here in this elastic search we need to set this network this networks configuration right so I'm going to open this configuration file elastic search configuration file and here let's check the network section so here is the network section right so first of all here we need to UNC commmand this network host and here we need to replace this IP with z 0.0.0.0 that means any IP okay that means any IP can access this 0.0.0.0 right okay so let's save the file and exit okay it's done now the next step is let's enable our elastic search service then let's start the elastic search service now let's check the status of our elastic search so as you can see it's running right you can see it's active running that means we have successfully install our elastic search okay now let's access this elastic search in browser so how to access right so first of all you need you need a let's access this elastic search in our brows right so how to access so first of all here you need to cop IP address so let's copy IP address okay and hit on browser and for elastic search port number is 920 okay so as you can see here it's if I click this pretty print okay so that's the elastic search right so is the IP is 92 sorry i port number is 920 so you need to open this port number in your Security Group if your Security Group doesn't have this port then you can't have access in browser okay okay it's done so we have successfully install elastic search now it's time to install preus okay so how to install so first of all you download the latest version of Prometheus from the this using this command so as you can see it's downloading okay now the next step is here we need to extract our prome using this star file okay using this Star Command okay now let's clear the screen after that the next step is let's inside this promethus file okay now if I the ls command so as you can see the folders of our prome okay now let's go to this SL Etc system system D system file and here let's open our sorry let's create this file which file to make service file so in this location we need to create prometheus. service file and in this file we need to add this data so I'm going to paste this content here and let's save the file so press Escape WQ exclamation and enter okay the file successfully save okay after this reload we need to reload the service enable start and prus okay so let's start uh first of all reload our Prometheus service then after that we need to start our enable our Prometheus service then let's check let's start our PR service now after that let's check the status of our per so as you can see it's active running that means you have successfully installed prus right so how to check so let's s Prometheus in browser so the Prometheus port number is 9090 and this port number also you need to open in your security group so as you can see promas time series collection and as you can see if I go to my status and Target so here we have only one target here Prometheus and the state is up scrap timing scrap duration and there is no any error okay okay so now we have successfully installed Prometheus also right okay now it's time to install graph okay so it's time to install graph on U so how to install graph so here is the command so first of all you need to import your gpg keys used by graa package so let's import the gpg keys so first of all let's clear the screen first and let's enter the gpg keys okay it's decrypted after that then add a graph repository to your AP sources so I'm going to add this graph repository to my video resources okay it's done so let's clear the screen first after that let's update our system package so using sudo APD update command and after that let's install the graph now yes I want install that's why I'm going to enter y for yes so as you can see is installing graph okay it's done right so let's clear the screen first so we have successfully install graph so let's access graph in our browser okay so how to access so copy instance IP to browser and the graph port number is 3,000 so you need to open this port in your Security Group 3,000 also right so okay okay okay sorry after installing graa we need to start our grafa service right here we need to start our grafana server so let's start our grafana server okay now let's enable our grafana and if you want to check the status then you can enter the command for status it's running now let's check refresh the p so as you can see the login page is loading so wait a second it's loading okay so as you can see welcome to graph okay so here to graph username and password is also admin okay the default username and password is admin admin so click on login never so if you want to change the password for security then you can enter a new password after that that confirm new password so right now I'm going to skip this okay so as you can see this is the graph on our dashboard that means we have successfully installed graph now so as of now we have successfully installed elastic search we have successfully installed Prometheus we have successfully installed graph right and we have also successfully installed jdk open jdk okay okay now now the next step is here we need to install elastic search exporter for Prometheus okay so how to install so first of all here we need to create a system for elastic search so you need to create system for elastic search that's why I'm going to run this command so first of all I'm going to clear the screen and I'm going to create a system defa elastic search okay after that to download the different version visit the official website of elastic search so I'm going to download this using using this WG see y it's done now let's clear the screen first now if run the ls command as you can see here is the here is the downloaded file okay so after that here we need to extract this file right so how to extract so here we are going to use this sudo doar hyphen XV ZF and after that here is our file name so as you can see it's extracted Now find the ls command after that we need to insert this file so I'm going to CD and enter inside this file name so okay now let's clear the screen first okay now after that here we need to copy the exporter binary to to this particular location user local bin location right so let's run this to copy this local B location okay now after that now change the exporter binary ownership so let's change the exporter binary ownership using this following command okay then now we need to create elastic search exporter service file so here in this location which location SLC system D system elastic search exporter service here we need to create elastic search service file so copy the content and paste link this file now for save this file and press Escape colon WQ exclamation and enter okay so the file successfully saved now let's reload our system package first then let's enable our elastic search exporter after that let's start our elastic search exporter and in last let check let's check the status okay as you can see it's active running that means we have successfully installed elastic search exporter okay after that here as you can see here we need to configure okay it's done right now the next step is here how to access this elastic search exporter right so here the elastic search exporter port number is 91914 okay so you need to copy your instance IP hit on browser colon 914 so as you can see elastic search exporter Prometheus exporter for elastic search Serv servers and the version and so on click on Matrix so as you can see the Matrix of our elastic search right so as of now we have successfully install elastic surge then Prometheus then graph then elastic search exporter okay now the next step is here after that the next step is we need to configure prus to scrap elastic search Matrix so how to configure so here first of all we need to navigate the directory containing the Prometheus configuration okay so let's inside the Prometheus folder hello and after that here let's open the configuration file of Prometheus okay this is the configuration file so in last here we need to add new job here job name elastic search and in Target the port number is 91 914 right and here The Local Host replace with your instance IP right because here as you can see your instance IP and then 914 okay so copy your instance IP okay now in this Prometheus configuration file you need to careful about indentation okay you need to careful about indentation if you if you add extra space here then you will have a error now let's save the file and exit after changes in any configuration file you need to restart your survey so that's why I'm going to restart my Prometheus first okay and let's go to the Prometheus here is the Prometheus now go to the status go to the Target as you can see the status is unknown so let's refresh the page as you can see it's up okay refresh the Fage again okay now as you can see the both is up now you can see here we have one more Target added with the name elastic search right okay so now we have two Targets your elastics Prometheus as well as elastics s the state is up label scap timing scap duration and there is no any errors okay so it's done okay so we have successfully added our prur here we have successfully configure Prometheus to scrap elastic search Matrix okay it's done now the next step is we need to visualize elastic search Matrix in graph so how to visualize elastic search Matrix in graph so first of all here you need to go to the graph and here you need to add data source so how to add data source here you can see here click on data source and Prometheus select Prometheus and after that your name Prometheus and you need to enter your Prometheus URL so here is my Prometheus URL from here to here means IP address and the port number right and I'm going to enter here okay and now let's keep as it is and click on Save and teste okay it's done now let's go to the home okay after that here you need to create click on visualize you can see after this okay is right we have successfully create our data source so you can see go back to the prom graph now welcome page and go home left top icon okay connect to data source okay and it's successfully cre from yes okay it's done now the next step is here here you can start your own new dashboard by adding a visualization so let's add our visualization so how to add so first of all you need to click on this add visualization then here you can also import your dashboard then select prets as data source okay okay so let's go to this so here you can see create your dashboard first so click on this so as you can see start your new dashboard by adding the visualization so click on ADD visualization and here you need to select this Pras as a data source okay now after that let's scroll down here okay here you can see select Matrix okay you need to enter a matrix for visualization right right for this visualize elastic Matrix in graph now you need to select Matrix so as you can see here now in this query section add a query so which query so here I'm going to add this query okay elastic search file system data available bites so so I'm going to copy this query here and enter here so as you can see the query here okay after that label filter so I'm going to choose instance instance value this is our instance value right for elastic SE the port number is 91 944 and this is your instance IP right as you can see here the same okay then select value okay so check for once okay it's done now click on run quod so as you can see the data if I click on this time series and click on the barage okay this is the time series this is the bar chart okay as you can see this is bar chart if you want to change the stat there is the stat after that uh table if you want to check the table okay okay okay let's enter Matrix for once okay select label instance value is click on run queries and here I'm going to select this bar chart so as you can see the bar chart if you want to change then you can change the is also okay text and so on okay so if you want to change then you can change from here okay then after that if you want to check the another query here then added B query so I'm going to add the this query elastic search process CPO seconds total Okay so let's check so here enter a query and and after that here next is cluster elastic search I'm going to CL click on cluster and here elastic search now click on Runway so as you can see you want to time series this the time series okay if you want to check the bar chart the bar chart okay so here we have this this metric and the filter is cluster and the name is elastic sech the okay so this query retrives the total CPU time consumed by the elastic search process across the entire cluster by specifying the cluster as elastic search and graph na H CPU as Matrix for all nodes within the elastic cluster okay now after that it's done now if you want to save this dashboard then control+ s so as you can see enter new dashboard if you want to add the description and then add folder in dashboard and click on save your dashboard will successfully save okay so it's done so that's the monitor elastic search with Prometheus and graph right so in this session we have learned how to monitor elastic search with graph and promethus and in this first of all we have install jdk open jdk then we have install elastic search then we have installed Prometheus then we have install graph then we have install elastic search exporter right and after that we we have successfully visualized the dashboard right so it's done so in this session we have learned how to monitor elastic search with Prometheus and graph so thank you for watching and I hope you understand
Info
Channel: DevOps Hint
Views: 262
Rating: undefined out of 5
Keywords: prometheus monitoring, prometheus monitoring tutorial, prometheus tutorial, How to Monitor Elasticsearch with Prometheus and Grafana, Install Elasticsearch Prometheus Exporter, Grafana Tutorial, monitor elasticsearch, prometheus monitoring tool tutorial, prometheus monitoring kubernetes
Id: WNJkOyVkJeU
Channel Id: undefined
Length: 23min 25sec (1405 seconds)
Published: Fri Apr 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.