【问题标题】:Run Elastic Stack in Docker Compose on Raspberry Pi 4在 Raspberry Pi 4 上的 Docker Compose 中运行 Elastic Stack
【发布时间】:2020-12-29 14:36:15
【问题描述】:

我正在尝试使用 docker compose 在我的 RasPi4 上运行弹性堆栈。问题是 Elastic 不为 ARM 架构提供图像……只有 X86。所以 raspi 不支持开箱即用。

每次我启动 docker compose config 时都会收到此消息

7.9.3: Pulling from elasticsearch/elasticsearch
ERROR: no matching manifest for linux/arm/v7 in the manifest list entries

Google 搜索的结果大多指向非官方图像……我会尝试……但这个已经 4 岁了:https://hub.docker.com/r/ind3x/rpi-elasticsearch/。所以我想我没有得到最新的弹性搜索。

有人知道我如何让橡皮筋跑起来吗?这是我的 docker-compose.yml ... 非常直接。

version: '3.3'
services:

  elastic-node-1:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.3
    container_name: elastic-node-1
    restart: always
    environment:
      - node.name=elastic-node-1
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=elastic-node-2
      - cluster.initial_master_nodes=elastic-node-1,elastic-node-2
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - elastic-data-1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - elastic-net

  elastic-node-2:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.3
    container_name: elastic-node-2
    restart: always
    environment:
      - node.name=elastic-node-2
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=elastic-node-1
      - cluster.initial_master_nodes=elastic-node-1,elastic-node-2
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - elastic-data-2:/usr/share/elasticsearch/data
    ports:
      - 9201:9201
    networks:
      - elastic-net

  kibana:
    image: docker.elastic.co/kibana/kibana:7.9.3
    container_name: kibana
    restart: always
    depends_on:
      - elastic-node-1
      - elastic-node-2
    ports:
      - 5601:5601
    environment:
      ELASTICSEARCH_URL: http://elastic-node-1:9200
      ELASTICSEARCH_HOSTS: http://elastic-node-1:9200
    networks:
      - elastic-net

volumes:
  elastic-data-1:
    driver: local
  elastic-data-2:
    driver: local

networks:
  elastic-net:
    driver: bridge

如果没有办法让这个弹性设置运行,你能推荐任何其他类似于 raspi(使用 linux)的硬件,它是 x86 并且可以代替我的 raspi 吗?然后我会为我的弹性堆栈切换硬件。

【问题讨论】:

    标签: raspberry-pi elastic-stack raspberry-pi4


    【解决方案1】:

    我已经在大型商业应用程序中使用 Elastic 获得了一些经验,所以只是一些额外的思考 - 我在这里还没有直接的答案:

    • 确实是ks 4岁的形象不值得努力。 Elsstic 在 7.x 版本中是稳定的,8.x 正在进行中,并且发生了巨大的变化。
    • 您需要考虑到 Elastic 可用的 Heapsize 实际上应该配置为 50%,因为它与 Lucene 共享。
    • 表示 Elastic 可能非常需要 RAM。根据您的用例以及目前 Raspi 最大 8GB 的​​限制,您可能需要考虑这一点。

    对于小型应用程序,它可能会起作用,但我认为它只是实验性的。

    如果您没有其他方法,您可能有两种选择:

      • 构建一个 docker 镜像(或者找一个有足够兴趣的人加入这项工作,可能是那个旧 docker 镜像的原始作者)
      • 一步一步来,首先在无头 raspi 独立设备上部署弹性(甚至暂时避免使用 docker 并减少任何开销),然后添加一些弹性节点配置(弹性通常只适用于至少三个节点)
    1. 确实构建了一个为每个节点提供至少 8 -16 GB 的集群 - 我相信基于 Ubuntu 的设置适用于 X86。

    【讨论】:

      猜你喜欢
      • 2023-01-18
      • 2021-04-08
      • 2023-02-10
      • 2020-01-21
      • 1970-01-01
      • 2023-03-08
      • 1970-01-01
      • 2021-06-03
      • 2021-12-23
      相关资源
      最近更新 更多