windows docker 部署 rocketmq

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

以下指令全程使用 windows 自帶終端 Windows PowerShell 執(zhí)行?。?!

以下指令全程使用 windows 自帶終端 Windows PowerShell 執(zhí)行?。?!

重要的事情說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了,結束戰(zhàn)斗

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

#在發(fā)送消息時,自動創(chuàng)建服務器不存在的topic,默認創(chuàng)建的隊列數

defaultTopicQueueNums=4

#是否允許 Broker 自動創(chuàng)建Topic,建議線下開啟,線上關閉 !??!這里仔細看是false,false,false

#原因下篇博客見~ 哈哈哈哈

autoCreateTopicEnable=true

#是否允許 Broker 自動創(chuàng)建訂閱組,建議線下開啟,線上關閉

autoCreateSubscriptionGroup=true

#Broker 對外服務的監(jiān)聽端口

listenPort=10911

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

deleteWhen=04

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

fileReservedTime=120

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

mapedFileSizeCommitLog=1073741824

#ConsumeQueue每個文件默認存30W條,根據業(yè)務情況調整

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

#發(fā)消息線程池數量

#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」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權協(xié)議,轉載請附上原文出處鏈接及本聲明。

原文鏈接:https://blog.csdn.net/quejingshi/article/details/125965387

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容