elasticsearch通过ip进行访问配置

修改 elasticsearch.yml

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.33.134
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation. 

   18-12-17T15:57:48,371][INFO ][o.e.p.PluginsService     ] [6l9CHPE] loaded module [x-pack-ml]
    [2018-12-17T15:57:48,371][INFO ][o.e.p.PluginsService     ] [6l9CHPE] loaded module [x-pack-monitoring]
    [2018-12-17T15:57:48,371][INFO ][o.e.p.PluginsService     ] [6l9CHPE] loaded module [x-pack-rollup]
    [2018-12-17T15:57:48,372][INFO ][o.e.p.PluginsService     ] [6l9CHPE] loaded module [x-pack-security]
    [2018-12-17T15:57:48,372][INFO ][o.e.p.PluginsService     ] [6l9CHPE] loaded module [x-pack-sql]
    [2018-12-17T15:57:48,372][INFO ][o.e.p.PluginsService     ] [6l9CHPE] loaded module [x-pack-upgrade]
    [2018-12-17T15:57:48,372][INFO ][o.e.p.PluginsService     ] [6l9CHPE] loaded module [x-pack-watcher]
    [2018-12-17T15:57:48,373][INFO ][o.e.p.PluginsService     ] [6l9CHPE] no plugins loaded
    [2018-12-17T15:57:53,192][INFO ][o.e.x.s.a.s.FileRolesStore] [6l9CHPE] parsed [0] roles from file [/myapps/elasticsearch-6.5.3/config/roles.yml]
    [2018-12-17T15:57:53,898][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [6l9CHPE] [controller/4064] [Main.cc@109] controller (64 bit): Version 6.5.3 (Build f418a701d70c6e) Copyright (c) 2018 Elasticsearch BV
    [2018-12-17T15:57:54,444][DEBUG][o.e.a.ActionModule       ] [6l9CHPE] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2018-12-17T15:57:54,707][INFO ][o.e.d.DiscoveryModule    ] [6l9CHPE] using discovery type [zen] and host providers [settings]
    [2018-12-17T15:57:55,739][INFO ][o.e.n.Node               ] [6l9CHPE] initialized
    [2018-12-17T15:57:55,740][INFO ][o.e.n.Node               ] [6l9CHPE] starting ...
    [2018-12-17T15:57:55,935][INFO ][o.e.t.TransportService   ] [6l9CHPE] publish_address {192.168.33.134:9300}, bound_addresses {[::]:9300}
    [2018-12-17T15:57:55,961][INFO ][o.e.b.BootstrapChecks    ] [6l9CHPE] 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-12-17T15:57:56,024][INFO ][o.e.n.Node               ] [6l9CHPE] stopping ...
    [2018-12-17T15:57:56,088][INFO ][o.e.n.Node               ] [6l9CHPE] stopped
    [2018-12-17T15:57:56,089][INFO ][o.e.n.Node               ] [6l9CHPE] closing ...
    [2018-12-17T15:57:56,105][INFO ][o.e.n.Node               ] [6l9CHPE] closed
    [2018-12-17T15:57:56,109][INFO ][o.e.x.m.j.p.NativeController] [6l9CHPE] Native controller process has stopped - no new native processes can be started
    wilson@wilson-virtual-machine:/myapps/elasticsearch-6.5.3/bin$ ls

永久性修改
cd /etc
编辑sysctl.conf,增加如下内容

vim sysctl.conf
# elasticsearch config start
vm.max_map_count=262144
# elasticsearch config end

一次性修改:
sysctl -w vm.max_map_count=262144
检查配置是否生效
sysctl -a | grep “vm.max_map_count”
显示vm.max_map_count = 262144
产看命令:sysctl -p
vm.max_map_count = 262144


  Copyright (c) 2018 Elasticsearch BV
    [2018-12-17T16:06:39,574][DEBUG][o.e.a.ActionModule       ] [6l9CHPE] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2018-12-17T16:06:39,815][INFO ][o.e.d.DiscoveryModule    ] [6l9CHPE] using discovery type [zen] and host providers [settings]
    [2018-12-17T16:06:40,738][INFO ][o.e.n.Node               ] [6l9CHPE] initialized
    [2018-12-17T16:06:40,738][INFO ][o.e.n.Node               ] [6l9CHPE] starting ...
    [2018-12-17T16:06:40,918][INFO ][o.e.t.TransportService   ] [6l9CHPE] publish_address {192.168.33.134:9300}, bound_addresses {[::]:9300}
    [2018-12-17T16:06:40,944][INFO ][o.e.b.BootstrapChecks    ] [6l9CHPE] 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-12-17T16:06:40,990][INFO ][o.e.n.Node               ] [6l9CHPE] stopping ...
    [2018-12-17T16:06:41,073][INFO ][o.e.n.Node               ] [6l9CHPE] stopped
    [2018-12-17T16:06:41,073][INFO ][o.e.n.Node               ] [6l9CHPE] closing ...
    [2018-12-17T16:06:41,093][INFO ][o.e.n.Node               ] [6l9CHPE] closed
    [2018-12-17T16:06:41,097][INFO ][o.e.x.m.j.p.NativeController] [6l9CHPE] Native controller process has stopped - no new native processes can be started
    wilson@wilson-virtual-machine:/myapps/elasticsearch-6.5.3/bin$ 

然后编辑/etc/security/limits.conf limits.conf增加如下配置:

# elasticsearch config start
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
# elasticsearch config end

在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值