[0:00]Hello, welcome to a new video. In this video, we're going to see how to install the Elastic Stack. It's a series of tools from the company Elastic that allows us to manage and analyze data. Specifically, we're going to install it on an Ubuntu 22.04 operating system, although it's very similar on other distributions like Debian or Linux Mint. Let's start by seeing the architecture that we are going to set up in this video. In this video, we're going to have three servers, each one with an installed role, an Elastic Search server, a Kibana server, and a Logstash server. They are separated because these are the recommended architectures for production environments. However, if you're going to use it for development or for testing, you can install everything on a single server without any problem. Let's start with the installation of the Elastic Search server. The first thing we're going to do is install Java. Elastic Search is developed in Java, so it needs the Java runtime environment to run. In this case, we're going to install OpenJDK version 17. The first thing is to update the package index of our Ubuntu. Once updated, we install the OpenJDK 17 JRE. Once Java is installed, the next thing is to download and install Elastic Search. For this, we're going to download the public GPG key to verify the integrity of the downloaded packages. Once downloaded, we add the Elastic Search repository to our system's package list. Once added, we update the package index again to include the new repository. Now, we can install Elastic Search using the apt command. Once installed, the next thing is to configure Elastic Search. The first thing is to edit its main configuration file, which is located in /etc/elasticsearch/elasticsearch.yml. We're going to change several parameters here. The first one is cluster.name. We're going to give it the name my-cluster. Then, we're going to change the node.name parameter. In this case, we're going to put node-1. And now, the most important parameters. We're going to change the network.host to 0.0.0.0. This means that Elastic Search will listen on all network interfaces of the server. Then, the http.port, which by default is 9200, we're going to leave it as is. And then, we're going to activate the discovery.seed_hosts, which are the hosts that are going to form part of our cluster. We're going to activate this option, and here, we're going to put the IP of our server where Elastic Search is installed. Also, we're going to activate the cluster.initial_master_nodes and we're going to put the same IP of our Elastic Search server. Once these parameters are changed, we save the file. Now, we're going to configure the Java heap size. By default, Elastic Search allocates 1 GB of RAM for the Java heap. If our server has more RAM, it's recommended to increase it. In our case, the server has 4 GB of RAM, so we're going to allocate 2 GB to the Java heap. We edit the jvm.options file, which is located in /etc/elasticsearch/jvm.options. And here, we modify these two lines. As you can see, the default is 1 GB. We're going to change it to 2 GB. Once changed, we save the file. Now, we're going to start the Elastic Search service and enable it to start automatically at system startup. We execute the following commands. And we can check its status using systemctl status elasticsearch. As you can see, the service is running correctly. Now, we're going to verify that Elastic Search is working correctly. For this, we can make an HTTP request to port 9200 of our server. And as you can see, it returns a JSON with information about the Elastic Search cluster. This means that Elastic Search is working correctly. Now, let's install Kibana. Kibana is the graphical interface that allows us to interact with Elastic Search. The first thing is to download the public GPG key to verify the integrity of the downloaded packages. Once downloaded, we add the Kibana repository to our system's package list. Once added, we update the package index again to include the new repository. Now, we can install Kibana using the apt command. Once installed, the next thing is to configure Kibana. We edit its main configuration file, which is located in /etc/kibana/kibana.yml. We're going to change several parameters here. The first one is server.port. We're going to leave it by default, which is 5601. Then, server.host. We're going to put 0.0.0.0 so that Kibana listens on all network interfaces of the server. Then, the elasticsearch.hosts. Here, we're going to put the IP of our Elastic Search server. And finally, the i18n.locale. This allows us to change the language of Kibana. By default, it's English, but we can change it to Spanish if we want. Once these parameters are changed, we save the file. Now, we're going to start the Kibana service and enable it to start automatically at system startup. We execute the following commands. And we can check its status using systemctl status kibana. As you can see, the service is running correctly. Now, we're going to verify that Kibana is working correctly. For this, we access our Kibana server through its IP address and port 5601. And as you can see, the Kibana interface appears, which means that Kibana is working correctly. Now, let's install Logstash. Logstash is a data processing pipeline that allows us to collect, transform, and send data to Elastic Search. The first thing is to download the public GPG key to verify the integrity of the downloaded packages. Once downloaded, we add the Logstash repository to our system's package list. Once added, we update the package index again to include the new repository. Now, we can install Logstash using the apt command. Once installed, the next thing is to configure Logstash. We're going to create a simple configuration file that allows us to receive data through TCP and send it to Elastic Search. We're going to create a file called tcp-to-elasticsearch.conf in the /etc/logstash/conf.d directory. This file will have the following content. In the input section, we configure a TCP input plugin that listens on port 5000. In the filter section, we're not going to apply any filter in this example, but here we could apply filters to transform the data. And in the output section, we're going to configure an Elastic Search output plugin that sends the data to our Elastic Search server. Once the file is created, we save it. Now, we're going to start the Logstash service and enable it to start automatically at system startup. We execute the following commands. And we can check its status using systemctl status logstash. As you can see, the service is running correctly. Now, we're going to verify that Logstash is working correctly. For this, we're going to send a message to Logstash through TCP using the netcat command. Then, we'll go to Kibana to verify that the message has been indexed in Elastic Search. We send a test message using netcat to port 5000 of our Logstash server. Now, we go to Kibana. In the main menu, we go to Analytics, then Discover. And here, we can see that the message we sent has been indexed in Elastic Search. This means that Logstash is working correctly, sending the data to Elastic Search. And that's all for this video. We've seen how to install the Elastic Stack on Ubuntu 22.04. I hope it has been useful to you. If you have any questions, you can leave them in the comments. Thank you for watching, and see you in the next video.
Transcript source
AI audio transcription
This transcript was generated from the video's audio because no usable YouTube caption track was available. The transcript below is server-rendered so it can be read, searched, cited, and shared without opening the original YouTube player.
Pull quotes
[0:00]It's a series of tools from the company Elastic that allows us to manage and analyze data.
[0:00]Specifically, we're going to install it on an Ubuntu 22.04 operating system, although it's very similar on other distributions like Debian or Linux Mint.
[0:00]Let's start by seeing the architecture that we are going to set up in this video.
[0:00]In this video, we're going to have three servers, each one with an installed role, an Elastic Search server, a Kibana server, and a Logstash server.
Use this transcript
Related transcript hubs
Watch on YouTube
Share
MORE TRANSCRIPTS



