ubuntu下配置 elasticsearch6 的一点问题

本来想图省事, 怕Linux下的各种报错, 于是提前照着网上的说明改了yml文件, 最后发现无论怎么操作elasticsearch都起不来,一怒之下删了Ubuntu镜像,重新安装了Java jdk环境和elasticsearch, 原生配置,才发现了问题。

[2018-02-07T13:07:44,917][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [aggs-matrix-stats]
[2018-02-07T13:07:44,917][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [analysis-common]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [ingest-common]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [lang-expression]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [lang-mustache]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [lang-painless]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [mapper-extras]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [parent-join]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [percolator]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [rank-eval]
[2018-02-07T13:07:44,918][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [reindex]
[2018-02-07T13:07:44,919][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [repository-url]
[2018-02-07T13:07:44,919][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [transport-netty4]
[2018-02-07T13:07:44,919][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] loaded module [tribe]
[2018-02-07T13:07:44,919][INFO ][o.e.p.PluginsService     ] [Hl7YsCM] no plugins loaded
[2018-02-07T13:07:57,635][INFO ][o.e.d.DiscoveryModule    ] [Hl7YsCM] using discovery type [zen]
[2018-02-07T13:07:58,696][INFO ][o.e.n.Node               ] initialized
[2018-02-07T13:07:58,702][INFO ][o.e.n.Node               ] [Hl7YsCM] starting ...
[2018-02-07T13:07:59,203][INFO ][o.e.t.TransportService   ] [Hl7YsCM] publish_address {192.168.67.131:9300}, bound_addresses {[::]:9300}
[2018-02-07T13:07:59,287][INFO ][o.e.b.BootstrapChecks    ] [Hl7YsCM] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-02-07T13:07:59,310][INFO ][o.e.n.Node               ] [Hl7YsCM] stopping ...
[2018-02-07T13:07:59,374][INFO ][o.e.n.Node               ] [Hl7YsCM] stopped
[2018-02-07T13:07:59,375][INFO ][o.e.n.Node               ] [Hl7YsCM] closing ...

第一次启动时,我发现它自动关闭了, 报告了两个错误, 第一个网上说把bootstrap 改为false就可以了, 因为我没有在版本6的config里找到选项,所以就没理它, 第二个 [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] 人家提醒的已经很明显了, 去/etc/sysctl.conf 里, 把虚拟内存设大点就好了,最后再次 ./elasticsearch 启动, 看到started提示, 打开 http://192.168.x.x:9200/ 看到欢迎页面,说明elasticsearch6 配置成功。

注意,启动前,elasticsearch.yml文件要修改一下

network.host 后面的IP要改成你的内网IP或者 0.0.0.0 (测试环境可以这样,线上如果没有设置密码保护的话容易引发安全风险),然后再把前面的#去掉, 保存即可。

此条目发表在Uncategorized分类目录,贴了, , , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注