快速开始
本页用于从源码启动一个单节点 YedMQ 实例。
警告
YedMQ 仍在持续开发中,目前还不建议直接承载生产负载。
前置条件
- Rust 1.75 或更高版本
protoc- 可选:
mosquitto_pub与mosquitto_sub,用于快速验证
1. 克隆并编译
git clone https://github.com/designershao/YedMQ.git
cd YedMQ
cargo build --release -p yedmq
2. 创建本地配置文件
cp yedmq.toml.example yedmq.toml
启动前建议先检查监听器、API 认证、集群和插件相关配置。
3. 启动 Broker
RUST_LOG=info ./target/release/yedmq
YedMQ 默认从当前工作目录读取 ./yedmq.toml,因此最简单的方式是在项目根目录下启动该二进制。
4. 验证 MQTT 连通性
先打开一个终端:
mosquitto_sub -h 127.0.0.1 -p 1883 -t test/topic
再打开另一个终端:
mosquitto_pub -h 127.0.0.1 -p 1883 -t test/topic -m "hello yedmq"
5. 验证管理 API
示例配置中已经为 REST API 打开了 Basic Authentication:
curl -u admin:change_me_in_production http://127.0.0.1:3456/api/v1/system_info