安装和运行天鹅座(订阅猎户座)。Orion接收来自客户端的通知(通过ioagent)。如何启动和创建用于持久性的postgresql数据库?
从远程服务器访问fiware。不确定要执行什么命令并启动postgres。
发布于 2018-12-20 21:31:09
有一个关于将历史数据持久化到PostGres的FIWARE教程
在docker-compose中,PostGres可以设置如下:
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配置,如下所示:
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的订阅时,应该实例化数据库实例。
例如:
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
}'https://stackoverflow.com/questions/53485923
复制相似问题