docker rm -f cid
docker --network my_net --network-alias net1 -d -p 8080:8080 -v local_dir:container_dir image entry_command entry_command_sub
docker network create common
docker run --name zookeeper --restart always -d -p 2181:2181 \
--network common --network-alias zwb-zookeeper zookeeper
docker run --network common -it --rm zookeeper zkCli.sh -server zwb-zookeeper
docker run -d --name kafka-server \
--network common -p 9092:9092\
-e ALLOW_PLAINTEXT_LISTENER=yes \
-e KAFKA_CFG_LISTENERS=PLAINTEXT://:9092\
-e KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092\
-e KAFKA_CFG_ZOOKEEPER_CONNECT=zwb-zookeeper:2181 \
bitnami/kafka:latest
docker run -it --rm \
--network common \
-e KAFKA_CFG_ZOOKEEPER_CONNECT=zwb-zookeeper:2181 \
bitnami/kafka:latest kafka-topics.sh --create --topic zwb-topic --replication-factor 1 --partitions 1 --zookeeper zwb-zookeeper:2181
docker run -it --rm \
--network common \
-e KAFKA_CFG_ZOOKEEPER_CONNECT=zwb-zookeeper:2181 \
bitnami/kafka:latest kafka-topics.sh --list --zookeeper zwb-zookeeper:2181
#!/bin/bash
docker run -it --rm \
--network common \
bitnami/kafka:latest kafka-console-consumer.sh --bootstrap-server kafka-ip:9092 --topic your-topic --from-beginning
#如遇报错,并且本机有安装过多版本的zookeeper,那么可能是zk缓存问题,删除/tmp/zookeeper目录内容或许可以解决
#!/bin/bash
docker run -it --rm \
--network common \
bitnami/kafka:latest kafka-console-producer.sh --bootstrap-server 192.168.31.170:9092 --topic your-topic
docker run -v ~/myShells/docker/mysql/data:/var/lib/mysql --name mysql --network common --network-alias zwb-mysql -p 3307:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:8.0
允许远程ip登陆
update mysql.user set host = ‘%’ where user =‘root’;
flush privileges;
docker run -it --network common --rm mysql mysql -hzwb-mysql -uroot -pzwb_pwd
docker run --name redis --network common -p 6379:6379 --network-alias zwb-redis -d redis --requirepass "123456"
docker run -it --rm --network common redis redis-cli -h zwb-redis
docker run -d -p 9000:9000 -p 9001:9001 \
-v ~/myShells/docker/minio/data:/data \
-v ~/myShells/docker/minio/conf:/root/.minio\
--name minio \
-e "MINIO_ACCESS_KEY=admin" \
-e "MINIO_SECRET_KEY=admin123"\
minio/minio server /data -console-address ":9001"
docker run -v ~/docker/minio/mc_config:/root/.mc/ -it --entrypoint=/bin/sh minio/mc
docker run --network common -e PARAMS="--spring.datasource.url=jdbc:mysql://zwb-mysql:3306/xxl_job?Unicode=true&characterEncoding=UTF-8&useSSL=false --spring.datasource.username=root --spring.datasource.password=123456 --xxl.admin.login=false" \
-p 9080:8080 --name xxl-job-admin \
-d xuxueli/xxl-job-admin:2.1.2
需要执行db初始化脚本
访问 http://127.0.0.1:9080/xxl-job-admin/
下载git项目
#!/bin/bash
cd ./docker-rocketmq/rmq
./start.sh
#!/bin/bash
open http://localhost:8180/#/
#!/bin/bash
cd /Users/wenbin.zheng/myShells/docker/rocketmq/docker-rocketmq/rmq
./stop.sh
version: "3.7"
services:
compose-zookeeper:
image: zookeeper
networks:
common:
aliases:
- zwb-zookeeper
ports:
- 2181:2181
compose-kafka:
environment:
ALLOW_PLAINTEXT_LISTENER: "true"
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://192.168.31.170:9092
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ZOOKEEPER_CONNECT: zwb-zookeeper:2181
image: bitnami/kafka
depends_on:
- compose-zookeeper
networks:
common:
aliases:
- zwb-kafka
ports:
- 9092:9092
compose-mysql:
cap_add:
- SYS_NICE
environment:
MYSQL_ROOT_PASSWORD: 123456
image: mysql:8.0
networks:
common:
aliases:
- zwb-mysql
ports:
- 3307:3306
volumes:
- ~/myShells/docker/mysql/data:/var/lib/mysql
compose-redis:
command: redis-server --requirepass "123456"
image: redis
networks:
common:
aliases:
- zwb-redis
ports:
- 6379:6379
compose-minio:
environment:
MINIO_ACCESS_KEY: admin
MINIO_SECRET_KEY: admin123
image: minio/minio
command: server /data -console-address ":9001"
networks:
common:
aliases:
- zwb-minio
ports:
- 9000:9000
- 9001:9001
volumes:
- ~/myShells/docker/minio/data:/data
- ~/myShells/docker/minio/conf:/root/.minio
compose-xxljob:
environment:
PARAMS: --spring.datasource.url=jdbc:mysql://zwb-mysql:3306/xxl_job?Unicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true --spring.datasource.username=root --spring.datasource.password=123456 --xxl.admin.login=false
MINIO_SECRET_KEY: admin123
image: xuxueli/xxl-job-admin:2.1.2
depends_on:
- compose-mysql
networks:
common:
aliases:
- zwb-xxljob
ports:
- 9080:8080
networks:
common: