Elasticsearch installation on the server vps DA
As the need arose recently elasticsearch installation and it is not too demanding decided to describe how we can make the installation in a few very simple steps.
So let's get started.
All software requires a minimum version of Java 1.7 So at the beginning we will update the repo and install java.
System update:
1 | yum update |
java installation a lot:
1 | yum install java-1.8.0-openjdk.x86_64 |
If everything went ok after entering the command java -version You should get :
1 2 3 | openjdk version "1.8.0_65" OpenJDK Runtime Environment (build 1.8.0_65-b17) OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode) |
then we grab the key and create a repository elasticsearch
1 | rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch |
1 | nano /etc/yum.repos.d/Elasticsearch.repo |
/etc/yum.repos.d/Elasticsearch.repo file should have a content:
1 2 3 4 5 6 | [elasticsearch-2.x] name=Elasticsearch repository for 2.x packages baseurl=http://packages.elastic.co/elasticsearch/2.x/centos gpgcheck=1 gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch enabled=1 |
We do instlacji:
1 | yum -y install elasticsearch |
1 | chkconfig --add elasticsearch |
It remained practically the whole work we made some editing in the same configuration elasticsearch we released it to the world.
We do edit the file /etc / elasticsearch / elasticsearch.yml
1 | nano /etc/elasticsearch/elasticsearch.yml |
and change:
1 2 3 4 5 6 7 8 9 10 11 | # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: node-1 # # Add custom attributes to the node: # #node.rack: r1 # # ----------------------------------- Paths ------------------------------------ |
node.name: node 1 should be commented on.
next
1 2 3 4 5 6 7 8 9 10 11 12 | # ---------------------------------- Network ----------------------------------- # # Set the bind address to a specific IP (IPv4 or IPv6): # network.host: IPSERWERA # # Set a custom port for HTTP: # http.port: 9200 # # For more information, see the documentation at: # <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html> |
Then, from commenting 2 options:
network.host: IPSERWERA and give your server ip and vps
http.port: 9200 – it is a port in which we see on the web elasticsearch
after making these changes we can save and run the script.
1 | service elasticsearch start |
If everything goes correctly at IPSERWERA:9200 we should see something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 | { "name" : "node-1", "cluster_name" : "elasticsearch", "cluster_uuid" : "YYRBLSq4SH2CVVkn1U4Fxw", "version" : { "number" : "2.4.6", "build_hash" : "5376dca9f70f3abef96a77f4bb22720ace8240fd", "build_timestamp" : "2017-07-18T12:17:44Z", "build_snapshot" : false, "lucene_version" : "5.5.4" }, "tagline" : "You Know, for Search" } |
Everything works perfectly fine 🙂
If you do not see SRON must add a port 9200 do allow firewalla.