[Abnormal] Docker installation elasticsearch7, 9200 can not be opened using a browser

View container log is as follows:

{"type": "server", "timestamp": "2020-02-27T11:29:46,236+08:00", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "loaded module [x-pack-security]" }
{"type": "server", "timestamp": "2020-02-27T11:29:46,236+08:00", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "loaded module [x-pack-sql]" }
{"type": "server", "timestamp": "2020-02-27T11:29:46,236+08:00", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "loaded module [x-pack-voting-only-node]" }
{"type": "server", "timestamp": "2020-02-27T11:29:46,236+08:00", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "loaded module [x-pack-watcher]" }
{"type": "server", "timestamp": "2020-02-27T11:29:46,237+08:00", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "no plugins loaded" }
{"type": "server", "timestamp": "2020-02-27T11:29:50,742+08:00", "level": "INFO", "component": "o.e.x.s.a.s.FileRolesStore", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]" }
{"type": "server", "timestamp": "2020-02-27T11:29:51,271+08:00", "level": "INFO", "component": "o.e.x.m.p.l.CppLogMessageHandler", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "[controller/104] [Main.cc@110] controller (64 bit): Version 7.4.2 (Build 473f61b8a5238b) Copyright (c) 2019 Elasticsearch BV" }
{"type": "server", "timestamp": "2020-02-27T11:29:51,845+08:00", "level": "DEBUG", "component": "o.e.a.ActionModule", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "Using REST wrapper from plugin org.elasticsearch.xpack.security.Security" }
{"type": "server", "timestamp": "2020-02-27T11:29:52,280+08:00", "level": "INFO", "component": "o.e.d.DiscoveryModule", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "using discovery type [zen] and seed hosts providers [settings]" }
{"type": "server", "timestamp": "2020-02-27T11:29:53,253+08:00", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "initialized" }
{"type": "server", "timestamp": "2020-02-27T11:29:53,254+08:00", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "starting ..." }
{"type": "server", "timestamp": "2020-02-27T11:29:53,429+08:00", "level": "INFO", "component": "o.e.t.TransportService", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "publish_address {192.168.0.249:9300}, bound_addresses {0.0.0.0:9300}" }
{"type": "server", "timestamp": "2020-02-27T11:29:53,437+08:00", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }
ERROR: [2] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2]: 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
{"type": "server", "timestamp": "2020-02-27T11:29:53,450+08:00", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "stopping ..." }
{"type": "server", "timestamp": "2020-02-27T11:29:53,513+08:00", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "stopped" }
{"type": "server", "timestamp": "2020-02-27T11:29:53,513+08:00", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "closing ..." }
{"type": "server", "timestamp": "2020-02-27T11:29:53,530+08:00", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "closed" }
{"type": "server", "timestamp": "2020-02-27T11:29:53,534+08:00", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "docker-cluster", "node.name": "hadoop_elasticsearch", "message": "Native controller process has stopped - no new native processes can be started" }
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

重点看 error:
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Means: the host of the largest virtual memory setting is too small.

Configuration is as follows:

##打开 sysctl.conf 文件
[root@slave1 ~]# vim /etc/sysctl.conf

fs.file-max = 1000000
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.ipv4.tcp_max_syn_backlog = 16384
net.core.netdev_max_backlog = 32768
net.core.somaxconn = 32768
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_fin_timeout = 20
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.ip_local_port_range = 1024 65000
net.nf_conntrack_max = 6553500
net.netfilter.nf_conntrack_max = 6553500
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_established = 3600
net.ipv4.neigh.default.gc_stale_time = 120
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.lo.arp_announce = 2
kernel.sysrq = 1
vm.overcommit_memory = 1
vm.swappiness = 10
## 添加如下 配置
vm.max_map_count = 655360

##重新加载 配置
[root@slave1 ~]# sysctl -p 

注:
vm.max_map_count = 655360

 

then. Restart container. Access to normal

Published 111 original articles · won praise 28 · views 40000 +

Guess you like

Origin blog.csdn.net/weixin_42697074/article/details/104534336