sidebar_position: 4

如何部署IoTSharp?

本教程使用rabbit_mongo_influx 方式进行部署

修改docker-compose.yml文件

:::danger 注意 influxdb_cli容器的相关配置,通过此命令行容器,初始化influxdb, 初始化之前需要提前设置好token等,如果自己自行配置, 则直接删除此配置即可。 :::

```yml title=”/IoTSharp/Deployments/rabbit_mongo_influx/docker-compose.yml” influxdb_cli: links:

  1. - influx
  2. image: quay.io/influxdb/influxdb:v2.0.4
  3. entrypoint: influx setup --bucket iotsharp-bucket -t iotsharp-token -o iotsharp --username=root --password=1-q2-w3-e4-r5-t --host=http://influx:8086 -f
  4. restart: on-failure:20
  5. depends_on:
  6. - influx
  1. ## 启动容器
  2. 进入`/IoTSharp/Deployments/rabbit_mongo_influx`,执行
  3. ```bash docker-compose
  4. docker-compose up -d

看到下图说明运行成功 docker-compose启动成功

初始化influxdb

浏览器访问 http://localhost:8086/,初始化influxdb

初始化influxdb

Org: iotsharp Bucket: iotsharp-bucket

然后点Config Later

创建token

添加token

复制token

复制token

修改配置文件

```yml title=”/IoTSharp/Deployments/rabbit_mongo_influx/appsettings.Production.json” “TelemetryStorage”:”http://influx:8086/?org=iotsharp&bucket=iotsharp-bucket&token=iotsharp-token&&latest=-72h“,

  1. 将**iotsharp-token**修改为你的真实token
  2. ## 重启IoTSharp容器
  3. 命令行执行
  4. ```bash docker
  5. docker restart iotsharp

注册

Chrome浏览器访问 http://localhost:2927/

注册

访问

注册后登入进入首页 访问