首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Fiware:创建Postgresql

Fiware:创建Postgresql
EN

Stack Overflow用户
提问于 2018-11-26 17:06:57
回答 1查看 83关注 0票数 1

安装和运行天鹅座(订阅猎户座)。Orion接收来自客户端的通知(通过ioagent)。如何启动和创建用于持久性的postgresql数据库?

从远程服务器访问fiware。不确定要执行什么命令并启动postgres。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-20 21:31:09

有一个关于将历史数据持久化到PostGres的FIWARE教程

docker-compose中,PostGres可以设置如下:

代码语言:javascript
复制
postgres-db:
    image: postgres
    hostname: postgres-db
    container_name: db-postgres
    expose:
        - "5432"
    ports:
        - "5432:5432"
    networks:
        - default
    environment:
        - "POSTGRES_PASSWORD=password"
        - "POSTGRES_USER=postgres"
        - "POSTGRES_DB=postgres"

Cygnus配置镜像PostGre配置,如下所示:

代码语言:javascript
复制
cygnus:
    image: fiware/cygnus-ngsi
    hostname: cygnus
    container_name: fiware-cygnus
    networks:
        - default
    depends_on:
        - postgres-db
    expose:
        - "5080"
    ports:
        - "5050:5050"
        - "5080:5080"
    environment:
        - "CYGNUS_POSTGRESQL_HOST=postgres-db"
        - "CYGNUS_POSTGRESQL_PORT=5432"
        - "CYGNUS_POSTGRESQL_USER=postgres"
        - "CYGNUS_POSTGRESQL_PASS=password"
        - "CYGNUS_SERVICE_PORT=5050"
        - "CYGNUS_API_PORT=5080"
        - "CYGNUS_POSTGRESQL_ENABLE_CACHE=true"

当触发对Cygnus的订阅时,应该实例化数据库实例。

例如:

代码语言:javascript
复制
curl -iX POST \
  'http://orion:1026/v2/subscriptions' \
  -H 'Content-Type: application/json' \
  -H 'fiware-service: <xxxxxx>' \
  -H 'fiware-servicepath: <yyyyyy>' \
  -d '{
  "description": "Notify Cygnus of all context changes",
  "subject": {
    "entities": [
      {
        "idPattern": ".*"
      }
    ]
  },
  "notification": {
    "http": {
      "url": "http://cygnus:5050/notify"
    },
    "attrsFormat": "legacy"
  },
  "throttling": 5
}'
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53485923

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档