Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

ELK experiment (2) installing Elastic Search single Node

Shulou Source: shulou.com Published: 2022-06-02 22:12:50 10月03日 Update

Linux installation

java -version

echo $JAVA_HOME

No return, environment is not set well...

vi /etc/profile

export JAVA_HOME=/usr/java/jdk1.8.0_162

export JRE_HOME=$JAVA_HOME/jre

export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH

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

Refresh

source /etc/profile

have

download

curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.tar.gz

tar -zxvf elasticsearch-6.2.3.tar.gz

cd elasticsearch-6.2.3/bin

./ elasticsearch

Allow me to correct a mistake.

org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

This error is caused by using root to start elasticsearch. elasticsearch is not allowed to be started by root, so we need to add a user or add a parameter.

cp -r elasticsearch-6.2.3 /usr/

su pactera

./ elasticsearch

Exception in thread "main" java.nio.file.AccessDeniedException: /usr/elasticsearch-6.2.3/config/jvm.options

Allow me to correct one more mistake.

I feel like I don't have permission on the directory. Add one.

chown pactera /usr/elasticsearch-6.2.3/ -R

chown -R Folder name User name

Memory settings are small, but can be ignored

You can use this before ES5, but not before ES 6.

vi bin/elasticsearch

ES_JAVA_OPTS="-Des.insecure.allow.root=true"

Or start adding parameters

./ elasticsearch -Des.insecure.allow.root=true

Run as a background service

./ elasticsearch -d

curl -i localhost:9200

Local access has data, but remote access cannot, allow me to fix an error

vi config/elasticsearch.yml

network.host: 0.0.0.0

After changing to IP, IP cannot be disclosed

bound or publishing to a non-loopback address, enforcing bootstrap checks

ERROR: [2] bootstrap checks failed

Three more errors. Keep going.

ERROR: [3] bootstrap checks failed

[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

[2]: memory locking requested for elasticsearch process but memory is not locked

[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Error 2

vi elasticsearch.yml

Add 2 lines

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

error 3

Max virtual memory is increased by 10 times, right?

temporary increase

sysctl -w vm.max_map_count=655360

sysctl -a | grep "vm.max_map_count"

Or permanently.

vi /etc/sysctl.conf

vm.max_map_count=655360

sysctl -p

Error 1 left, maximum file description

[2018-04-16T10:43:04,079][INFO ][o.e.b.BootstrapChecks ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks

ERROR: [1] bootstrap checks failed

[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

vi /etc/security/limits.conf

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

And then we need to reboot.

192.168.209.160:9200 can be accessed from the external network

Windows installation

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.msi

This component is a complete idiot...

Tags: Error user parameter file no maximum fool memory background sense data folder permissions environment user name directory component permanent service run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux Shulou Information MySQL Huawei