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

这次写了一个 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. steamdeck使用SSH远程控制

    为了方便去折腾steamdeck,我想用Windows11远程控制steam deck,我开始在网上查找Linux远程控制的方法,决定使用SSH来达到目的. 首先开始查看我的steamdeck的ip地 ...

  2. SpringBoot 整合Thymeleaf 、Thymeleaf常用标签

    springboot 整合Thymeleaf Thymeleaf是目前流行的视图层的技术,Spring boot 官方推荐的使用Thymeleaf 什么是Thymeleaf? Thymeleaf是一个 ...

  3. JZOJ 2022.02.11【提高A组】模拟

    \(\text{Solution}\) 首先把 \(T2\) 给切了,\(T1\) 找半天规律找不到 然后打了个表算是暴力了 \(T3\) 也暴... 太暴了... \(T4\) 直接啥也不会 \(\ ...

  4. Os-hackNos-3

    Os-hackNos-3 目录 Os-hackNos-3 1 信息收集 1.1 端口扫描 1.2 后台目录扫描 1.2.1 目录分析 2 爆破后台登录页面 2.1 BP爆破 2.2 hydra爆破 3 ...

  5. input type = file 在部分安卓手机上无法调起相册

    移动端H5web 用input type = file 在部分安卓手机上无法调起摄像头拍照,有的也无法访问相册而是直接访问了文档,解决办法是: 加上 accept = "image/*&qu ...

  6. LeetCode算法训练 93.复原IP地址 78.子集 90.子集II

    欢迎关注个人公众号:爱喝可可牛奶 LeetCode算法训练 93.复原IP地址 78.子集 90.子集II LeetCode 93. 复原 IP 地址 分析 字符串全部由数字组成,ipv4每一段数字不 ...

  7. 结合代码和内存变化图一步步弄懂JVM的FullGC

    1.年轻代存活的对象太多,老年代了放不下 01.示例代码 public class DemoTest1 { public static void main(String[] args) { byte[ ...

  8. ant design vue datePicker 日期时间范围设置默认为当天0点-23点59

    <template> <a-card :bordered="false"> <a-range-picker show-time :default-va ...

  9. 04-python垃圾回收机制

    python垃圾回收机制 一.引入 解释器在执行定义变量的语法时,会申请内存空间来存放变量值,每一块内存空间都有其唯一的内存地址,我们在前面说过,变量名并不是存放的变量值,而是存放的内存地址,通过访问 ...

  10. uniapp 开发遇到的问题

    1. App平台IOS端软键盘上方横条去除方案(禁用键盘上的^) 在 pages.json 中配置 style配置 "app-plus": { "softinputNav ...