我面临以下问题: 我正在尝试将FIWARE-Perseo部署到我的Centos 7服务器作为docker实例。尽管perseocore实例运行没有问题,但perseo前端并没有发生同样的情况。它已创建但无法启动。从日志中可以清楚地看出问题与mongodb有关:
将PERSEO_CORE_URL更改为环境值:http://localhost:8080 将PERSEO_ORION_URL更改为环境值: http://myip:1026/v1/updateContext将PERSEO_LOG_LEVEL更改为 环境值:调试时间= 2018-06-01T14:36:02.691Z | lvl = INFO | corr = n / a | trans = n / a | op =开始| comp = perseo-fe | msg =开始perseo 不推荐使用server / replset / mongos选项,以及它们的所有选项 在选项对象的顶级支持 [poolSize,SSL,sslValidate,sslCA,的sslcert,sslKey,sslPass,sslCRL,autoReconnect的,无需等待,的keepAlive,connectTimeoutMS,家庭,socketTimeoutMS,reconnectTries,reconnectInterval,哈,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,W,wtimeout ,J,forceServerObjectId,serializeFunctions,ignoreUndefined,生,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,记录器,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,应用程序名称,AUTH] 不推荐使用server / replset / mongos选项,以及它们的所有选项 在选项对象的顶级支持 [poolSize,SSL,sslValidate,sslCA,的sslcert,sslKey,sslPass,sslCRL,autoReconnect的,无需等待,的keepAlive,connectTimeoutMS,家庭,socketTimeoutMS,reconnectTries,reconnectInterval,哈,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,W,wtimeout ,J,forceServerObjectId,serializeFunctions,ignoreUndefined,生,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,记录器,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,应用程序名称,AUTH] 时间= 2018-06-01T14:36:02.789Z | lvl =错误| corr = n / a | trans = n / a | op = checkDB | comp = perseo-fe | msg =连接无法连接到服务器 首次连接[localhost:27017] [MongoError:连接ECONNREFUSED 127.0.0.1:27017]时间= 2018-06-01T14:36:02.790Z | lvl =错误| corr = n / a | trans = n / a | op =开始| comp = perseo-fe | msg =无法连接 第一次连接时服务器[localhost:27017] [MongoError:connect ECONNREFUSED 127.0.0.1:27017] time = 2018-06-01T14:36:02.792Z | LVL = INFO | corr = n / a | trans = n / a | op = perseo | comp = perseo-fe | MSG =起始 perseo time = 2018-06-01T14:36:02.792Z | lvl =致命| corr = n / a | trans = n / a | op = perseo | comp = perseo-fe | msg =无法连接 第一次连接时服务器[localhost:27017] [MongoError:connect ECONNREFUSED 127.0.0.1:27017]
在Orion和MongoDB已作为docker实例运行的系统中,我使用了以下链接中的说明: Running together with Perseo Core and Orion Context Broker 非常感谢您提供的任何帮助。
答案 0 :(得分:1)
请确保使用PERSEO_MONGO_ENDPOINT
代替PERSEO_MONGO_HOST
。
无论如何,以下代码是一个docker-compose.yml
文件的示例,您可以使用该文件与orion一起部署perseo:
version: "3"
services:
mongo:
image: mongo:3.2
networks:
- main
volumes:
- ./mongodata:/data/db
orion:
image: fiware/orion
depends_on:
- mongo
links:
- mongo
ports:
- "1026:1026"
networks:
main:
aliases:
- orion.docker
command: -dbhost mongo
perseo-core:
image: telefonicaiot/perseo-core:1.1.0
networks:
main:
aliases:
- perseo-core
command: -perseo_fe_url perseo-fe:9090
perseo-fe:
image: telefonicaiot/perseo-fe:1.5.0
ports:
- 9090:9090
networks:
main:
aliases:
- perseo-fe
depends_on:
- perseo-core
environment:
- PERSEO_MONGO_ENDPOINT=mongo
- PERSEO_CORE_URL=http://perseo-core:8080
- PERSEO_LOG_LEVEL=debug
- PERSEO_ORION_URL=http://orion.docker:1026/v1/updateContext
- PERSEO_SMTP_HOST=smtp.gmail.com
- PERSEO_SMTP_PORT=465
- PERSEO_SMTP_SECURE=true
- PERSEO_SMTP_AUTH_USER=XXXXX@XXXXX.com
- PERSEO_SMTP_AUTH_PASS=XXXXX
networks:
main:
external: true