You should read the article “Introduction to Central Log Management with Elastic Stack -1” before this article. In this article, we will install elasticsearch on ubuntu server 19.10 with 10.250.2.221 IP. Elasticsearch version will be 6.
First of all, let’s look at the version and ip address of our server;
Check Ubuntu version and IP
root@elastic:~# cat /etc/issue.net
Install less package on Ubuntu
Let’s install the less package.
root@elastic:~# apt-get install openjdk-8-jre-headless -y
Install Elastichsearch on Ubuntu
Now we can download the repo of elasticsearch 7 to our server and install elasticsearh. Our necessary commands for these are as follows.
root@elastic:~# wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add –
root@elastic:~# echo “deb https://artifacts.elastic.co/packages/6.x/apt stable main” | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
root@elastic:~# sudo apt-get update && sudo apt-get install elasticsearch
Before running Elasticsearch’s services, let’s define cluster name and node name in elasticsearch in the configuration file.
And let’s specify what IP address the elasticsearch service should run on the server. In addition, we don’t have an elastic cluster, but let’s enter at least one node in the discover.seed_hosts configuration for the elastic service to work.
root@elastic:~# vim /etc/elasticsearch/elasticsearch.yml
Enable and Run Elasticsearch
We can now enable and run elasticsearch services.
root@elastic:~# service elasticsearch start
root@elastic:~# systemctl start elasticsearch.service
root@elastic:~# netstat -antp | grep java
root@elastic:~# service elasticsearch status
Our elasticsearch service has now started. Using curl, let’s verify that our elasticsearch service is running and observe that the configurations we made are working correctly.
root@elastic:~# curl http://10.250.2.221:9200
We successfully installed and run Elasticsearh on our server. In the next article of the series, we will install logstash on 10.250.2.222 server and transfer a dummy data to elasticsearch.
You can read our other articles in this serie from the links below.