CentOS installation ElasticSearch6

 (1) Configuration JDK environment

 

Configuration environment variable

 

export JAVA_HOME="/opt/jdk1.8.0_144"

 

export PATH="$JAVA_HOME/bin:$PATH"

 

export CLASSPATH=".:$JAVA_HOME/lib"

 

(2) Installation ElasticSearch6.2.4

 

Download: https: //www.elastic.co/cn/downloads/elasticsearch

 

Start being given:

 

 

 

Solution: bin / elasticsearch -Des.insecure.allow.root = true

 

Or modify bin / elasticsearch, plus ES_JAVA_OPTS property: ES_JAVA_OPTS = "- Des.insecure.allow.root = true"

 

Start again:

 

 

 

This is due to the condition of the system security settings. Since ElasticSearch can receive user input and execute scripts, for system security reasons, we recommend creating a separate user to run ElasticSearch.

 

Creating user groups and users:

 

groupadd esgroup

 

useradd esuser -g esgroup -p espassword

 

Their user and group changes elasticsearch folders and files inside:

 

cd /opt

 

chown -R esuser:esgroup elasticsearch-6.2.4

 

Switch users and run:

 

its esuser

 

./bin/elasticsearch

 

Shows start killing again:

 

 

 

You need to adjust JVM memory size:

 

we bin / elasticsearch

 

ES_JAVA_OPTS="-Xms512m -Xmx512m"

 

Start again: successful start

 

If a similar message is shown below:

 

INFO [ZAds5FP] low disk watermark [85%] exceeded on ZAds5FPeTY-ZUKjXd7HJKA[/opt/elasticsearch-6.2.4/data/nodes/0] free: 1.2gb[14.2%], replicas will not be assigned to this node

 

You need to clean up disk space.

 

Background: ./ bin / elasticsearch -d

 

Test Connection: curl 127.0.0.1:9200

 

会看到一下JSON数据: [root@localhost ~]# curl 127.0.0.1:9200 { "name" : "rBrMTNx", "cluster_name" : "elasticsearch", "cluster_uuid" : "-noR5DxFRsyvAFvAzxl07g", "version" : { "number" : "5.1.1", "build_hash" : "5395e21", "build_date" : "2016-12-06T12:36:15.409Z", "build_snapshot" : false, "lucene_version" : "6.3.0" }, "tagline" : "You Know, for Search" }

 

Remote Access: the need to configure the config / elasticsearch.yml: network.host: 192.168.1.110

 

 

 

The first error handling:

 

vim /etc/security/limits.conf // file last to join

 

esuser soft nofile 65536

 

esuser hard nofile 65536

 

esuser soft nproc 4096

 

esuser hard nproc 4096

 

The second error handling:

 

Modify the configuration file into the limits.d directory.

 

vim /etc/security/limits.d/20-nproc.conf amended as esuser soft nproc 4096

 

The third error handling: vim /etc/sysctl.conf

 

vm.max_map_count=655360

 

Execute the following command to take effect: sysctl -p

 

Turn off the firewall: systemctl stop firewalld.service

 

Successful start again!

 

External access, remember to host yml file Kibana ES and configured to 0.0.0.0

Guess you like

Origin www.cnblogs.com/-levi/p/11401806.html