windows docker 部署 rocketmq

以下指令全程使用 windows 自帶終端 Windows PowerShell 執行!!!
以下指令全程使用 windows 自帶終端 Windows PowerShell 執行!!!
以下指令全程使用 windows 自帶終端 Windows PowerShell 執行!!!

重要的事情說3遍!!!

確認電腦已安裝 Docker Desktop
Windows PowerShell 裏無法使用 $(pwd),所以這裏用絕對路徑,C:需要改成 /C/ 換行是 `
broker 配置文件在文章末尾

namesrv
docker run -d -v /C/Users/18559/Desktop/rocket/logs:/home/rocketmq/logs `
--name rmqnamesrv `
-e "JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" `
-p 9876:9876 `
foxiswho/rocketmq:4.8.0 `
sh mqnamesrv
1
2
3
4
5
6
broker
docker run -d `
-v /C/Users/18559/Desktop/rocket/logs:/home/rocketmq/logs `
-v /C/Users/18559/Desktop/rocket/store:/home/rocketmq/store `
-v /C/Users/18559/Desktop/rocket/conf:/home/rocketmq/conf `
--name rmqbroker --link rmqnamesrv:rmqnamesrv `
-e "NAMESRV_ADDR=rmqnamesrv:9876" `
-e "JAVA_OPT_EXT=-Xms512M -Xmx512M -Xmn128m" `
-p 10911:10911 -p 10912:10912 -p 10909:10909 `
foxiswho/rocketmq:4.8.0 `
sh mqbroker -c /home/rocketmq/conf/broker.conf
1
2
3
4
5
6
7
8
9
10
console
docker run -d --name rmqconsole --link rmqnamesrv:rmqnamesrv `
-e "JAVA_OPTS=-Drocketmq.namesrv.addr=rmqnamesrv:9876 -Dcom.rocketmq.sendMessageWithVIPChannel=false" `
-p 8180:8080 -t styletang/rocketmq-console-ng:1.0.0
1
2
3
展示
快樂的標誌

 

瀏覽器輸入 127.0.0.1:8180

 

到這就ok了,結束戰鬥

broker 配置文件內容
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


#所屬集羣名字
brokerClusterName=DefaultCluster

#broker名字,注意此處不同的配置文件填寫的不一樣,如果在broker-a.properties使用:broker-a,
#在broker-b.properties使用:broker-b
brokerName=broker-a

#0 表示Master,>0 表示Slave
brokerId=0

#nameServer地址,分號分割
#namesrvAddr=rocketmq-nameserver1:9876;rocketmq-nameserver2:9876
namesrvAddr=rmqnamesrv:9876

#啓動IP,如果 docker 報 com.alibaba.rocketmq.remoting.exception.RemotingConnectException: connect to <192.168.0.120:10909> failed
# 解決方式1 加上一句producer.setVipChannelEnabled(false);,解決方式2 brokerIP1 設置宿主機IP,不要使用docker 內部IP
#brokerIP1=192.168.0.253

#在發送消息時,自動創建服務器不存在的topic,默認創建的隊列數
defaultTopicQueueNums=4

#是否允許 Broker 自動創建Topic,建議線下開啓,線上關閉 !!!這裏仔細看是false,false,false
#原因下篇博客見~ 哈哈哈哈
autoCreateTopicEnable=true

#是否允許 Broker 自動創建訂閱組,建議線下開啓,線上關閉
autoCreateSubscriptionGroup=true

#Broker 對外服務的監聽端口
listenPort=10911

#刪除文件時間點,默認凌晨4點
deleteWhen=04

#文件保留時間,默認48小時
fileReservedTime=120

#commitLog每個文件的大小默認1G
mapedFileSizeCommitLog=1073741824

#ConsumeQueue每個文件默認存30W條,根據業務情況調整
mapedFileSizeConsumeQueue=300000

#destroyMapedFileIntervalForcibly=120000
#redeleteHangedFileInterval=120000
#檢測物理文件磁盤空間
diskMaxUsedSpaceRatio=88
#存儲路徑
#storePathRootDir=/home/ztztdata/rocketmq-all-4.1.0-incubating/store
#commitLog 存儲路徑
#storePathCommitLog=/home/ztztdata/rocketmq-all-4.1.0-incubating/store/commitlog
#消費隊列存儲
#storePathConsumeQueue=/home/ztztdata/rocketmq-all-4.1.0-incubating/store/consumequeue
#消息索引存儲路徑
#storePathIndex=/home/ztztdata/rocketmq-all-4.1.0-incubating/store/index
#checkpoint 文件存儲路徑
#storeCheckpoint=/home/ztztdata/rocketmq-all-4.1.0-incubating/store/checkpoint
#abort 文件存儲路徑
#abortFile=/home/ztztdata/rocketmq-all-4.1.0-incubating/store/abort
#限制的消息大小
maxMessageSize=65536

#flushCommitLogLeastPages=4
#flushConsumeQueueLeastPages=2
#flushCommitLogThoroughInterval=10000
#flushConsumeQueueThoroughInterval=60000

#Broker 的角色
#- ASYNC_MASTER 異步複製Master
#- SYNC_MASTER 同步雙寫Master
#- SLAVE
brokerRole=ASYNC_MASTER

#刷盤方式
#- ASYNC_FLUSH 異步刷盤
#- SYNC_FLUSH 同步刷盤
flushDiskType=ASYNC_FLUSH

#發消息線程池數量
#sendMessageThreadPoolNums=128
#拉消息線程池數量
#pullMessageThreadPoolNums=128

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

————————————————
版權聲明:本文爲CSDN博主「shiiiiiya」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/quejingshi/article/details/125965387

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章