-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
116 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 服务部署指南 | ||
|
||
Pando物联网云平台采用微服务架构。除了系统依赖的MySQL,MongoDB等开源服务,平台自身目前有以下几个服务组成: | ||
|
||
- **[registry](registry.md)**:维护平台全局配置和信息的服务。 | ||
- **[devicemanager](devicemanager.md)**: 设备信息和设备状态维护。 | ||
- **[controller](controller.md)**: 和设备进行信息交互的路由服务。 | ||
- **[apiprovider](apiprovider.md)**: 为应用提供REST接口。 | ||
- **[httpaccess](httpaccess.md)**: 设备API服务,提供设备登陆、注册等逻辑。 | ||
- **[mqttaccess](mqttaccess.md)**:MQTT接入服务。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# apiprovider | ||
|
||
`apiprovider`服务为应用提供HTTP REST接口。 | ||
|
||
## 工作原理 | ||
[应用接口文档](../api-doc/application.md) | ||
|
||
## 启动参数 | ||
* `-etcd` etcd服务的访问地址,必需参数。如`http://localhost:2379`,如果etcd是多副本部署,可以用分号隔开访问地址,如`http://192.168.0.2:2379;http://192.168.0.3:2379`。 | ||
* `-rpchost` rpc服务访问地址,必需参数。该参数定义该服务对其他服务提供的rpc服务的监听地址。如`http://localhost:20034`。 | ||
* `-httphost` HTTP服务地址,必须参数。格式为`ip:port`如`localhost:443`,为了安全考虑,建议最好只绑定内网ip和端口。如果需要外网访问,强烈建议开启https选项。 | ||
* `-usehttps` 是否启动https服务,默认不启用。如果启用,则必须提供以下`cafile`和`keyfile`两个参数。 | ||
* `-cafile` ssl加密证书的证书文件路径(pem格式)。 | ||
* `-keyfile` ssl加密证书的密钥文件路径(pem格式)。 | ||
* `-loglevel` 服务打印日志的级别,选填,如果没有指定则默认为`info`级别。 | ||
|
||
> 说明:ssl证书和密钥的pem文件生成方法可以参考[这里](http://killeraction.iteye.com/blog/858325) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# controller | ||
|
||
`controller`服务作为和设备进行信息交互时的控制节点,为访问设备提供路由服务,并接收设备上报的信息。 | ||
|
||
## 工作原理 | ||
`controller`主要负责设备信息交互,具体分两种场景: | ||
|
||
* 当应用需要向设备发送信息时,`controller`会向`devicemanager` 查询当前设备的在线信息,并根据反馈的接入点,向接入服务器发送信息转发请求。 | ||
* 当设备向平台发送数据时,`controller`会将数据存入MongoDB,如需通知应用则放入消息队列。 | ||
|
||
## 启动参数 | ||
* `-etcd` etcd服务的访问地址,必需参数。如`http://localhost:2379`,如果etcd是多副本部署,可以用分号隔开访问地址,如`http://192.168.0.2:2379;http://192.168.0.3:2379`。 | ||
* `-rpchost` rpc服务访问地址,必需参数。该参数定义该服务对其他服务提供的rpc服务的监听地址。如`http://localhost:20034`。 | ||
* `-mongohost` MongoDB地址,可选参数。如果没有提供则为`localhost`,如果需要指定,格式为`ip:port`如`192.168.0.3:27017`。 | ||
* `-loglevel` 服务打印日志的级别,选填,如果没有指定则默认为`info`级别。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# devicemanager | ||
|
||
`devicemanager`维护了设备的状态,如设备当前在哪台接入服务器接入,设备是否在线等。 | ||
|
||
## 工作原理 | ||
`devicemanager`是无状态的,采用redis存储了设备的实时状态信息,并对外提供了rpc接口供其他服务查询设备的当前信息。 | ||
|
||
## 启动参数 | ||
* `-etcd` etcd服务的访问地址,必需参数。如`http://localhost:2379`,如果etcd是多副本部署,可以用分号隔开访问地址,如`http://192.168.0.2:2379;http://192.168.0.3:2379`。 | ||
* `-rpchost` rpc服务访问地址,必需参数。该参数定义该服务对其他服务提供的rpc服务的监听地址。如`http://localhost:20034`。 | ||
* `-loglevel` 服务打印日志的级别,选填,如果没有指定则默认为`info`级别。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# httpaccess | ||
|
||
`httpaccess`服务提供了供设备注册、登录的HTTP[接口](../api-doc/device.md)。 | ||
|
||
## 启动参数 | ||
* `-etcd` etcd服务的访问地址,必需参数。如`http://localhost:2379`,如果etcd是多副本部署,可以用分号隔开访问地址,如`http://192.168.0.2:2379;http://192.168.0.3:2379`。 | ||
* `-httphost` HTTP服务地址,必须参数。格式为`ip:port`如`localhost:443`,强烈建议开启https选项。一般情况下绑定到外网的443端口(https默认端口)。 | ||
* `-usehttps` 是否启动https服务,默认不启用。如果启用,则必须提供以下`cafile`和`keyfile`两个参数。如果需要pando设备连接,则必须启用,否则无法连接。 | ||
* `-cafile` ssl加密证书的证书文件路径(pem格式)。 | ||
* `-keyfile` ssl加密证书的密钥文件路径(pem格式)。 | ||
* `-loglevel` 服务打印日志的级别,选填,如果没有指定则默认为`info`级别。 | ||
|
||
> 说明:ssl证书和密钥的pem文件生成方法可以参考[这里](http://killeraction.iteye.com/blog/858325) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# mqttaccess | ||
|
||
mqttaccess是支持mqtt协议的接入服务器,平台目前默认采用该协议。提供了tcp长连接连接设备,并对设备交互数据进行转发服务。 | ||
|
||
## 启动参数 | ||
|
||
* `-etcd` etcd服务的访问地址,必需参数。如`http://localhost:2379`,如果etcd是多副本部署,可以用分号隔开访问地址,如`http://192.168.0.2:2379;http://192.168.0.3:2379`。 | ||
* `-rpchost` rpc服务访问地址,必需参数。该参数定义该服务对其他服务提供的rpc服务的监听地址。如`http://localhost:20034`。 | ||
* `-tcphost` tcp服务地址,必须参数。格式为`ip:port`如`localhost:1883`,一般绑定为外网ip加1883端口(mqtt默认端口)。 | ||
* `-usetls` 是否启动ssl加密服务,默认不启用。如果启用,则必须提供以下`cafile`和`keyfile`两个参数。如果pando设备需接入,必须开启tls加密选项,否则无法接入。 | ||
* `-cafile` ssl加密证书的证书文件路径(pem格式)。 | ||
* `-keyfile` ssl加密证书的密钥文件路径(pem格式)。 | ||
* `-loglevel` 服务打印日志的级别,选填,如果没有指定则默认为`info`级别。 | ||
|
||
> 说明:ssl证书和密钥的pem文件生成方法可以参考[这里](http://killeraction.iteye.com/blog/858325) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# registry | ||
|
||
`registry`服务负责维护平台的全局配置。 | ||
|
||
## 工作原理 | ||
该服务采用MySQL存储平台的配置和设备注册信息。 | ||
|
||
`registry`服务是无状态的,在名为`PandoCloud`的库中维护了`application`, `vendor`, `product`以及`device`表,并为了加快访问速度提供了缓存机制。 | ||
|
||
## 启动参数列表 | ||
* `-etcd` etcd服务的访问地址,必需参数。如`http://localhost:2379`,如果etcd是多副本部署,可以用分号隔开访问地址,如`http://192.168.0.2:2379;http://192.168.0.3:2379`。 | ||
* `-rpchost` rpc服务访问地址,必需参数。该参数定义该服务对其他服务提供的rpc服务的监听地址。如`http://localhost:20034`。 | ||
* `-aeskey` 用来生成KEY的aes加密密钥串,必须参数。该参数为32位的任意字符串,如`ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP`。该参数越随机越好。 | ||
* `-dbhost` MySQL数据库的访问地址,选填,如果没有填写默认为`localhost`。 | ||
* `-dbport` MySQL数据库的访问端口,选填,如果没有填写默认为`3306`。 | ||
* `-dbuser` MySQL数据库的访问用户名,选填,如果没有填写默认为`root`。 | ||
* `-dbpass` MySQL数据库的访问用户密码,选填,如果没有填写默认为空。 | ||
* `-loglevel` 服务打印日志的级别,选填,如果没有指定则默认为`info`级别。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters