Elasticsearch Installation (Hands-on Experience) | Kibana Setup | Kibana Basic Usage

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] let us in this presentation discuss about the installation of elasticsearch and kibana and also we'll have some hands-on experience on the basic usage of kibana to interact with elasticsearch so let's begin so before we go to the installation part first of all we need to check some dependencies there is elasticsearch code is fully dependent on java runtime environment so java must be there in our system so to check whether java is there already there in our system or not let us type this command java just as version okay on typing this if you create something like this that is the java person is being displayed here that means java is already there in my system if it is not there please install java okay and also you need to check whether java home variable each environment variable is set that is java home to check that you need to type on your terminal or con prompt equal dollar java home you just see if such kind of path is there already set or not there's a java installation path must be said in java home environment variable okay if these two things are there that means you are ready to go with the installation so let's go to the elasticsearch website to download that is elastic.co then go to the products tab and then click elastic search link and then you will get a page like this there will start free trial or download and get it get started i'm going with this option and here you will get links like this get elasticsearch then based on your operating system uh click on these links if you are in windows click this mac this and in my case it is linux so i am clicking on this and you will get a some dar.gzat file uh if it is linux or mac otherwise if it is windows you will get a gp file just download that okay once the download completed you please go to that file i have it in this location you can keep it anywhere i have kept it in my opt eos directory and if you are in windows maybe you are you will prefer to keep it in e dry body drive somewhere you keep it anywhere as per your favorite location so my file is here the downloaded file is here that is this one okay i'm going to extract it okay uh you use your favorite tool for the extraction maybe a seven jeep or winche whatever you have or you can do it from common line also okay the extra uh extraction is completed so let let's see what exists there right now if we ls here we'll get another new folder that has been created after the extraction so this is our elasticsearch files exist inside this let us move into that plastic search let's see what exists inside this and said this there is a number of directories and files so here is a bin directory config directory the jdk directory lib and all these things are there so first of all i will focus on the config directory let us see what exists inside config and said convict there are a number of files that's elasticsearch.yml jvm.options and there are many other configurations also but for the time being we'll focus on this file this is very important and this elasticsearch.yml let's open it very config slash yml i'm using the vi editor you can open it by using your favorite text editor okay here is the configuration file now there is a number of entries there all of us committed out that is if we uh just open it you want to enable any configuration we just need to remove this hash from this from this line okay so here is the cluster name so we'll see few of these entries at this current moment later i will have a separate video to understand all the configuration file entries for the time being just see few of these entries so here is the cluster dot name so this name is the default name my application i am going to change it i'm just trying learning being es cluster okay if you do not change it no issue the name will be the default name and also here is the node.name it is the name of your node uh it is the deeper node has been given as node one i am changing it to learning node one okay here is the data path uh default path you do not change this path the data will be kept that is where the elastic search data will be kept in the file system if you do not change it there will be a data directory inside elasticsearch folder and there the data will reside if you want to keep it somewhere into a different location then you can set the path here okay and same for logs also and there is some other settings there we are skipping there and here is the one important entry that's the network.host this is when you are in a multi-node cluster that is if you are creating a multi-node cluster then you need to specify the lan ip address of your machine but here we are creating a single node cluster so we are not going to specify any ipaddress if you do not change this entry at this moment there is no issue it will take the default localhost ip address so okay i'm going to change that default one one two seven point zero point zero point one okay and here is the http port there is the particular port on which elasticsearch server will listen i am not going to change this this just keep it with the default port it will change no issue okay so i am keeping it default nine two zero zero okay so we have changed four configurations uh till now we are not going to change anything else here the http port here is the host and here is the cluster name and here is the node name okay i have changed all the uh entries we needed at the right moment okay just save and close it so we are ready and now let us have a look on this bin directory this bin directory contents uh contains the binaries of elastic search okay ls when i am doing it just still spin less okay here's the number of binaries there so for the time being we just need this one if we run this binary file then elasticsearch server will run okay so we'll run this file right now so to run this file just type in your console bean slash elastic if you are in windows might be this file is called as elastic.exe okay the running mechanism means same bin slash elasticsearch.exe just type it and press enter so elasticsearch server is getting started and a lot of things has been written in the console okay we are seeing that our learning node one has been started if you get this log here that means server is off okay we are running it in terminal so let's keep it running as it is now as our server is off we just need to see the publish address is one two seven zero zero one nine two zero zero that is the network host we set earlier in the configuration file and the particular port now we need to copy this okay we'll run it in our browser just open your browser and in a new tab press that one two zero zero that localhost address and 9200 and if you see you will get a page like this if a page like this is displayed that means that your elasticsearch server is off so here is the node name that's the learning node 1 and here is the cluster name there's the learning being yes cluster what we said in our configuration file that has been reflected here okay so our server is off now we know that elasticsearch provides restful api interface to interact with it okay so respond means we can interact with just http request okay so here we can do some uh some http request from our browser also which is just read only for example our get request if it is the get request then we can do it we can perform it from our browser address bar also okay so for example if we want to see the list of indexes exist in this index at this current moment or the cluster health all these things are just read only operation and those are done through the by using the http get method okay so those things can be done from elastics from browser address bar also so if we just run this cat indices this will display the list of indexes exist in elasticsearch but for the timing this page is totally empty because we have not created any index yet so if we want to create index we need to do right operation into elasticsearch so for doing the right operation uh it will it is not possible to run any post or put operation from this address bar so we need some rest client maybe postman here we will not going to use any rest client like postman instead elasticsearch provides some dedicated rest client that is the kiwana development tool we will be using that for that we need to download kibana first so we will go to the elasticsearch website again and here is the kibana we will download the kibana the downloading mechanism is same just like elasticsearch you click based on your operating system i am downloading it for linux okay we will get the same kind of dot gang file or in case of windows you will get a zip file just download it now once the download is completed go to the terminal and open a new terminal window and just i am going to the same location where my elastic search resides just copy the file where it has been downloaded i'm not copying it from the downloads folder okay i have copied it in my let's see so here is my keyboard file so i'm going to extract it by using the tar command i am keeping it in the same directory where elasticsearch is resize but but there is no uh rules for that you can keep it kibana anywhere you want okay section is completed let us clear the console and let us ls so we see uh here is the keyboard directory has been created okay let's move to the given directory so here is the keyboard files now let us say that that's l so here is the files and folders here is the same file structure like the elasticsearch bin config data okay all these things so one thing to note here our elasticsearch server is in different console because we are running it from terminal right now so we need to keep it this way if we close this terminal then elasticsearch server will be down okay because we are running it from terminal so when you uh deploying your elastic search in production or any other server then you need to create service for that so we will see about the service creation later so for the timing just run it from console and it will elastic search will run in different console and you need to run kubernetes somewhere else here so here is the bin and config directory so we'll have a look on the config again ls config so there exists kibana dot yml and node options so let's just open it kibana file okay kibana vi i'm using gear editor config slash keyboard.yml here is our kibana file so here also we will see some important entries so here is the server.port that is the particular port number on which kibana will run so here is the 5601 is the default port let's keep it default okay and also here is the server.host there is the particular hostname on which elasticsearch will uh sorry kibana will run so here is the localhost you can keep it localized or the localhost ip127.0.0 whatever you want okay just i have enabled this two entries if you do not enable no issue you will run on the same default settings okay so here is the other important entry that is the elastic search dot host so this is the elasticsearch uh ip address and port you need to mention by elasticsearch is running so currently as we have already run elasticsearch in our localhost that is if you specify the ip also there is no issue or the if you write localhost also there is the same thing here is the elasticsearch ipm port by using this configuration kibana will connect to elasticsearch okay even close this okay now to run kibana let us have a look on the bin directory that is the number of binaries exist the keyboard now we will run this binary file okay so just pin slash just press enter and in case of windows might be it is keyboard.exe just run that so here you will get a number of uh warnings because of might be it is single node cluster and the https all these things are not configured yet noise with it let's keep on running here it is listening uh this the ip address and the port number has been mentioned here okay so let's just copy it and run it in us in our browser if we run it we'll get the keyboard interface the add data or explore my mod well let me let us explore our own okay so here is the main keyboard interface actually so here is the menu you will see because kibana does a number of things it displays the analytics data by using via the by visualizing using graphs etc so there's the analytics uh here's the enterprise search observability many things are there and security but for the timing we'll focus on this the management and dev tools just click on this and on clicking on this uh you will get an interface like this on the left hand side there is left hand side you will write queries here and on the right hand side you will get the output okay this is just a test client okay so for the timing let's run our basic command which we run run from here okay if we want to run this also this is the root query okay if we if it is in case of uh http request then we need to type here like this this get method get request and if we just run this we will get this page just run it type it here and run it from here okay we are getting this page here so here one thing we need to note that we do not need to mention the poor host or port here because we already have mentioned the host and port in our kibana dot yml file if we want to see the list of indexes which we run it from here earlier there was nothing there it was empty blank empty page if we run it again you will will get some says here because all these indexes has been created by kibana okay so if we run this as the same command just copy this okay just copying it and go to the kibana console and type here get and then just paste cat understood indices you will run it you will get the list of indexes here okay if we zoom out you will get it like this okay here another important thing is that if you type there are many metrics we can get by using this cluster here one important thing that kibana will display you a lot of suggestions so it will be very much helpful if you want to see cluster health just run it there is a number of queries you can run from here and the same queries if you run want to run from browser you just need to here cluster health so you will get the same output here also so this is all and now these are about the get request now if you want to uh create any index okay then we need to use the put method put and then just write the index name books if we write it here then just uh this is just simple if you run this an index will be created acknowledge true search acknowledge true index books okay a books have been created if you again want to see the list of indexes just run it here you will be able to see the book name here is being displayed okay so this is just simple we have not created any fields or all these things uh with this index just we have created index there is nothing no field uh no analyzer no documents yet okay now if you want to see the settings of this index that is if you in case of rdbms suppose you have created a table and you want to display the schema then you will write desc that is describe table okay for similar comments for this is get books if you do this similar like the description the esc command if you run this it will display you the schema of this books index so here a lot of things settings mappings and aliases all these things are there so here let's collapse it and here inside mappings focus on these things mappings is totally empty because we have not specified any fields because that is why there is no filter being displayed over now if you want to create any fields then just we need to write something put books and inside that we need to specify some configuration like mappings and inside mappings you need to write the properties and inside properties you need to create the fields suppose we are storing books information so we uh create a field name book name and just write the type as text okay so and another suppose the author name and the mention the type type is also text and suppose this is our library database so we want to keep the number of copies type instead of text just make it integer okay so it will store let us keep this with these three fields now just run it you will get some error because resource already exists exception because here already the books index is exist there so to create a new index with the same name it is not possible so you need to delete it you need to delete the earlier index if you will just keep different name books too then it will be created but let's delete the earlier index delete you just need to delete the index name if you run this okay you run run this and the index will be deleted please do not run it in case of production so we acknowledge true if you want to see the list here just run it again and here the book has been finished now you run this query on running this you will see acknowledge true okay index has been created now inside this list will be able to see this now if you want to see the description the get books if you will that like the desc table name similar like so you just run it and you will see interesting thing let's just call us the settings and here the inside the mappings there was nothing earlier now here you are able to see the mappings and then properties and after that all the field names are there author book name number of copies with their types etc okay now if you want to see what are the indexes what are the documents exist inside these books index so for that is the select store from books a query similar like this if you want to run then you need to type get books slash underscore search if you run this you will be able to see all the documents but here we do not have any documents his total value is zero because we have not put any documents yet now let us just put some documents in this index so for doing that even if you type something like this post you need to use post method post then index name just underscore doc doc means it is going to put documents now you need to uh give the documents here so you will just type the same file names here what you have been given book name so suppose the book name is wings of fire and here the author name apj abdul and number of coffees equal to 1000 okay just you have said uh the documents and run it okay it has been created now if you again run this search query you will be able to see this here here's inside hits there is the document data you are being able to see again suppose we are wanting to add another document just copy it okay we are changing the book name here so the book name is a brief history of time okay just run it run this query and it has been created again now if you want to see the list run it again and you will be able to see its value is two there is two documents are there there is a hits one there is the wings of fire here is the previous job time now this is the inquiry and now if you want to do search operation then just run post and here is the index name underscore search if you run this one you will get all the items if you run this and we want to filter out then you need to mention queries suppose we want to run match queries so you need to write query inside queried just type the match and here is the field name suppose book name and type the word by which you want to search suppose you want to search fire then if you run this you will get this result there is the fire this particular word has been matched the other document is missing here because there is no word fired in the other document and if you again run time then we'll get the another document that is the brief history of time it will be displayed so this is how the match query works i will in detail discuss about the match queries and all the other queries later but for the timing this is just a simple experience example of running the search query and another thing i just want to display here uh that if you want to face that that is selected instead of using the select star you just want to fetch some particular just you want to face the book name in that case you just keep the queries same just here you need to mention something underscore source okay and then you just need to write the field name that is the book name okay if you just run it then you will get only the book name value okay here and if you want to uh mention multiple films just make it an array and type your book name and number of copies suppose then the run it if you run it you will get these two fields okay this is how it works and also there is some sorting and filtering all these features are there i'm just skipping it for the time being later we'll display you about all those things we will discuss about uh in detail and another thing i want to show you here that is the skimmerless nature of elasticsearch because till now whatever the data we are entering into elasticsearch all those fields already has been pre-defined like our like we do in case of uh relational database management system that is in case of mysql or the sql server all these things okay but here elasticsearch is schema-less in nature that is if we put some data suppose this data we are going to copy and here just run this query book name numbers copies and suppose you are entering a new field that is category category so category is science suppose ignited minds i am name it and the writer name is also doctor so just run it now let's see what exactly it has been created and if we run the search query again we'll see here all the earlier documents have three fields but the new documents has forfeit because elasticsearch schemas is nature so if you do not already defined a particular field and you are wanting to put data then that particular field will automatically get created and if you want to see the uh description of this books index that is desc table name then you will see here the category a new field has been created automatically which we did not specify earlier so here the category field has been created and the type has been given as text so here we have see the installation of elastic search here in our terminal elastic search is running here in this terminal kibana is running and also here we have seen the given interface and by using which we have created indexes boot documents and also i did some basic search operations so later in our videos we will have detail discussion about all the search queries about the analyzers about the configuration entries all these things so for the time being in this video this is all okay thank you for watching if you feel this video is helpful please click on the like option and do subscribe my channel thank you for watching
Info
Channel: Learning Being
Views: 508
Rating: 5 out of 5
Keywords: elasticsearch installation, elasticsearch, elasticsearch tutorial, kibana, kibana installation, kibana setup, learn elasticsearch, elasticsearch hands-on experience
Id: u5ciXfR49no
Channel Id: undefined
Length: 27min 25sec (1645 seconds)
Published: Fri Mar 26 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.