LINUX.ORG.RU

elasticsearch cluster в docker

 , ,


0

3

делаю конфиг docker-compose.yml

version: '2'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.0.2
    restart: always
    container_name: elasticsearch
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - xpack.security.enabled=false
      - "discovery.zen.ping.unicast.hosts=ip1:9500,ip2:9500,ip3:9500"
      - "discovery.zen.minimum_master_nodes=2"
      - "path.repo=/backup/snapshot"
      - "cluster.name=docker"
      - "node.name=n1"
      - "network.host=0.0.0.0"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "9400:9200"
      - "9500:9300"
    volumes:
      - esdata:/usr/share/elasticsearch/data
      - /backup/snapshot:/backup/snapshot

volumes:
  esdata:
    driver: local

пробую запускать docker-compose up -d и получаю ошибки

[2019-09-20T09:46:54,529][INFO ][o.e.x.m.e.Exporters      ] [n1] skipping exporter [default_local] as it isn't ready yet
[2019-09-20T09:46:54,529][ERROR][o.e.x.m.AgentService     ] [n1] exception when exporting documents
org.elasticsearch.xpack.monitoring.exporter.ExportException: exporters are either not ready or faulty
        at org.elasticsearch.xpack.monitoring.exporter.Exporters.export(Exporters.java:188) ~[x-pack-5.0.2.jar:5.0.2]
        at org.elasticsearch.xpack.monitoring.AgentService$ExportingWorker.run(AgentService.java:208) [x-pack-5.0.2.jar:5.0.2]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92-internal]


У тебя что-то не работает, или просто ошибка в логах вызывает смутную тревогу?

что-то связанное с xpack не запустилось. Может в процессе загрузки, может действительно ошибка

я не использовал xpack, поэтому подробнее не скажу

router ★★★★★ ()
Ответ на: комментарий от router

не работает, кластер никак не собирается из-за этой ошибки

[2019-09-20T12:29:28,149][INFO ][o.e.t.TransportService   ] [n1] publish_address {192.168.112.2:9300}, bound_addresses {0.0.0.0:9300}
[2019-09-20T12:29:28,153][INFO ][o.e.b.BootstrapCheck     ] [n1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2019-09-20T12:29:38,016][INFO ][o.e.x.m.e.Exporters      ] [n1] skipping exporter [default_local] as it isn't ready yet
[2019-09-20T12:29:38,017][ERROR][o.e.x.m.AgentService     ] [n1] exception when exporting documents
org.elasticsearch.xpack.monitoring.exporter.ExportException: exporters are either not ready or faulty
        at org.elasticsearch.xpack.monitoring.exporter.Exporters.export(Exporters.java:188) ~[x-pack-5.0.2.jar:5.0.2]
        at org.elasticsearch.xpack.monitoring.AgentService$ExportingWorker.run(AgentService.java:208) [x-pack-5.0.2.jar:5.0.2]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92-internal]

если я уберу параметр - «discovery.zen.minimum_master_nodes=2», то выше ошибка уходит

[2019-09-20T12:31:37,551][INFO ][o.e.b.BootstrapCheck     ] [n1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2019-09-20T12:31:40,645][INFO ][o.e.c.s.ClusterService   ] [n1] new_master {n1}{FfkGHzdXT-OJhZ8XWZf1BQ}{5wIeacXSTceD__4vfOAZXw}{192.168.128.2}{192.168.128.2:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2019-09-20T12:31:40,669][INFO ][o.e.h.HttpServer         ] [n1] publish_address {192.168.128.2:9200}, bound_addresses {0.0.0.0:9200}
[2019-09-20T12:31:40,669][INFO ][o.e.n.Node               ] [n1] started
[2019-09-20T12:31:41,325][WARN ][o.e.l.LicenseService     ] [n1] license [6c6369d7-2732-4f9f-8ce4-b18b3843eea5] - expired
но кластер все равно не собирается

или я что-то не так настроил

Garcia ()
Последнее исправление: Garcia (всего исправлений: 1)
Ответ на: комментарий от router

я и в конфиг elasticsearch.yml добавлял

cluster.name: docker
node.name: n1
network.host: 0.0.0.0
bootstrap.memory_lock: true
cluster.routing.allocation.disk.threshold_enabled: false
discovery.zen.ping.unicast.hosts: ["ip_node1:9500", "ip_node2:9500", "ip_node3:9500"]
discovery.zen.minimum_master_nodes: 2
network.publish_host: ip_node1

и все равно ошибка

[2019-09-20T12:29:38,017][ERROR][o.e.x.m.AgentService     ] [n1] exception when exporting documents
org.elasticsearch.xpack.monitoring.exporter.ExportException: exporters are either not ready or faulty
        at org.elasticsearch.xpack.monitoring.exporter.Exporters.export(Exporters.java:188) ~[x-pack-5.0.2.jar:5.0.2]
        at org.elasticsearch.xpack.monitoring.AgentService$ExportingWorker.run(AgentService.java:208) [x-pack-5.0.2.jar:5.0.2]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92-internal]

Garcia ()