安装教程
# docker-compose模式安装
docker模式需要提前安装好docker
# docker安装(已安装跳过)
linux环境下安装说明-建议ubuntu及root权限(win或其他环境自行参考): docker安装(如果安装不上可以百度对应的系统的安装方式):
curl -sSL https://get.daocloud.io/docker | sh
sudo systemctl start docker
1
2
2
# iThings安装
- 首先
git clone https://gitee.com/i-Things/iThings.git
获取最新的iThings cd iThings/deploy/docker/run-all
进入安装文件夹- 执行以下命令(win下可以在git bash中执行):
docker compose up -d
1
- 访问
127.0.0.1:7777
体验iThings吧~
# 源码安装模式
首先把所有代码拉下来
- 后端:
# 共享库(不修改可以不clone)
git clone https://gitee.com/i-Things/share.git
# 中台模块
git clone https://gitee.com/i-Things/core.git
# 物联网模块
git clone https://gitee.com/i-Things/iThings.git
1
2
3
4
5
6
2
3
4
5
6
- 前端(企业版开发才需要,私有仓库):
# 中台主模块
git clone git@codeup.aliyun.com:642f7dca8b47795dae985084/iThings/iThings-main-admin-vue-code.git
# 物联网模块
git clone git@codeup.aliyun.com:642f7dca8b47795dae985084/iThings/iThings-things-admin-vue.git
1
2
3
4
2
3
4
# 第三方依赖安装
# 后端组件
物理机安装方式需要自行安装以下组件:
- 高性能缓存:redis (opens new window)
- 高性能消息队列:nats (opens new window)
- 关系型数据库:mysql(请使用mariaDB或mysql5.7)或pgsql (opens new window)
- 微服务注册中心(单体可不使用):etcd
- 云原生轻量级对象存储:minio (opens new window)
- 开源、高性能、云原生,极简的时序数据处理平台:tdengine (opens new window)
- 大规模可弹性伸缩的云原生分布式物联网MQTT消息服务器:emqx(默认配置支持5.x) (opens new window)
docker-compose安装:
cd iThings/docker/run-env
进入安装文件夹- 执行以下命令(win下可以在git bash中执行):
docker compose up -d
1
# 前端组件
- node.js:node(版本14以上) (opens new window)
# 配置修改
# emqx配置修改
参考: emqx配置方法
# 运行
# 后端
# 运行core服务
cd core/server/apisvr
go run .
# 另开一个窗口
# 运行物联网模块
cd iThings/server/apisvr
go run .
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 前端
# 开源版本前端运行
- 下载 前端压缩包
- 复制到静态文件的目录
mkdir -p core/dist/app
cd core/dist/app
tar -xvzf frontFile_latest.tgz
rm frontFile_latest.tgz
cd -
1
2
3
4
5
2
3
4
5
# 企业版源码模式
# 调试
# 运行主模块
cd iThings-main-admin-vue-code
npm run dev
# 另开一个窗口
# 运行物联网模块
cd iThings-things-admin-vue
npm run dev
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 编译
# 运行主模块
cd iThings-main-admin-vue-code
npm run build:pro
cp dist/* ../core/dist/app/core
# 另开一个窗口
# 运行物联网模块
cd iThings-things-admin-vue
npm run build:pro
cp dist/* ../core/dist/app/things
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
# 体验
访问 127.0.0.1:7777
体验iThings吧~
# fqa
- 产品及设备创建报错:
- 请检查数据库是否创建成功
- iThings请求tdengine是通过http的方式请求,参考官方文档检查td的服务是否启动: https://docs.taosdata.com/connector/rest-api/
- 设备在线状态在服务器上不正确或设备可以订阅任何topic:检查
emqx_auth_http.conf
这个文件配置的ip是否正确 - iThings启动不起来,报mqtt连接不上:同样需要检查
emqx_auth_http.conf
这个文件配置的ip是否正确,emqx需要通过http来请求iThings进行认证
上次更新: 2024/09/21, 00:22:32