由于经常的安装虚拟机,每次都要重装环境比较麻烦。

这次写了一个 docker-compose 文件,一次性搞定安装问题。

目录结果如下:

---
version: "3.1" networks:
zh-net:
driver: bridge services: db:
image: mysql:latest
container_name: zh_mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
- TZ=Asia/Shanghai
volumes:
- /home/peng/docker/data/mysql:/var/lib/mysql
- ./mysql/init/:/docker-entrypoint-initdb.d/
ports:
- 3306:3306
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1 redis:
image: redis:latest
container_name: zh_redis
ports:
- 6379:6379 etcd:
image: bitnami/etcd:latest
container_name: zh_etcd
environment:
- ALLOW_NONE_AUTHENTICATION=yes
ports:
- 2379:2379 es:
image: elasticsearch:7.17.5
container_name: zh_es
environment:
- discovery.type=single-node
volumes:
- /home/peng/docker/conf/elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- /home/peng/docker/conf/elasticsearch/plugins:/usr/share/elasticsearch/plugins
ports:
- 9200:9200
networks:
- zh-net kibana:
image: kibana:7.17.5
container_name: zh_kibana
volumes:
- /home/peng/docker/conf/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml
ports:
- 5601:5601
networks:
- zh-net
depends_on:
- es zookeeper:
image: confluentinc/cp-zookeeper:7.0.1
container_name: zh_zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000 broker:
image: confluentinc/cp-kafka:7.0.1
container_name: zh_broker
ports:
# To learn about configuring Kafka for access across networks see
# https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
- "9092:9092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 kafka-map:
image: dushixiang/kafka-map:latest
container_name: zh_kafka-map
volumes:
- /home/peng/docker/data/kafka-map:/usr/local/kafka-map/data
environment:
- DEFAULT_USERNAME=admin
- DEFAULT_PASSWORD=admin
networks:
- zh-net
ports:
- 8089:8080
depends_on:
- broker

非持久化安装

---
version: "3.1" networks:
zh-net:
driver: bridge services: db:
image: mysql:latest
container_name: zh_mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
- TZ=Asia/Shanghai
networks:
- zh-net
ports:
- 3306:3306
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1 redis:
image: redis:latest
container_name: zh_redis
networks:
- zh-net
ports:
- 6379:6379 etcd:
image: bitnami/etcd:latest
container_name: zh_etcd
environment:
- ALLOW_NONE_AUTHENTICATION=yes
networks:
- zh-net
ports:
- 2379:2379 es:
image: elasticsearch:7.17.5
container_name: zh_es
environment:
- discovery.type=single-node
networks:
- zh-net
ports:
- 9200:9200
networks:
- zh-net kibana:
image: kibana:7.17.5
container_name: zh_kibana
networks:
- zh-net
ports:
- 5601:5601
depends_on:
- es zookeeper:
image: confluentinc/cp-zookeeper:7.0.1
container_name: zh_zookeeper
networks:
- zh-net
ports:
- 2181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000 broker:
image: confluentinc/cp-kafka:7.0.1
container_name: zh_broker
networks:
- zh-net
ports:
- 9092:9092
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 kafka-map:
image: dushixiang/kafka-map:latest
container_name: zh_kafka-map
environment:
- DEFAULT_USERNAME=admin
- DEFAULT_PASSWORD=admin
networks:
- zh-net
ports:
- 8089:8080
depends_on:
- broker

