如何升级elk docker图片中的elasticsearch

iq0todco  于 2021-06-15  发布在  ElasticSearch
关注(0)|答案(1)|浏览(648)

我使用以下命令在linux服务器上安装了一个elk docker映像:

sudo docker pull sebp/elk

这将获取最新版本的elk docker映像(7.8.0)以及堆栈中的每个服务( elasticsearch , logstash ,和 kibana )也有版本7.8.0。
我需要升级 elasticsearch 出于安全原因,将其更改为7.9.0。如何在继续使用 sebp/elk Docker 形象?

jaql4c8m

jaql4c8m1#

elk打开包,运行所有3个服务,并默认链接它们。使用此设置,您不能仅拆分和升级elasticsearch。
我建议您使用docker compose独立运行这三个服务。这样每个服务都可以有您选择的图像。
docker compose示例供您参考:

version: '3.2'

services:
  elasticsearch:
    image: IMAGE_GOES_HERE
    volumes:
      - type: bind
        source: ./elasticsearch/config/elasticsearch.yml
        target: /usr/share/elasticsearch/config/elasticsearch.yml
        read_only: true
      - type: volume
        source: elasticsearch
        target: /usr/share/elasticsearch/data
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      ES_JAVA_OPTS: "-Xmx256m -Xms256m"
      ELASTIC_PASSWORD: changeme
      # Use single node discovery in order to disable production mode and avoid bootstrap checks
      # see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
      discovery.type: single-node
    networks:
      - elk

  logstash:
    image: IMAGE_GOES_HERE
    volumes:
      - type: bind
        source: ./logstash/config/logstash.yml
        target: /usr/share/logstash/config/logstash.yml
        read_only: true
      - type: bind
        source: ./logstash/pipeline
        target: /usr/share/logstash/pipeline
        read_only: true
    ports:
      - "5000:5000/tcp"
      - "5000:5000/udp"
      - "9600:9600"
    environment:
      LS_JAVA_OPTS: "-Xmx256m -Xms256m"
    networks:
      - elk
    depends_on:
      - elasticsearch

  kibana:
    image: IMAGE_GOES_HERE
    volumes:
      - type: bind
        source: ./kibana/config/kibana.yml
        target: /usr/share/kibana/config/kibana.yml
        read_only: true
    ports:
      - "5601:5601"
    networks:
      - elk
    depends_on:
      - elasticsearch

networks:
  elk:
    driver: bridge

volumes:
  elasticsearch:

相关问题