Perseo fe docker 实例无法启动

Perseo fe docker instance fail to start

我面临以下问题: 我正在尝试将 FIWARE-Perseo 作为 docker 个实例部署到我的 Centos 7 服务器。尽管 perseocore 实例运行没有问题,但它与 perseo 前端的情况不同。它已创建但无法启动。从日志中可以清楚地看出问题与 mongodb:

有关

Changing PERSEO_CORE_URL to environment value: http://localhost:8080 Changing PERSEO_ORION_URL to environment value: http://myip:1026/v1/updateContext Changing PERSEO_LOG_LEVEL to environment value: debug time=2018-06-01T14:36:02.691Z | lvl=INFO | corr=n/a | trans=n/a | op=start | comp=perseo-fe | msg=starting perseo the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,appname,auth] the server/replset/mongos options are deprecated, all their options are supported at the top level of the options object [poolSize,ssl,sslValidate,sslCA,sslCert,sslKey,sslPass,sslCRL,autoReconnect,noDelay,keepAlive,connectTimeoutMS,family,socketTimeoutMS,reconnectTries,reconnectInterval,ha,haInterval,replicaSet,secondaryAcceptableLatencyMS,acceptableLatencyMS,connectWithNoPrimary,authSource,w,wtimeout,j,forceServerObjectId,serializeFunctions,ignoreUndefined,raw,bufferMaxEntries,readPreference,pkFactory,promiseLibrary,readConcern,maxStalenessSeconds,loggerLevel,logger,promoteValues,promoteBuffers,promoteLongs,domainsEnabled,keepAliveInitialDelay,checkServerIdentity,validateOptions,appname,auth] time=2018-06-01T14:36:02.789Z | lvl=ERROR | corr=n/a | trans=n/a | op=checkDB | comp=perseo-fe | msg=connect failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017] time=2018-06-01T14:36:02.790Z | lvl=ERROR | corr=n/a | trans=n/a | op=start | comp=perseo-fe | msg=failed to connect to server [localhost:27017] on first connect [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=starting perseo time=2018-06-01T14:36:02.792Z | lvl=FATAL | corr=n/a | trans=n/a | op=perseo | comp=perseo-fe | msg=failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]

我在 Orion 和 MongoDB 已经 运行 作为 docker 实例的系统中使用了以下 link 中的说明: Running together with Perseo Core and Orion Context Broker 非常感谢您能为我提供的任何帮助。

请确保使用 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