es学习笔记二---ElasticSearch5.x 在远程Linux6.5服务器上搭建单个节点

一、本机去es官网下载elasticsearch 5.x tar包,博主下的5.2.2版本链接[https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.2.tar.gz],使用SecureFXPortable工具把下载好的es上传到远程服务器elasticsearch文件夹(自己mkdir)下这里写图片描述
非root用户
解压压缩包 tar -zvxf es-5.2.2.tar.gz,这时你去es5.2.2/bin里运行elasticsearch肯定报一大堆错,如果报Java错 ,那是你的Java版本太低,在服务器装上jdk1.8环境,去nodejs官网下载nodeJs 下载Linux版的,个人不推荐下载源码的方式装nodejs(比较麻烦)网址[https://nodejs.org/en/download/]这里写图片描述
下好了之后同上传es一样,上传到服务器上解压这里文件是xz结尾的,先去解压xz压缩 xz -d node-v6.11.0-linux-x64.tar.xz ,这时文件就变成 .tar结尾了,再去解压tar -xvf *.tar,切换至root用户给node和npm添加软性连接,感觉node不需要也可以。
创建软性连接
ln -s home/用户文件夹/nodejs文件夹/bin/npm /usr/local/bin/npm。
npm -v查看版本
下载elasticsearch-head githup上
npm install -g grunt-cli 全局安装grunt
进入es head文件夹 npm install
vi grunt.js 94行hostname:“*”
grunt server 可以启动head插件了
二、es启动遇到的问题(查阅资料,简单记录方便以后阅读)
elasticsearch 5.0 安装过程中遇到了一些问题,通过查找资料几乎都解决掉了,这里简单记录一下 ,供以后查阅参考,也希望可以帮助遇到同样问题的你。

问题一:警告提示

[2016-11-06T16:27:21,712][WARN ][o.e.b.JNANatives ] unable to install syscall filter:

Java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
at org.elasticsearch.bootstrap.Seccomp.linuxImpl(Seccomp.java:349) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Seccomp.init(Seccomp.java:630) ~[elasticsearch-5.0.0.jar:5.0.0]

报了一大串错误,其实只是一个警告。

解决:使用心得Linux版本,就不会出现此类问题了。

问题二:ERROR: bootstrap checks failed

max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]

解决:切换到root用户,编辑limits.conf 添加类似如下内容

vi /etc/security/limits.conf

添加如下内容:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

问题三:max number of threads [1024] for user [lish] likely too low, increase to at least [2048]

解决:切换到root用户,进入limits.d目录下修改配置文件。

vi /etc/security/limits.d/90-nproc.conf

修改如下内容:

  • soft nproc 1024

修改为

  • soft nproc 2048

问题四:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]

解决:切换到root用户修改配置sysctl.conf

vi /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令:

sysctl -p

es.yml 还要加上
http.cors.enabled: true
http.cors.allow-origin: “*”
不然head发现不了
修改es.yml添加
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
Linux6.5不支持SecComp,而ES5.2.1默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。详见
[https://github.com/elastic/elasticsearch/issues/22899]
切换至es/bin ./elasticsearch启动es 访问服务器地址!这里写图片描述
就可看到你的es了,head也装好了,head可以自己装在Windows上也行去连接远程的es,个人笔记

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值