1, the installation JDK8 (Elastic need Java 8 environment)
1) Download the file jdk8: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html \
2) Unzip the file: tar -zxvf jdk-8u191-linux-x64.tar.gz
3) will move to JDK /usr/local/jdk1.8.0_191
in directory: mv jdk1.8.0_191 /usr/local/jdk1.8.0_191
4) configuration environment variable:
a)vi /etc/profile
b) added to the end
export JAVA_HOME=/usr/local/jdk1.8.0_191
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH:$HOME/bin
c)source /etc/profile
5) Verify that the installation was successful: java -version
2, installation Elastic
1) Download Elastic: wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.tar.gz
2) Unzip the file: tar -zxvf elasticsearch-6.5.0.tar.gz
3) Installation: mv elasticsearch-6.5.0 / opt
3. Create a user Elasticsearch
es provisions of the root user can not start es, so it is necessary to create a new user to start the other es modify the configuration file
1) add a user: adduser esuser
2) Set a password: passwd esuser
3) add the permission: chown -R esuser /opt/elasticsearch-6.5.0
4, modify the configuration file
1) Enter /opt/elasticsearch-6.5.0/config directory using vi editor: vi elasticsearch.yml (Note: No spaces in front of the colon, must be followed by a space)
2) to cancel the following comments, and modify the current host address:
cluster.name: My-file application
node.name: Node. 1-
bootstrap.memory_lock: to false
network.host: 10.100.2.235
http.port,: 9200
discovery.zen.ping.unicast.hosts: [ "10.100.2.235"]
discovery.zen.minimum_master_nodes: 1 # Note that, because the current I is a single node, there must be 1
3) added as follows:
transport.tcp.port: 9300
transport.tcp.compress: to true
bootstrap.system_call_filter: to false
. 4) using vi editor and modify /etc/sysctl.conf file, add the following code (if not there will be the following FAQ 2):
vm.max_map_count = 262144
5) Run the following command after exiting save:
sysctl -p
6) using the vi editor, modify /etc/security/limits.conf file, add the following code at the end of the file (if not there will be the following FAQ 3):
# esuser for the user login name server
esuser Soft nofile 65536
esuser Hard 65536 nofile
esuser Soft nproc 4096
esuser Hard nproc 4096
5, start Elasticsearch
1) The user switches
SU esuser
2) the user to view the current
WHO I AM
. 3) to start the service
elasticsearch-6.5.0 / bin / elasticsearch
. 4) backgrounding
elasticsearch-6.5.0 / bin / elasticsearch -d
. 5) to test whether a successful start
curl - XGET 'http://10.100.2.235:9200/'