ElasticSearch5.x以及head插件的安装,以及安装过程中遇到的问题

ElasticSearch

版本选择

elasticsearch 5.x -----> jdk 1.8+
NodeJs 6.x+

ElasticSearch下载

ElasticSearch-Header下载

NodeJs下载

elasticsearch启动

./bin/elasticsearch
访问: 127.0.0.1:9200  //这是在linux本地访问

elasticsearch-header启动

----初始化----
需要在elasticsearch-header下执行  npm install  (网络一定要好)
----启动----
npm run start
访问: localhost:9100

如果需要外网访问,重点

  • vim elasticsearch.yml
修改:
network.host = 自己的主机ip
##外部可以访问
http.cors.enabled: true
http.cors.allow-origin: "*"

  • vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131070
* soft nproc 2048
* hard nproc 4096

这个配置文件修改后,需要重新登录用户才会生效,就是要重新登录es的启动用户,或者reboot
  • vim /etc/security/limits.d/90-nproc.conf
注释掉里面的内容:
添加:
soft nproc 5000
hard nproc 5000
root soft nproc 5000
root hard nproc 5000
  • vim /etc/sysctl.conf
添加:
vm.max_map_count=655360

这个配置文件保存后,需要执行 sysctl -p

启动elasticsearch遇到的错误以及注意

1.不能用root用户启动
2.用其他用户启动时 需要赋予用户这个目录的权限 chmod -R xxx /elasticsearch
3.java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
	原因:Centos6不支持SecComp,而ES有些版本默认bootstrap.system_call_filter为true
    解决:  在elasticsearch.yml中
    	添加:  
    		bootstrap.seccomp: false
    	或者添加:
    		bootstrap.memory_lock: false   
			bootstrap.system_call_filter: false
		## 如果有类似此错误,都添加上
4.max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    解决:vi /etc/sysctl.conf  添加: vm.max_map_count = 655360
5.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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值