赞
踩
下载好需要的版本之后解压只相应的文件夹
需要jdk环境
elasticsearch启动 ./elasticsearch -d
kibana 启动 nohup ./bin/kibana > nohub.out &
都是后台启动
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:100) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:176) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.1.1.jar:5.1.1]
... 6 more
因安全因素 需要在非root环境下运行
新建用户 如:
groupadd els
useradd -g els els
创建过后执行
chown els:els elasticsearch
文件夹授权给els用户,然后切换至els用户 执行./elasticsearch
可以查看错误日志
ERROR: bootstrap checks failed
max file descriptors [65535] for elasticsearch process is too low,increase to at least [65536]
max virtual memory areas vm.max_map_count[65530] is too low, increase to at least [262144]
出现此错误是因为系统参数没有修改,需要修改如下
vim /etc/security/limits.conf 增加
els soft nofile 65536
els hard nofile 65536
修改过后需重新登录用户 使用ulimit -Hn
查看
然后打开sysctl.conf 修改
vim /etc/sysctl.conf 添加
vm.max_map_count=262144
执行sysctl -p使之生效
开启外网访问并且验证
~ vim config/elasticsearch.yml 修改
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE
http.cors.allow-headers: "X-Requested-With,Content-Type,Content-Length, X-User"
修改之后重启即可
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。