Question 1 >>>ElasticsearchUser Problems
Report an error:
[WARN ][] [] uncaught exception in thread[main]
: : can not run elasticsearch as root
analyze:
Literally, Elasticsearch is not allowed to be run with root users.
In fact, for the sake of security, ElasticSearch does not allow logging in as root user, and needs to switch to other system users.
solve:
Switch users and grant permissions.
# Add user
useradd elasticsearch;
# Grant permissions
chown -R elasticsearch:elasticsearch elasticsearch-x.x.x;
# Switch users
su elasticsearch
# start up
./bin/elasticsearch
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Question 2 >>> JDK version problem
Report an error:
Exception in thread “main” :
org/elasticsearch/tools/java_version_checker/JavaVersionChecker : Unsupported version 51.0
analyze:
The number 51 appears in the error message, and its meaning is that you should at least use JDK7. (Here we add a few corresponding relationships between numbers and versions: 52.0/8.0, 51.0/7.0, 50.0/1.6, 49.0/1.5)
What, the JDK version is actually too low? Why not echo:
[elasticsearch@mac bin] echo $JAVA_HOME
/usr/java/default
- 1
- 2
Sure enough, Elasticsearch found the wrong path by default, and it was not used.jdk1.8.0_181。
solve:
Configure the startup script and manually specify the JDK to be started.
# Enter the startup script
vim bin/elasticsearch
# Append two lines and specify JDK
export JAVA_HOME=/home/yutao/jdk1.8.0_181/
export PATH=$JAVA_HOME/bin:$PATH
- 1
- 2
- 3
- 4
- 5
- 6
Question 3 >>> System resource configuration issues
Report an error:
1)max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
2)max number of threads [2048] for user [chenyn] is too low, increase to at least [4096]
3)max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
analyze:
1) Insufficient file handle
2) The maximum number of threads to start
3) Set insufficient virtual storage
solve
1)
# Enter the configuration file
vim /etc/security/limits.conf
#Add/Modify
soft nofile 65536
hard nofile 131072
soft nproc 2048
hard nproc 4096
- 1
- 2
- 3
- 4
- 5
- 6
- 7
2)
# Enter the configuration file
vim /etc/security/limits.d/20-nproc.conf
#Add/Modify
soft nproc 4096
- 1
- 2
- 3
- 4
3)
# Enter the configuration file
vim /etc/sysctl.conf
#Add/Modify
vm.max_map_count=262144
# Make the configuration effective
sysctl -p
- 1
- 2
- 3
- 4
- 5
- 6
Question 4 >>> Not supported behindComponentsquestion
Report an error:
[unknown] unable to install syscall filter:
: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
analyze:
SecComp is not supported after Centos6, while Elasticsearch is enabled by default.
solve:
Just disable it.
# Enter the configuration file
vim config/elasticsearch.yml
#Add/Modify
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
- 1
- 2
- 3
- 4
- 5
- 6