Install Elasticsearch and Kibana on EC2 in 20 minutes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys today I'm going to show you how to install elastic search and Cabana on an ec2 instance alright let's begin go to AWS management console then find and click on ec2 on the left sidebar click on instances now click on launch instance button first we have to select Amazon machine image let's select Ubuntu 1604 LTS then we should select an instance type micro which has 1gb RAM is enough to install elasticsearch and Cabana next go to configure instance details you don't need to change any value here keep default values and go to next as you can see we can get up to 30 GB of storage for free tear so change size to 30 GB and go to next to add tags again you don't need to do anything here can add a tag if you want then go to next now you have to configure the security group to access from any public IP address let's select all traffic for testing purposes but don't do this for production then click on review and launch button review what you've selected once again then click on launch button you can select either existing keep here or create a new key pair I'm going to create a new key pair as I don't have one let's name it as my ec2 then download the key pair you can see downloaded dot PEM file here finally click on launch instances button to launch the instance now our instance is being launched to see the instance click on view instances as you can see the new instance is still launching let's wait until it is up and running okay guys now our instance is up and running here you can see public DNS name and ipv4 public IP address you need them to access your instance I have put my ec2 PEM file to this elasticsearch folder type CMD in the address bar and hit enter to open command prompt I use command prompt to SSH my ec2 instance open commands dot txt file which includes all the commands we need you can find the link to text file on comments section first we SSH to our ec2 instance copy and paste this command to command prompt after SSH I add path name to your dot PEM key pair file as we installed Ubuntu in our instance use Ubuntu as the user name then after at sign copy public dns name of your ec2 instance now hit enter type yes great now we can access our ec2 instance let's enter this command to get updates you and also enter this command you now we need to install Java Runtime environment use this command to install JRE type-y to continue you let's check java version using this command all right Java is installed correctly let's install ng INX web server later it will help you to route Kabana you you see you know systemctl start command to start engines server check the status of webserver using sudo systemctl status command as you can see it's active and running let's try to access the web server using browser copy public IP address open a new tab and enter it in address bar and hit enter excellent is running now go back to the command prompt enter this command to add keys from elasticsearch you should get okay as the response then enter this command to add elasticsearch to sources list note that I use version 6.4 this tutorial let's get update again you now you see you know apt-get install elasticsearch command to install elasticsearch you before we start elasticsearch we have to configure some settings first open elasticsearch Hummel file you you can see some configurations here go to the end of the file and copy these configurations these configurations will allow public access to elasticsearch server also it enables cross-origin resource sharing don't use these configurations for production press control o and hit enter to save this file then press control X to exit after that open JVM options file using this command you change these heap space sizes from 1g to 128 m as we have 1gb ram this configuration will limit the heap size accordingly you save the file using ctrl o then exit using ctrl X now you can successfully start elasticsearch service use this command to start elasticsearch service you see you know systemctl enable command to and elasticsearch when boot up the instance let's check the status you great now it is active and running press Q to exit let's verify it using API request use this curl command note that I use 9200 as port number response you have successfully installed elasticsearch on your ec2 instance let's check whether we can access using our browser ad 9200 as the port number along with public IP address now we can access our elastic search service publicly as well go back to command prompt now I'm going to install cabana you cabaƱa is installed let's start service using this command also add Cabana when boot-up using this command check the status nice now cabana is also act and running okay let's configure ng INX settings Giroud Cabana enter this command it will ask you for a password I enter 1 2 3 4 5 4 now then re-enter the password - password as you wanted later then create a file with public IP address as the file name you should enter your public IP of ec2 instance now enter following lines to that file you can simply copy and paste remember again you have to enter your public IP instead of mine then save the file using ctrl oh and exit using ctrl X you also you have to create a shortcut of that file in ng I NX / sites enabled folder don't forget to use your public IP in this command to use this command to verify our configurations it should output successful restart the ng INX web server using this command you set its firewall to allow ng INX full you now we can visit Cabana using web browser open web browser type your public IP slash status it will ask you for a username and password as you can remember we have given user name as Cabana admin and password as one two three four five great you can see the Cabana interface but we need to enter some data to visualize let's go back to command prompt to add some data type exit to exit from SSH I have provided you some bulk data of movies you can find the link to sample movies dot bulk file in comment section you can copy it to the ec2 instance using SCP command here enter the keep air file source path and destination correctly it may take some time to upload the file you now login to ec2 instance again you then use this curl command to enter sample data set into elasticsearch note that I use localhost here not the public IP you all right we successfully installed and configured elasticsearch and Cabana exit from SSH then go back to Cabana and view our data go to manage section you you can see the created index on elasticsearch here let's create an index pattern on Cabana to visualize data enter movies as the index pattern go to next select I don't want to use the time filter then click on create index pattern button you can see the fields here now go to discover section here you can see all the sample data you added to elasticsearch under movies index also you can explore these data using available fields all right guys finally let's see how to build a simple search engine using elasticsearch API download an open sample side folder you can find the link on comments section I open command prompt here and use code dot command to open this folder in Visual Studio code you it is a very simple site developed using simple HTML CSS and JavaScript here you can find the JavaScript code you only need to enter base path and index name copy your public IP then enter HTTP slash your public IP : 9200 you remind that our index name was movies so add movies as the index you here get response function will call elasticsearch API to get data for a given query now open index.html file in your web browser you can search anything about movies here let's search for cars we got six results relevant to cars let's search for Avengers nice you can see the results congratulations on your simple movie search engine see you soon from a new video like this
Info
Channel: Brainstormers LK
Views: 4,646
Rating: undefined out of 5
Keywords: elasticsearch, kibana, elk stack, ec2, aws, amazon web services, aws ec2, logstash, search engine
Id: BpLDDuCaOTA
Channel Id: undefined
Length: 20min 14sec (1214 seconds)
Published: Thu Jun 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.