gpt4 book ai didi

postgresql - 固件:创建 Postgresql

转载 作者:行者123 更新时间:2023-11-29 13:12:06 27 4
gpt4 key购买 nike

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

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

最佳答案

有一个 FIWARE 教程可用于将历史数据保存到 PostGres

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
}'

关于postgresql - 固件:创建 Postgresql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53485923/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com