Search code examples
mongodbdockerfiwarecomplex-event-processingfiware-perseo

Perseo fe docker instance fail to start


I am facing with the following issue: I am trying to deploy FIWARE-Perseo to my Centos 7 server as docker instances. Although the perseocore instance runs without a problem, it doesn't happen the same with the perseo front end. It is created but fails to start. From the logs it is clear that the problem is associated to the 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]

I have used the instructions from the following link, in a system where Orion and MongoDB were already running as docker instances: Running together with Perseo Core and Orion Context Broker Thank you very much in advance for any help you can provide me.


Solution

  • Please, make sure you use PERSEO_MONGO_ENDPOINT instead of PERSEO_MONGO_HOST.

    Anyway, the following code is an example of a docker-compose.yml file you can use to deploy perseo with orion:

    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
                - [email protected]
                - PERSEO_SMTP_AUTH_PASS=XXXXX
    networks:
        main:
            external: true