gpt4 book ai didi

docker - docker-elasticsearch + kibana从保存的对象开始

转载 作者:行者123 更新时间:2023-12-02 19:22:54 24 4
gpt4 key购买 nike

我正在使用docker-compose一起启动elasticsearch和kibana。

一切都很好,但是我也需要从保存的对象开始(使用仪表板,可视化,索引等)。

有人可以帮上忙吗?我如何开始做所有事情(elasticsearch和kibana同时保存对象-仪表板,可视化,索引等)?

我的docker-compose文件:

version: '3.7'

services:

elasticsearch:
image: elasticsearch:7.4.0
restart: on-failure
container_name: elasticsearch
environment:
- node.name=elasticsearch
- discovery.seed_hosts=elasticsearch-cluster
- cluster.initial_master_nodes=elasticsearch,elasticsearch-cluster
- cluster.name=docker-cluster
# - bootstrap.memory_lock=true
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
ports:
- 9200:9200
- 9300:9300
networks:
- api-network-driver

elasticsearch-cluster:
image: elasticsearch:7.4.0
container_name: elasticsearch-cluster
environment:
- node.name=elasticsearch-cluster
- discovery.seed_hosts=elasticsearch
- cluster.initial_master_nodes=elasticsearch,elasticsearch-cluster
- cluster.name=docker-cluster
# - bootstrap.memory_lock=true
# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch-cluster-data:/usr/share/elasticsearch/data
networks:
- api-network-driver

kibana:
image: kibana:7.4.0
container_name: kibana
restart: on-failure
ports:
- 5601:5601
depends_on:
- elasticsearch
environment:
SERVER_NAME: localhost
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
networks:
- api-network-driver

最佳答案

    version: '2.2' 
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
container_name: es01
environment:
- node.name=es01
- discovery.seed_hosts=es02
- cluster.initial_master_nodes=es01,es02
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata01:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- esnet
es02:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
container_name: es02
environment:
- node.name=es02
- discovery.seed_hosts=es01
- cluster.initial_master_nodes=es01,es02
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- esdata02:/usr/share/elasticsearch/data
networks:
- esnet

kibana:
image: kibana:7.4.0
container_name: kibana
restart: on-failure
ports:
- 5601:5601
environment:
SERVER_NAME: localhost
ELASTICSEARCH_HOSTS: http://es01:9200
networks:
- esnet

volumes:
esdata01:
driver: local
esdata02:
driver: local

networks:
esnet:

Kibana将数据(仪表盘,可视化效果,设置等)保存到索引[.kibana]中,该索引位于 /usr/share/elasticsearch/data.内部
您已经为该文件夹映射了一个卷,因此您的数据将存储在主机上。
而且,您还可以轻松地将所有内容(仪表盘,可视化效果,设置等)导出到单个.json格式文件中,并使用Vise Versa。

enter image description here

我还建议尝试从AWS的开源发行版开始,它是开源的,包括安全功能和受支持的docker-compose。

关于docker - docker-elasticsearch + kibana从保存的对象开始,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58469695/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com