环境搭建
你好呀,我的老朋友!我是老寇,欢迎来到老寇云平台!
话不多说,跟我安装项目环境
本文采用docker安装环境,可以一键启动或关闭,总之,很方便!
# 安装教程
window安装docker教程 (opens new window)
注:window系统自带docker-compose,无需安装
# 复制文件
注:需要修改rocketmq的broker.conf配置,将brokerIP1改为自己的本地IP
# 编写脚本
version: '3.8'
services:
postgresql:
image: postgis/postgis:16-3.4
container_name: postgresql
# 保持容器在没有守护程序的情况下运行
tty: true
restart: always
privileged: true
ports:
- "5432:5432"
volumes:
- ./postgresql/data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=laokou123
- TZ=Asia/Shanghai
networks:
- laokou_network
redis:
image: redis:7.2.4
container_name: redis
# 保持容器在没有守护程序的情况下运行
tty: true
restart: always
privileged: true
ports:
- "6379:6379"
volumes:
- ./redis7/conf/redis.conf:/etc/redis/redis.conf
- ./redis7/data:/data
command: redis-server --appendonly yes --requirepass 'laokou123'
environment:
- TZ=Asia/Shanghai
networks:
- laokou_network
rocketmq-namesrv:
image: apache/rocketmq:5.2.0
container_name: rocketmq-namesrv
# 保持容器在没有守护程序的情况下运行
tty: true
restart: always
privileged: true
ports:
- "9876:9876"
command: sh mqnamesrv
environment:
- JAVA_OPT_EXT=-server -Xmx256m -Xms256m -Xmn128m
- TZ=Asia/Shanghai
networks:
- laokou_network
rocketmq-broker:
image: apache/rocketmq:5.2.0
container_name: rocketmq-broker
# 保持容器在没有守护程序的情况下运行
tty: true
restart: always
privileged: true
ports:
- "8081:8081"
- "10911:10911"
- "10909:10909"
- "10912:10912"
command: sh mqbroker -n rocketmq-namesrv:9876 -c /home/rocketmq/conf/broker.conf autoCreateTopicEnable=true
environment:
- JAVA_OPT_EXT=-server -Xmx256m -Xms256m -Xmn128m
- TZ=Asia/Shanghai
volumes:
- ./rocketmq5/broker/conf/broker.conf:/home/rocketmq/conf/broker.conf
depends_on:
- rocketmq-namesrv
networks:
- laokou_network
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.2
container_name: elasticsearch
# 保持容器在没有守护程序的情况下运行
tty: true
restart: always
privileged: true
ports:
- "9200:9200"
- "9300:9300"
volumes:
- ./elasticsearch8/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- ./elasticsearch8/data:/usr/share/elasticsearch/data
- ./elasticsearch8/logs:/usr/share/elasticsearch/logs
- ./elasticsearch8/plugins:/usr/share/elasticsearch/plugins
- ./elasticsearch8/config/certs/elastic-certificates.p12:/usr/share/elasticsearch/config/certs/elastic-certificates.p12
environment:
- TZ=Asia/Shanghai
- ES_JAVA_OPTS=-Xmx512m -Xms512m
- ELASTIC_PASSWORD=laokou123
ulimits:
memlock:
soft: -1
hard: -1
networks:
- laokou_network
networks:
laokou_network:
driver: bridge
# 运行脚本
docker-compose up - d
我是老寇,我们下次再见啦!
上次更新: 11/22/2024, 4:10:36 AM