z-docs/docs/intro.md
2023-07-18 01:11:42 +08:00

71 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
sidebar_position: 1
---
# 快速开始
让我们在 **5分钟内完成 zhub 组件安装**.
## 开始
从零开始 **搭建 zhub 服务**.
### 下载软件包
- [zhub.zip](https://baidu.com) 包含以下内容:
- 绿色版本 Window 和 Linux 运行包
- 配置文件: app.ini
- java连接驱动zhub-clien.jar
![zhub-zip.png](https://img.1216.top/docs/zhub-zip.png)
### 配置 app.ini
```bash
# app.ini
[log]
handlers=console # console|file
level=debug # info|debug|error
file=zhub.log
[service]
watch=0.0.0.0:711
addr=0.0.0.0:1216
auth=1 # 是否开启连接授权
[data]
dir=D:/data # 数据目录
[ztimer] # timer 使用的数据库配置
db.addr=47.111.150.118:6063
db.user=root
db.password=*Zhong@0510!
db.database=zhub
[auth]
admin=123456 # 授权连接账号 admin@123456
lxy=123456
```
### 启动服务
```bash
# window
./zhub.exe
# linux
./zhub.sh
```
## 使用
### Java 客户端连接
```java
ZhubClient zhub = new ZhubClient("", "");
zhub.subscribe("topic-x", x -> {
// do something.
});
```
### Java 客户端连接