Docker 中的 Kibana 和 Elasticsearch 通过标准安装共存

2024-02-09

我正在尝试在我的服务器上设置新版本的 Kibana 和 Elasticsearch。我有一个现有的 K 和 E 使用默认端口(5601、9200)运行,并且无法升级现有数据。我想在 Docker 中运行 K 和 E 的较新版本 (7.4.2),使用不同的端口 (5611:5601、9211:9200) 来访问容器。我有新的数据区域可用。

我相信我的 Elasticsearch 运行正常,但 Kibana 查找 Elasticsearch 的覆盖对我不起作用。我已附加我的 docker-compose.yml 文件。

预先感谢您的帮助。

version: '3'

networks:
  elk01:
    driver: bridge

services:
  es01:
    image: elasticsearch:7.4.2
    container_name: es01
    user: "983"
    networks:
      - elk01
    environment:
      #- cluster.initial_master_nodes=es01
      - cluster.name=docker-cluster
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms4g -Xmx4g -XX:-HeapDumpOnOutOfMemoryError"
      #- ES_JAVA_OPTS: "-Xms4g -Xmx4g -XX:-HeapDumpOnOutOfMemoryError"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "9211:9200"
      - "9311:9300"
    expose:
      - "9211"
    volumes:
      - /elk/elk7_4_2/elasticsearch/data:/usr/share/elasticsearch/data
      - /elk/elk7_4_2/elasticsearch/logs:/usr/share/elasticsearch/logs

  k01:
    depends_on:
    - es01
    image: kibana:7.4.2
    container_name: k01
    user: "981"
    networks:
      - elk01
    environment:
      - SERVER_NAME=kibana.localhost
      - ELASTICSEARCH_URL=http://es01:9211
      - ELASTICSEARCH_HOST=es01
      - ELASTICSEARCH_PORT=9211
      #- ELASTICSEARCH_USERNAME=elastic
      #- ELASTIC_PWD=changeme
      #- KIBANA_PWD=changeme
      - xpack.security.enabled=false
    ports:
      - "5611:5601"
    expose:
      - "5611"

Kibana 错误

k01     | {"type":"log","@timestamp":"2019-11-22T22:08:58Z","tags":["reporting","browser-driver","warning"],"pid":8,"message":"Enabling the Chromium sandbox provides an additional layer of protection."}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["error","elasticsearch","admin"],"pid":8,"message":"Request error, retrying\nHEAD http://elasticsearch:9200/.apm-agent-configuration => getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["error","elasticsearch","admin"],"pid":8,"message":"Request error, retrying\nGET http://elasticsearch:9200/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip => getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["warning","elasticsearch","admin"],"pid":8,"message":"Unable to revive connection: http://elasticsearch:9200/"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["warning","elasticsearch","admin"],"pid":8,"message":"No living connections"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["status","plugin:[email protected] /cdn-cgi/l/email-protection","error"],"pid":8,"state":"red","message":"Status changed from yellow to red - No Living connections","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["status","plugin:[email protected] /cdn-cgi/l/email-protection","error"],"pid":8,"state":"red","message":"Status changed from yellow to red - No Living connections","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}

ELASTICSEARCH_URL已被替换为ELASTICSEARCH_HOSTS :

ELASTICSEARCH_HOSTS: http://es01:9200

https://www.elastic.co/guide/en/kibana/current/docker.html https://www.elastic.co/guide/en/kibana/current/docker.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Docker 中的 Kibana 和 Elasticsearch 通过标准安装共存 的相关文章

随机推荐