Skip to content

Commit

Permalink
部署说明
Browse files Browse the repository at this point in the history
  • Loading branch information
noear committed Dec 5, 2023
1 parent 5853b7b commit 480abba
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
36 changes: 32 additions & 4 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

| 镜像 | 说明 |
|-------------------------------|--------------------------------|
| noearorg/folkmq-server:1.0.14 | 服务端(主端口:8602,消息端口:18602),可独立使用 |
| noearorg/folkmq-broker:1.0.14 | 代理端(主端口:8602,消息端口:18602) |
| noearorg/folkmq-server:1.0.15 | 服务端(主端口:8602,消息端口:18602),可独立使用 |
| noearorg/folkmq-broker:1.0.15 | 代理端(主端口:8602,消息端口:18602) |


* 可选配置:
Expand Down Expand Up @@ -55,7 +55,7 @@ docker-compose -f docker-compose-standalone.yml up
### 2、docker 部署方式
```
docker run -p 18602:18602 -p 8602:8602 noearorg/folkmq-server:1.0.14
docker run -p 18602:18602 -p 8602:8602 noearorg/folkmq-server:1.0.15
```
Expand All @@ -81,4 +81,32 @@ docker-compose -f docker-compose-cluster.yml up
### 2、集群架构
FolkMQ 是使用 Socket.D 开发的,集群即为 Socket.D Broker 模式集群。详见:[《Socket.D 集群模式》](https://socketd.noear.org/article/737)
FolkMQ 是使用 Socket.D 开发的,集群即为 Socket.D Broker 模式集群。详见:[《Socket.D 集群模式》](https://socketd.noear.org/article/737)
## 五、Multi-Broker 模式集群部署说明
这个比较复杂,所以用 jar 形式来表达部署关系。顺带把访问账号也带上
* 启动两个 broker 服务
```
java -Dserver.port=8601 -Dfolkmq.access.ak1=sk1 -jar folkmq-broker.jar
java -Dserver.port=8602 -Dfolkmq.access.ak1=sk1 -jar folkmq-broker.jar
```
* 启动三个 server 服务(连接时多个地址用","隔开)
```
java -Dserver.port=8101 -Dfolkmq.broker='folkmq://127.0.0.1:18601?@=folkmq-server&ak=ak1&sk=sk1,folkmq://127.0.0.1:18602?@=folkmq-server&ak=ak1&sk=sk1' -jar folkmq-server.jar
java -Dserver.port=8102 -Dfolkmq.broker='folkmq://127.0.0.1:18601?@=folkmq-server&ak=ak1&sk=sk1,folkmq://127.0.0.1:18602?@=folkmq-server&ak=ak1&sk=sk1' -jar folkmq-server.jar
java -Dserver.port=8103 -Dfolkmq.broker='folkmq://127.0.0.1:18601?@=folkmq-server&ak=ak1&sk=sk1,folkmq://127.0.0.1:18602?@=folkmq-server&ak=ak1&sk=sk1' -jar folkmq-server.jar
```
* client 示例(连接时多个地址用","隔开)
```java
//客户端
MqClient client = FolkMQ.createClient("folkmq://127.0.0.1:18601?ak=ak1&sk=sk1,folkmq://127.0.0.1:18602?ak=ak1&sk=sk1")
.connect();
```
10 changes: 5 additions & 5 deletions deploy/docker-compose-cluster.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.5'
services:
folkmq-broker:
image: noearorg/folkmq-broker:1.0.14
image: noearorg/folkmq-broker:1.0.15
container_name: folkmq-broker
ports:
- 8602:8602
Expand All @@ -19,7 +19,7 @@ services:
aliases:
- folkmq-broker
folkmq-server1:
image: noearorg/folkmq-server:1.0.14
image: noearorg/folkmq-server:1.0.15
container_name: folkmq-server1
ports:
- 8611:8602
Expand All @@ -29,7 +29,7 @@ services:
- ./data/server1:/data
environment:
# @=folkmq-server 请勿修改
- folkmq.broker=sd:tcp://folkmq-broker:18602?@=folkmq-server
- folkmq.broker=folkmq://folkmq-broker:18602?@=folkmq-server
- TZ=Asia/Shanghai
depends_on:
- folkmq-broker
Expand All @@ -38,7 +38,7 @@ services:
aliases:
- folkmq-server1
folkmq-server2:
image: noearorg/folkmq-server:1.0.14
image: noearorg/folkmq-server:1.0.15
container_name: folkmq-server2
ports:
- 8612:8602
Expand All @@ -48,7 +48,7 @@ services:
- ./logs/server2:/logs
environment:
# @=folkmq-server 请勿修改
- folkmq.broker=sd:tcp://folkmq-broker:18602?@=folkmq-server
- folkmq.broker=folkmq://folkmq-broker:18602?@=folkmq-server
- TZ=Asia/Shanghai
depends_on:
- folkmq-broker
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker-compose-standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.5'

services:
folkmq-server:
image: noearorg/folkmq-server:1.0.14
image: noearorg/folkmq-server:1.0.15
container_name: folkmq-server
environment:
- folkmq.admin=admin #管理后台密码
Expand Down

0 comments on commit 480abba

Please sign in to comment.