简体   繁体   English

NGSI ld 或 NGSI v2 的 IoT-Agent OPC-UA Docker-compose 设置

[英]IoT-Agent OPC-UA Docker-compose setting for NGSI ld or NGSI v2

In the docker-composer files of the OPC-UA IoT-Agent there are some comments unclear to me, in particular at the line is told to comment if you want to use NGSI-LD or to comment the line if you want to use NGSI-V2.OPC-UA IoT-Agent的 docker-composer 文件中,有一些我不清楚的评论,特别是如果您想使用 NGSI-LD,请在该行进行评论,或者如果您想使用 NGSI,请评论该行-V2。

Reading the strings that should be commented out however, it would seem that it is necessary to remove the comments from both the lines to use NGSI-LD, and comment both of them to use NGS-V2.然而,阅读应该注释掉的字符串,似乎有必要从两行中删除注释以使用 NGSI-LD,并注释它们以使用 NGS-V2。

Is my interpretation correct?我的解释正确吗? Thanks for clearing it up.感谢您清理它。

PS: the same issue is present to the file docker-compose-external-server.yml PS:文件 docker-compose-external-server.yml 也存在同样的问题

Setting up NGSI-v2 vs NGSI-LD is common to all IoT Agents.设置 NGSI-v2 与 NGSI-LD 对所有 IoT 代理都是通用的。 The Installation Guide describes the required configuration - default operation is NGSI-v2. 安装指南描述了所需的配置 - 默认操作是 NGSI-v2。

If you want to operate NGSI-LD, the ngsiVersion and jsonLdContext must be defined.如果要操作 NGSI-LD,则必须定义ngsiVersionjsonLdContext

{
    host: '192.168.56.101',
    port: '1026',
    ngsiVersion: 'ld',
    jsonLdContext: 'http://context.json-ld' 
}

ngsiVersion can be v2 , ld or mixed . ngsiVersion可以是v2ldmixed

Both settings can also be set up using Environment Variables which is more convenient when using Docker这两个设置也可以使用环境变量进行设置,这在使用 Docker 时更方便

Therefore, for NGSI-LD the following minimal set-up is required:因此,对于 NGSI-LD,需要以下最小设置:

  iotage:
    hostname: iotage
    image: iotagent4fiware/iotagent-opcua:latest
    environment:
      - IOTA_CB_NGSI_VERSION=ld
      - IOTA_JSON_LD_CONTEXT=https://path-to-context-file
      - IOTA_FALLBACK_TENANT=opcua_car
      - IOTA_RELAX_TEMPLATE_VALIDATION=true

For NGSI-v2 the following is required:对于 NGSI-v2,需要以下内容:

  iotage:
    hostname: iotage
    image: iotagent4fiware/iotagent-opcua:latest
    environment:
      - IOTA_CB_NGSI_VERSION=v2
      - IOTA_RELAX_TEMPLATE_VALIDATION=true

IOTA_RELAX_TEMPLATE_VALIDATION is required for OPC-UA to allow the provisioning of OPC-UA topics with = within them which would normally be disallowed. OPC-UA 需要IOTA_RELAX_TEMPLATE_VALIDATION以允许在其中提供带有=的 OPC-UA 主题,这通常是不允许的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM