Use Elasticsearch5.0 must be installed jdk1.8
[Email protected] bin]$ java-"1.8.0_112"1.8. 0_112- 25.112-B15, mixed mode) [[email protected]
You will encounter the following issues when starting ES with the root account
[2016-11-14t10:05:29,358][warn [ O.e.b.elasticsearchuncaughtexceptionhandler] [] uncaught exception in thread [main] Org.elasticsearch.bootstrap.StartupException:java.lang.RuntimeException:can not run Elasticsearch as Rootat Org.elasticsearch.bootstrap.Elasticsearch.init (elasticsearch.java:116) ~[elasticsearch-5.0.0.jar:5.0.0]at Org.elasticsearch.bootstrap.Elasticsearch.execute (elasticsearch.java:103) ~[elasticsearch-5.0.0.jar:5.0.0]at Org.elasticsearch.cli.SettingCommand.execute (settingcommand.java:54) ~[elasticsearch-5.0.0.jar:5.0.0]at Org.elasticsearch.cli.Command.mainWithoutErrorHandling (command.java:96) ~[elasticsearch-5.0.0.jar:5.0.0]at Org.elasticsearch.cli.Command.main (command.java:62) ~[elasticsearch-5.0.0.jar:5.0.0]at Org.elasticsearch.bootstrap.Elasticsearch.main (elasticsearch.java:80) ~[elasticsearch-5.0.0.jar:5.0.0]at Org.elasticsearch.bootstrap.Elasticsearch.main (elasticsearch.java:73) ~[elasticsearch-5.0.0.jar:5.0.0]
Solution:
Create a new user because the security issue elasticsearch not run directly with the root user
-G elsearch-p Elasticsearch
When you start es with Elsearch, you encounter the following issues
error:bootstrap checks Failedmax file descriptors [10240] forElasticsearch process likely too low, increase to at least [65536]max number of threads [1024x768] forUser [Elsearch] likely too low, increase to at least [2048]maxVirtualMemory Areas Vm.max_map_count [65530] Likely too low, increase to at least [262144][ .- One-14t10: A: -,569][info][o.e.n.node] [mysteel-Node1] stopping ... [ .- One-14t10: A: -,615][info][o.e.n.node] [mysteel-Node1] stopped[ .- One-14t10: A: -,615][info][o.e.n.node] [mysteel-Node1] Closing ... [ .- One-14t10: A: -,638][info][o.e.n.node] [mysteel-node1] Closed
Workaround reference: http://www.cnblogs.com/sloveling/p/elasticsearch.html
Switch to root user
Vi/etc/security/limits.conf
Add the following content:
65536 131072 2048 4096
Vi/etc/security/limits.d/90-nproc.conf
Modify the following content: 1024x768 #修改为 2048
Vi/etc/sysctl.conf
Add the following configuration: Vm.max_map_count=655360
-P
Then, restart Elasticsearch to start the success.
Elasticsearch5.0 Installation Problem Collection