程序运行环境搭建记录

docker 踩坑日记

加载本地配置文件

docker run -p 6379:6379 –name myredis -v E:\Docker\redis\redis.conf:/etc/redis/redis.conf -v E:\Docker\redis\data:/data -d redis redis-server /etc/redis/redis.conf –appendonly yes

启动报错

  1. Containers feature is disabled. Enable it using the PowerShell script (in an administrative PowerShell) and restart your computer before using Docker Desktop:

powershell:

Enable-WindowsOptionalFeature -Online -FeatureName $(“Microsoft-Hyper-V”, “Containers”) -All

  1. 【Docker】:Failed to set version to docker-desktop: exit code: -1

方案1 此操作会导致代理软件无法使用. 一般还需要重启电脑才生效. 略拉胯.

cmd:

netsh winsock reset

方案2 下载软件 https://zhaowudi.lanzoub.com/iKKHv0hm3ssj

cmd:

NoLsp.exe c:\windows\system32\wsl.exe

redis启动后外部无法访问

Error initializing Redis connection
Could not get a resource from the pool
Unexpected end of stream.

redis.conf 中 注释掉 # bind 127.0.0.1 -::1

rocketmq

  1. 程序下载
    https://archive.apache.org/dist/rocketmq/4.9.0/rocketmq-all-4.9.0-bin-release.zip

  2. 控制台
    clone https://github.com/apache/rocketmq-dashboard.git

程序启动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@echo off
echo ------------切换到rocketMq安装目录----------
cd D:\rocketMQ\bin
echo ------------当前目录%cd%---------------------

echo ------------正在启动NameServer--------------
start mqnamesrv.cmd
echo ------------启动NameServer完成--------------


echo ------------正在启动Broker--------------------
start mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true
echo ------------启动Broker完成--------------------

pause
rem 没有部署控制台就注释掉下面的代码
echo ------------正在启动RocketMQ控制台---------
java -jar D:\project\rocketMq\rocketmq-externals\rocketmq-console\target\rocketmq-console-ng-2.0.0.jar
echo ------------启动控制台完成---------------------

pause

可能遇到错误

  1. 错误: 找不到或无法加载主类 Files\Java\jdk1.8.0_202\jre\lib\ext
  2. Please set the ROCKETMQ_HOME variable in your environment!

控制台就是springboot项目修改端口启动即可