Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
update README and adjust the path in the configuration file.
  • Loading branch information
wind-c committed Mar 21, 2024
1 parent 8d426d8 commit b16b02d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Unless it's a critical issue, new releases typically go out over the weekend. At
- Packets are bridged to kafka according to the configured rule.
- Single-machine mode supports local storage BBolt, Badger and Redis.
- Hook design pattern makes it easy to develop plugins for Auth, Bridge, and Storage.
- Cluster support is based on Gossip and Raft, [Click to Cluster README](cmd/cluster/README.md).
- Cluster support is based on Gossip and Raft, [Click to Cluster README](cluster/README.md).

#### Roadmap
- Dashboard.
Expand All @@ -51,8 +51,8 @@ Comqtt can be used as a standalone broker. Simply checkout this repository and r

### Build
```
cd cmd/single
go build -o comqtt cmd/single/main.go
cd cmd
go build -o comqtt ./single/main.go
```
### Start
```
Expand Down
11 changes: 6 additions & 5 deletions cmd/cluster/README.md → cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Of course, due to my busy work and lack of more production environment verificat
## Build

```shell
go build -o comqtt cmd/cluster/main.go
cd cmd
go build -o comqtt cluster/main.go
```

## Usage
Expand All @@ -35,7 +36,7 @@ go build -o comqtt cmd/cluster/main.go
Usage of ./comqtt:
-conf string
read the program parameters from the config file

-storage-way uint
storage way options:0 memory, 1 bolt, 2 badger, 3 redis (default 3)
-auth-ds uint
Expand Down Expand Up @@ -90,13 +91,13 @@ Usage of ./comqtt:

The startup supports two modes: command parameters and configuration file.

It is recommended that you use the configuration file mode for more detailed configuration.[Click to config example](../config/node1.yml).
It is recommended that you use the configuration file mode for more detailed configuration.[Click to config example](../cmd/config/node1.yml).

All configuration file examples are in the cmd/config directory. [Click to config examples](../config)
All configuration file examples are in the cmd/config directory. [Click to config examples](../cmd/config)

### Configure Redis

Start redis and configure redis addr, [click to config example](../config/node1.yml).
Start redis and configure redis addr, [click to config example](../cmd/config/node1.yml).

### Create Cluster

Expand Down
8 changes: 4 additions & 4 deletions cmd/config/node1.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
storage-way: 3 #Storage way optional items:0 memory、1 bolt、2 badger、3 redis;Only redis can be used in cluster mode.
bridge-way: 0 #Bridge way optional items:0 disable、1 kafka
bridge-path: ./cmd/config/bridge-kafka.yml #The bridge config file path
bridge-way: 1 #Bridge way optional items:0 disable、1 kafka
bridge-path: ./config/bridge-kafka.yml #The bridge config file path
pprof-enable: false #Whether to enable the performance analysis tool http://ip:6060

auth:
way: 0 #Authentication way: 0 anonymous, 1 username and password, 2 clientid
datasource: 1 #Optional items:0 free、1 redis、2 mysql、3 postgresql、4 http ...
conf-path: ./cmd/config/auth-redis.yml #The config file path should correspond to the auth-datasource
blacklist-path: ./cmd/config/blacklist.yml #Special rules outside the usual rules (black and white list),this configuration is invalid for anonymous authentication
conf-path: ./config/auth-redis.yml #The config file path should correspond to the auth-datasource
blacklist-path: ./config/blacklist.yml #Special rules outside the usual rules (black and white list),this configuration is invalid for anonymous authentication

cluster:
discovery-way: 0 #The node discovery way in the cluster: 0 serf、1 memberlist、2 mDNS
Expand Down
6 changes: 3 additions & 3 deletions cmd/config/node2.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
storage-way: 3 #Storage way optional items:0 memory、1 bolt、2 badger、3 redis;Only redis can be used in cluster mode.
bridge-way: 0 #Bridge way optional items:0 disable、1 kafka
bridge-path: ./cmd/config/bridge-kafka.yml #The bridge config file path
bridge-path: ./config/bridge-kafka.yml #The bridge config file path
pprof-enable: false #Whether to enable the performance analysis tool http://ip:6060

auth:
way: 0 #Authentication way: 0 anonymous, 1 username and password, 2 clientid
datasource: 1 #Optional items:0 free、1 redis、2 mysql、3 postgresql、4 http ...
conf-path: ./cmd/config/auth-redis.yml #The config file path should correspond to the auth-datasource
blacklist-path: ./cmd/config/blacklist.yml #Special rules outside the usual rules (black and white list),this configuration is invalid for anonymous authentication
conf-path: ./config/auth-redis.yml #The config file path should correspond to the auth-datasource
blacklist-path: ./config/blacklist.yml #Special rules outside the usual rules (black and white list),this configuration is invalid for anonymous authentication

cluster:
discovery-way: 0 #The node discovery way in the cluster: 0 serf、1 memberlist、2 mDNS
Expand Down
6 changes: 3 additions & 3 deletions cmd/config/node3.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
storage-way: 3 #Storage way optional items:0 memory、1 bolt、2 badger、3 redis;Only redis can be used in cluster mode.
bridge-way: 0 #Bridge way optional items:0 disable、1 kafka
bridge-path: ./cmd/config/bridge-kafka.yml #The bridge config file path
bridge-path: ./config/bridge-kafka.yml #The bridge config file path
pprof-enable: false #Whether to enable the performance analysis tool http://ip:6060

auth:
way: 0 #Authentication way: 0 anonymous, 1 username and password, 2 clientid
datasource: 1 #Optional items:0 free、1 redis、2 mysql、3 postgresql、4 http ...
conf-path: ./cmd/config/auth-redis.yml #The config file path should correspond to the auth-datasource
blacklist-path: ./cmd/config/blacklist.yml #Special rules outside the usual rules (black and white list),this configuration is invalid for anonymous authentication
conf-path: ./config/auth-redis.yml #The config file path should correspond to the auth-datasource
blacklist-path: ./config/blacklist.yml #Special rules outside the usual rules (black and white list),this configuration is invalid for anonymous authentication

cluster:
discovery-way: 0 #The node discovery way in the cluster: 0 serf、1 memberlist、2 mDNS
Expand Down
4 changes: 2 additions & 2 deletions cmd/config/single.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
storage-way: 1 #Storage way optional items:0 memory、1 bolt、2 badger、3 redis;Only redis can be used in cluster mode.
storage-path: comqtt.db #Local storage path in single node mode.
bridge-way: 0 #Bridge way optional items:0 disable、1 kafka
bridge-path: ./cmd/config/bridge-kafka.yml #The bridge config file path
bridge-path: ./config/bridge-kafka.yml #The bridge config file path
pprof-enable: false #Whether to enable the performance analysis tool http://ip:6060

auth:
way: 0 #Authentication way: 0 anonymous, 1 username and password, 2 clientid
datasource: 1 #Optional items:0 free、1 redis、2 mysql、3 postgresql、4 http ...
conf-path: ./cmd/config/auth-redis.yml #The config file path should correspond to the auth-datasource
conf-path: ./config/auth-redis.yml #The config file path should correspond to the auth-datasource

mqtt:
tcp: :1883
Expand Down

0 comments on commit b16b02d

Please sign in to comment.