Docker를 사용해서 Elasticsearch 시스템을 구축하려고 했는데, 이상하게 접속이 안되어서 상태를 확인해봤습니다.
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8af9a50bac2b elasticsearch:5.2.1 "/docker-entrypoin..." 2 minutes ago Exited (78) About a minute ago elasticsearch
기동하다가 오류가 발생하였는지, 바로 종료가 되었습니다.
그래서 로그를 확인해보니
$ docker logs elasticsearch
[2017-03-28T03:48:32,378][INFO ][o.e.n.Node ] [main] initializing ...
[2017-03-28T03:48:32,482][INFO ][o.e.e.NodeEnvironment ] [main] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/mapper/ubuntu--vg-root)]], net usable_space [390.3gb], net total_space [453.1gb], spins? [possibly], types [ext4]
[2017-03-28T03:48:32,483][INFO ][o.e.e.NodeEnvironment ] [main] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-03-28T03:48:32,535][INFO ][o.e.n.Node ] [main] node name [main], node ID [js7R8K6IQVCEGo6ryEswlg]
[2017-03-28T03:48:32,538][INFO ][o.e.n.Node ] [main] version[5.2.1], pid[1], build[db0d481/2017-02-09T22:05:32.386Z], OS[Linux/4.4.0-31-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_121/25.121-b13]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [aggs-matrix-stats]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [ingest-common]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [lang-expression]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [lang-groovy]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [lang-mustache]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [lang-painless]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [percolator]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [reindex]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [transport-netty3]
[2017-03-28T03:48:33,592][INFO ][o.e.p.PluginsService ] [main] loaded module [transport-netty4]
[2017-03-28T03:48:33,594][INFO ][o.e.p.PluginsService ] [main] no plugins loaded
[2017-03-28T03:48:34,165][WARN ][o.e.d.s.g.GroovyScriptEngineService] [groovy] scripts are deprecated, use [painless] scripts instead
[2017-03-28T03:48:36,197][INFO ][o.e.n.Node ] [main] initialized
[2017-03-28T03:48:36,197][INFO ][o.e.n.Node ] [main] starting ...
[2017-03-28T03:48:36,803][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 12:9e:cc:e0:ab:f3:a5:f4
[2017-03-28T03:48:36,944][INFO ][o.e.t.TransportService ] [main] publish_address {172.18.0.3:9300}, bound_addresses {[::]:9300}
[2017-03-28T03:48:37,005][INFO ][o.e.b.BootstrapChecks ] [main] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
ERROR: bootstrap checks failed
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2017-03-28T03:48:37,028][INFO ][o.e.n.Node ] [main] stopping ...
[2017-03-28T03:48:37,118][INFO ][o.e.n.Node ] [main] stopped
[2017-03-28T03:48:37,118][INFO ][o.e.n.Node ] [main] closing ...
[2017-03-28T03:48:37,134][INFO ][o.e.n.Node ] [main] closed
굵은 글씨 부분을 보면 vm.max_map_count라는 설정값이 너무 작아서 안된다고 합니다.
해당 수치를 최소 262144까지 올리라고 정보를 줍니다.
vm.max_map_count 수정방법
그리고 나서 Elasticsearch 컨테이너를 다시 기동하시면 정상적으로 올라옴을 확인할 수 있습니다.
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eef1d715a79e elasticsearch:5.2.1 "/docker-entrypoin..." 31 seconds ago Up 29 seconds 0.0.0.0:28200->9200/tcp, 0.0.0.0:28201->9300/tcp elasticsearch
'Docker' 카테고리의 다른 글
[Docker] ubuntu에 docker-compose 설치하기 (0) | 2020.02.18 |
---|---|
[Docker] Pull할 때 [::1]:53: read: connection refused 발생시 (0) | 2017.10.19 |
[Docker] Windows에서 Docker 실행하기 (0) | 2017.04.15 |
[Docker] none 태그 이미지 삭제하기 (0) | 2017.04.05 |
[Docker] ubuntu에서 실행시 sudo 제외하기 (0) | 2017.03.31 |