Elasticsearch6.5.1之head插件安装

安装NodeJS

yum -y install nodejs
执行node -v确认nodejs是否安装成功

修改ES配置

修改要监控的es配置文件$ES_INSTALL_PATH/config/elasticsearch.yml,新增跨域配置
http.cors.enabled: true #允许跨域
http.cors.allow-origin: “*”

安装grunt,修改head配置

下载head包,解压

cd ~/elasticsearch-head/
npm install -g grunt
npm install -g grunt-cli
vim ~/elasticsearch-head/Gruntfile.js,新增hostname:’’,
connect: {
server: {
options: {
hostname:’
’,
port: 9100,
base:’.’,
keepalive:true
}
}
cd ~/elasticsearch-head/
npm install

启动head插件

cd ~/elasticsearch-head/node_modules/grunt/bin/ && nohup grunt server &
访问:http://ip:9100/

坑1:

npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression

解决:

spdx license,vim ~/elasticsearch-head/package.json,找到license位置,值修改为Apache-2.0

坑2:

java.io.FileNotFoundException: /root/elasticsearch-6.5.1/logs/elasticsearch_index_search_slowlog.log (权限不够)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:133)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
原因: 文件所有者不是当前用户

解决:

退回解压目录, 更改整个文件夹的所有者为当前用户
chown -R es:es elasticsearch-6.5.1

坑3:

ERROR: [2] bootstrap checks failed
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

解决:

su root, vim /etc/security/limits.conf

  •    hard    nofile           65536
    
  •    soft    nofile           65536
    

坑4:

ERROR: bootstrap checks failed
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
sysctl -p

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值