tar -zxvf elasticsearch-6.2.3.tar.gz
cd elasticsearch-6.2.3/bin
./elasticsearch
容我修个错误
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
这个错误,是因为使用root用户启动elasticsearch,elasticsearch是不允许使用root用户启动的,所以我们需要添加用户,或者加一个参数。
cp -r elasticsearch-6.2.3 /usr/
su pactera
./elasticsearch
改成IP后无法公开ip
bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [2] bootstrap checks failed
又出现3个错误,继续踩坑
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]
错误2
vi elasticsearch.yml
加入2行
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
错误3
max virtual memory增加10倍总归没错了吧
临时增加
sysctl -w vm.max_map_count=655360
sysctl -a | grep "vm.max_map_count"
或者永久解决
vi /etc/sysctl.conf
vm.max_map_count=655360
sysctl -p
剩下错误1,最大文件描述
[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
然后需要重启下
192.168.209.160:9200 可以从外网访问了
windows 安装 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.msi