1

I have mongodb running on once ec2 instance and pencilblue running on another instance. After installing penciulblue, i've used the command pbctrl start to start the server. Then i get the following error

2016-04-25T20:35:12.100Z - error: [1] System[1]: uncaught Exception detected : Error: MongoError: connect ECONNREFUSED - mongodb://<private IP of mongodb EC2 inatnce>:27017/pencilblue?
Is your instance running?
    at /home/ubuntu/PencilBlue/pencilblue/include/dao/db_manager.js:113:31
    at /home/ubuntu/PencilBlue/pencilblue/node_modules/mongodb/lib/mongo_client.js:267:20
    at /home/ubuntu/PencilBlue/pencilblue/node_modules/mongodb/lib/db.js:218:14
    at null.<anonymous> (/home/ubuntu/PencilBlue/pencilblue/node_modules/mongodb/lib/server.js:226:9)
    at g (events.js:180:16)
    at emit (events.js:98:17)
    at null.<anonymous> (/home/ubuntu/PencilBlue/pencilblue/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:263:68)
    at g (events.js:180:16)
    at emit (events.js:98:17)
    at null.<anonymous> (/home/ubuntu/PencilBlue/pencilblue/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:77:12)

In the config.js file of pencilblue, i've mentioned the db details as follows

"db": {
        "type": "mongo",
        "servers": [
            "mongodb://<private IP of mongodb EC2 inatnce>:27017/"
        ],
        "name": "pencilblue",
        "writeConcern": 1
    }

Thanks in advance.

avenger_9
  • 15
  • 3

1 Answers1

0

Open port 27017 of the security group that your MongoDB server is in, to allow access from the security group that your PencilBlue server is in.

Also make sure you have updated the bind_ip setting in your MongoDB config so that it will listen for connections outside localhost.

Mark B
  • 183,023
  • 24
  • 297
  • 295
  • I have assigned the pubilc DNS of the instance running pencilblue to the `bind_ip` in mongod.config file. Still i am facing sam error – avenger_9 Apr 29 '16 at 02:49
  • @avenger_9 I don't think that will work at all. Just change the bind_ip to `0.0.0.0` – Mark B Apr 29 '16 at 13:05