使用 docker-compose 安装 es、kibana、mysql、redis、kafka的更多相关文章

  1. Spring Boot 2.0(五):Docker Compose + Spring Boot + Nginx + Mysql 实践

    我知道大家这段时间看了我写关于 docker 相关的几篇文章,不疼不痒的,仍然没有感受 docker 的便利,是的,我也是这样认为的,I know your felling . 前期了解概念什么的确实 ...

  2. (转)Spring Boot 2 (五):Docker Compose + Spring Boot + Nginx + Mysql 实践

    http://www.ityouknow.com/springboot/2018/03/28/dockercompose-springboot-mysql-nginx.html 我知道大家这段时间看了 ...

  3. Spring Boot 2 (五):Docker Compose + Spring Boot + Nginx + Mysql 实践

    Spring Boot 2 (五):Docker Compose + Spring Boot + Nginx + Mysql 实践 Spring Boot + Nginx + Mysql 是实际工作中 ...

  4. Docker Compose + Spring Boot + Nginx + Mysql

    Docker Compose + Spring Boot + Nginx + Mysql 实践 我知道大家这段时间看了我写关于 docker 相关的几篇文章,不疼不痒的,仍然没有感受 docker 的 ...

  5. 安装logstash+kibana+elasticsearch+redis搭建集中式日志分析平台

    安装logstash+kibana+elasticsearch+redis搭建集中式日志分析平台 2014-01-16 19:40:57|  分类: logstash |  标签:logstash   ...

  6. 手把手教你 Docker Compose安装DOClever

    一.什么是Docker Compose以及Docker Compose的安装和使用 查看我的另外一篇博客:Docker Compose的安装和使用 二.DOClever是什么 DOClever是一个可 ...

  7. docker和docker compose安装使用、入门进阶案例

    一.前言 现在可谓是容器化的时代,云原生的袭来,导致go的崛起,作为一名java开发,现在慌得一批.作为知识储备,小编也是一直学关于docker的东西,还有一些持续继承jenkins. 提到docke ...

  8. Docker Compose安装以及入门

    Docker Compose 是 Docker 官方编排(Orchestration)项目之一,负责快速在集群中部署分布式应用. Compose 简介 Compose 项目是 Docker 官方的开源 ...

  9. 使用 docker compose 安装 tidb

    目标 : 单机上通过 Docker Compose 快速一键部署一套 TiDB 测试集群 前提条件: 1.centos版本在7.3 以上 2.安装git 3.安装docker Docker versi ...

  10. Docker Compose 安装 on centos7

    本文演示如何在CentOS7上安装Docker Compose. 1 在线安装 1.1 下载安装包 $ curl -L https://github.com/docker/compose/releas ...

随机推荐

  1. Mat数据结构

    1.MAT类: OpenCV从2001年开始发展,在最初使用的是c语言,使用的是IplImage数据结构来存储图像,但是最大的问题需要手动申请释放内从( manual memory managemen ...

  2. TIM + DMA + ADC

    #include "public.h" #define FFT_POINT (256) static uint16_t _DmaBuffer[FFT_POINT]; static ...

  3. pandas连接msyql报(1115, "Unknown character set: 'utf8mb4'")错误

    代码如下: 报错如下: 首先,为什么会出现这个错误: 分析如下: 随着智能手机的普及,我们开始经常使用表情符号.��更好的帮助我们进行交流.但是mysql的utf8编码只支持3字节的数据,而移动端的表 ...

  4. https://lamp.sh/

    转载:LAMP一键安装包 LAMP一键安装包

  5. js根据指定字段数据去重

    //根据id去重 function unique(arr1) { const res = new Map(); return arr1.filter((a) => !res.has(a.id) ...

  6. URL带参数json传递进行解析

    注意参数格式是要加密的: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...

  7. mysql数据库总是锁表

    有可能是数据库服务器的磁盘空间满了

  8. mac sourceTree 每次操作提示需要密码

    1.在终端(terminal)打开你的工程目录2.输入git config credential.helper store 3.拉取代码git pull

  9. android webview与js简单的交互方案

    最近研究webview与js交互,看了几个开源库实现,感觉不尽如人意,存在主要问题是,耦合较高,使用不够简洁,后来参考Uri设定规则,格局Uri类似协议自定义了类似的js交互协议 比较简洁,自定义协议 ...

  10. elasticsearch 内存分配设置

    一.背景 elasticsearch版本为2.3.3 elasticsearch 默认安装后设置的内存是1GB,对于现实业务来说太小 预计在五台机器上配置elasticsearch构建集群,但是构建索 ...