Elasticsearch and Kibana Installation with Docker Compose | How to install Elasticsearch in docker

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone let's go ahead and see how you can install elasticsearch with the docker compose previously we have seen how you can install Docker how you can install elasticsearch and how you can install elasticsearch with Docker in today's lesson we are going to see how you can install elasticsearch and kibana with Docker compose so you need to search here Docker compose or you can say that here Docker elastic search alright so you will get here install elasticsearch with the docker basically we want here the latest version of elastic search just to understand that which Docker version we need to use so this is URL which we will be using as image URL in our Docker compose file now we need to also install Docker compose in our PC we have installed Docker but if you do not have installed Docker then you need to watch it at my channel you need to visit Here YouTube dot com forward slash kgp talkie so there we are having here a Docker video so you come to here videos and in this you will be seeing there you have how to install Docker in Ubuntu and then how to install elasticsearch and kibana with Docker so these two lessons you can watch otherwise you can also watch how you can install elasticsearch and configure elasticsearch on Ubuntu machine all right so here we have our Docker image which we will be using with our Docker compose I have already installed Docker as I have shown that in the video now we need to install here Docker compose so to install Docker compose you need to write here sudo opt get installed docker compose now you just need to run give a password here now it's going to install a Docker compose in your PC so once Docker compose is installed here now we are ready to make our Docker compose file so making a Docker compose file is very easy so what we need to do here we are going to create it here a new file all right so you can open here a new file then create uh here uh open a folder actually so I'm gonna open here a download folder inside this download folder I'm just gonna trust all the authors and then I'm gonna create here a new folder and in that I say here elasticsearch Docker compose it is just a folder name you can give any name to your folder thereafter I'm gonna create here new file inside that and for that I'm gonna give here Docker compose dot yml do remember this file name need to be Docker compose Dot yml thereafter it will ask you to install Docker compose yml so I'm just going to install that plugin for Docker compose here so it's going to install Docker there now we are able to see our Docker compose Dot yml and you can see there a logo of Docker as well so and one more thing we are using here a vs code Studio if you do not have vs code you can obviously download it from the internet and then you can use this this is very good uh Studio vs code Studio is really very good all right so we have here Docker compose Dot yml so we are going to install we we are going to make our Docker compose file so the process of making Docker compose file is very easy but before that let me uh show you here Docker compose version so here Docker compose overview you just need to open this it has multiple versions it has version 1 version 2 and then version 3. so the latest version in our uh the docker is actually the the version 3 there so for that version 3 we are going to make a file so I write here version and then the version name I'm gonna give here 3.9 do you see there the auto completion so this Auto completion is coming from this Docker Docker plugin which we have just installed in vs code so as we start writing it will start suggesting us the possible possible keywords thereafter I give here the services and thereafter I'm gonna give here the name of our service so basically we are going to install here the two service elasticsearch and kivana so for First Service I'm gonna I'm gonna write for elasticsearch which I have given a name here elasticsearch it thereafter I'm gonna give here the image path name so for image path name as I had shown you earlier that this is image path so I'm just gonna copy the that from here and then gonna paste it here so the docker.elastic.co elasticsearch elasticsearch 8.9.1 so this is elasticsearch image thereafter I'm gonna give here the container name and in container name I'm gonna give here es8 so the service name and the container name is same here es8 thereafter I'm gonna sit here the environment variables so there are many environment variables in elastic search which we need to set here like we need to set here node dot name and in that node name I'm gonna give here es8 an elasticsearch can be installed as a cluster so for that we also named we also need to give here cluster name later on if you need to start here cluster name is equal to ES Docker cluster this is just the name whatever the name you can choose you can give here es Docker cluster thereafter I'm gonna give here discovery type so how your kibana is going to discover this elastic search so I'm gonna give here Discovery DOT type equal to single node this is the discovery type here all right so we are done with the environment variables for elasticsearch now we need to assign here the volumes so the volumes is like where elasticsearch is going to store data and for that I give a name as a data this is just a data folder and once elasticsearch is installed since it is getting installed on Linux system then elasticsearch data will be stored inside user share and then elasticsearch forward slash data so basically whatever the data is inside the docker compose that we are going to map our the data inside the local file system so there I give here data thereafter we also need to give here the ports for ports I give here 9200 and column 9200 why so so elasticsearch inside the docker runs at 9200 now we are mapping this to outside the docker so that we can access it from anywhere from our computer or from the remote system thereafter we are also going to see here the networks the name of network on which elasticsearch and kibana will bind together so the name of network it is going to create there as elastic Network thereafter I'm gonna give here the kibana 8 that's the kibana image so setting for elastic search is complete here now we need to do for the Kiwana so it's going to be similarly like we are doing here so we are going to just copy this whole thing from here and then we paste it here thereafter docker.elastic dot Co and thereafter instead of this elastic there would be kevana and here it would be also kibana so we have kibana slash khivana 8.9.1 and thereafter here we have a container name so in container name we have kibana 8 because we are installing here version 8 of elasticsearch and kivana thereafter inside this environment file what we are going to have just a second so like we had set for our elastic search we need to set here our node name so I write here node.name and thereafter I'm gonna give here kibana 8 so I give here kibana 8. thereafter again here the cluster name we need to give cluster dot name equal to es Docker cluster so these clusters need to be same name otherwise it would start throwing the error thereafter one more thing we need to put here that that is the elastic search underscore hosts that means where your kibana is going to connect with elasticsearch so its elasticsearch.host and here I need to give here HTTP forward slash and then es8 and then colon 9200 let me explain you this process here we have given HTTP we are not giving https that means we need to disable the password so once this Docker starts running then we will disable the password for elasticsearch and then we will restart our Docker so this es8 name is coming from here container or service name or you can say the container name and then 9200 is default port for elastic search so this kibana will automatically try to connect this elastic search and then it will enable you to access elastic search through the kivana thereafter in the kibana we also need to map here the port so five six zero one two five six zero one thereafter we need to provide here the network so we provide here elastic Network because this elastic Network we are also using for our elastic search there so these kibana and elastic need to be on same network thereafter we are going to so these services are done now thereafter one more thing actually left here that is that depends on so this kibana depends on es8 that means kibana will not start before es8 starts so kibana have to wait until elastic surge starts here so Services part is complete here then I set here the volume is equal to data and thereafter in this data we need to sit here the driver and in this driver we have here the local driver that means that the data mapping for elastic search which we had done earlier that is going to map that data in your local system that means on your computer where your Docker is running thereafter we are going to also create here networks and in that I create here elastic and then this elastic driver we also need to provide here as a bridge driver that means elastic search and kibana can connect together I'm sorry I am getting some messages all right so our file is complete here you can simply save it now you need to open Terminal I'm just going to open Terminal from here itself make sure that in terminal you need to go inside the elastic search Docker compose and if you do here list files then you will be seeing Docker compose so from wherever you run your Docker compose up you have to make sure that your Docker compose file is in same directory thereafter Docker compose up just to build your Docker compose you need to write here Docker compose up and then build it's going to download the kibana and elasticsearch and then finally okay so there is some problem volume data must be mapping not a string let me just see something might have gone wrong here in volumes or in data somewhere let me just verify that here we have a data and thereafter volume okay so probably this space which I have here created it's not working properly because of space okay data must be mapping uh not a stream still something is wrong just a second okay okay so I found the problem problem is here the space so this space we need to remove whatever the space we have we need to just remove these spaces otherwise it would keep throwing that particular error here thereafter here we have additional space so we need to remove those space after this equal to sign once all these space are removed then you just need to run it here Docker compose a build seems like some more space or somewhere it is still left we just need to remove those white spaces here okay wait a second okay one more thing we got missed that here so the driver local there need to be here a space all right so this is now okay now we need to just run it it's going to pull all these elasticsearch and kibana images from the internet and then it will make it up and running we need to just wait for a while all right so server has started here you can see there you can see these logs that server has started now you can open your server here if you just type here localhost nine zero zero you will see that connection is reset here but if you type here https double forward slash you can see there it is going to ask here a password and username because we have not disabled the password for elasticsearch as of now thereafter you can check here 5601 for our kibana and for kibana you will see there we need to connect it with HTTP Port so it's not radiate the reason is elasticsearch needs a password and kibana is not able to connect with elasticsearch since we have already make sure we have also already made sure that Kiwana will start only if elasticsearch has started so now our task is to disable the password for elastic search so to disable the password for elasticsearch it's very simple process you need to come back here and then you need to connect your elastic search and then we will disable the password for your elastic search so as usual we need to write here the docker execute in user mode equal to root user and then connect it in interactive mode and the name of elasticsearch is es8 and then we are going to connect it with bin and Bin bias all right so we are going to open here bin bash as soon as we write that we are inside the elastic search and then here we need to write here up to get update so that we can update the index this we have been doing a lot with our previous lectures where I had so new how you can install elasticsearch and kivana here I had shown you how you can use the password and the without password thereafter we again need to come back here so you can see there all the Ubuntu index is updated thereafter you need to write here opt get install Nano all right perfect so it is going to take a while thereafter we move here and we write here CD config and then you can check there you have elasticsearch.yml so this particular things we are going to write so I write here Nano and then elasticsearch.yml so in this elasticsearch.yml we are going to make it as false other than that we are also going to make it as false so these two line of codes we needed to change and thereafter we are going to exit from here and then here we need to come back and then we are going to stop it again and thereafter we are going to run it here so either you can use Docker compose up and the build or you can just use the docker composer and up the first time when you run your uh the docker compose it will automatically do the build if build is not there now you can refresh the kibana it may take a while to connect this kivana in meantime you can check that if it is able to access your elastic search so the elastic search is here at the localhost 9200 so we are able to access here elasticsearch currently only issue to connect with the kibana now we can check kivana as well kivana must be ready by now we can check here 5601 now it's going to take a while to load the Kiwana now it's going to connect kivana you can check here the each you know the logs there the kibana has successfully connected you can check here explore my own data or you can or you can apply here a sample data itself all right so you can just uh type their other samples data maybe you can add these samples e-commerce data all right so it's going to add the samples e-commerce data this data is added and then once you come to here devtools you can just check that all the search data you can just copy it from here and then you can dismiss this and then paste it here and if you run it you would be able to see all those samples data all right this is searching here you see the women's clothes clothing all these things are here product code tax list price all these stuffs are here so you can now use your elasticsearch for your search system powering or whatever the purpose you are using to to to whatever the purpose for whatever the purpose you need elastic search you can use so congratulations we have successfully installed elastic search and Kiwana with the talker compose you can also watch these previous videos where I have shown how you can install Docker and how you can install elasticsearch and kibana with Docker but not Docker compose all right this is all about in this lesson thanks a lot for watching this I'll see you next one
Info
Channel: KGP Talkie
Views: 7,476
Rating: undefined out of 5
Keywords: kgp talkie, kgp talkie videos, machine learning tutorials, kgp talkie data science, kgp talkie ml, kgp talkie for machine learning, Elasticsearch, Kibana, Docker Compose, Elasticsearch installation, Kibana installation, Elasticsearch with Docker Compose, Kibana with Docker Compose, Data analytics, Data visualization, Elasticsearch setup, Kibana setup, Docker Compose tutorial, Latest Elasticsearch, Data exploration, Elastic tools
Id: UiJF5KFXE7U
Channel Id: undefined
Length: 19min 51sec (1191 seconds)
Published: Sat Sep 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.