版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_29556507/article/details/89598288
我的环境是ubuntu16.04 内存2g
官网下载地址
https://www.elastic.co/cn/downloads/
修改elasticsearch.yml配置文件,允许外网访问。
vim config/elasticsearch.yml
# 增加
network.host: 0.0.0.0
http.port: 9200
遇到报错1 can not run elasticsearch as root
解决办法,在你的elasticsearch安装目录赋予一个不是root的用户
groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch
更改elasticsearch文件夹及内部文件的所属用户及组为elsearch:elsearch
chown -R elsearch:elsearch elasticsearch
elasticsearch
为你elasticsearch的目录名称
扫描二维码关注公众号,回复:
6396124 查看本文章
继续遇到的报错2 max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决办法
sudo /etc/sysctl.conf
vm.max_map_count=262144
sudo sysctl -p
遇到的问题3 bootstrap checks failed
解决办法
sudo vim /etc/security/limits.conf
增加以下内容
* soft nofile 65536
* hard nofile 65536
然后重新登录用户,就可以使用了
继续遇到问题4
the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
这时候继续编辑elasticsearch.yml文件,
将 #cluster.initial_master_nodes: ["node-1", "node-2"]
修改为 cluster.initial_master_nodes: ["node-1"],记得保存。
遇到问题五 java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
网上资料是这样说的
seccomp是linux kernel从2.6.23版本开始所支持的一种安全机制,seccomp(安全计算模式的简称)是Linux内核中的计算机安全设施。 它被合并到2005年3月8日发布的内核版本2.6.12中的Linux内核主线上。[1] seccomp允许进程单向转换为“安全”状态,除了exit(),sigreturn(),read()和write()之外,它不能对已经打开的文件描述符进行任何系统调用。 如果它尝试任何其他系统调用,内核将使用SIGKILL或SIGSYS [2] [3]终止进程。 从这个意义上说,它不会虚拟化系统的资源,而是将过程与它们完全隔离开来。
环境的内核是
Linux node 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
处理过程,在elasticsearch.yml 文件末尾加上bootstrap.system_call_filter: false
成功启动