fmbenhassine / gamehub.io

Real-time multiplayer game server based on Node + Express + SocketIO + MongoDB + ElasticSearch
MIT License
619 stars 119 forks source link

Adding Docker support to Chesshub #10

Closed galal-hussein closed 8 years ago

galal-hussein commented 9 years ago

Basically, docker directory contains docker-compose file to run elasticsearch, mongo, and to build a chesshub Docker image.

A few changes has been made to the initData.js to allow to use configuration to fetch the addresses of mongo and elasticsearch.

fmbenhassine commented 9 years ago

Fantastic! Thank you very much :+1: It would be great to add instructions on how to run the docker container in the README file.

I'll merge your PR asap. Great addition :-)

galal-hussein commented 9 years ago

Yeah sure, i will write a README file, glad you liked it :).

theborakompanioni commented 8 years ago

@benas Are you planning to merge this pull-request any time soon?

fmbenhassine commented 8 years ago

Hi, sorry I didn't noticed that @galal-hussein updated the PR with docker instructions. I just merged the PR. Thank you @galal-hussein :+1:

@theborakompanioni BTW, I saw your angular-chess repo which is great! I starred it some time ago and was planning to replace the current jQuery client side with a angular JS one using your project.

Do you think we can work together to integrate it into chesshub? It would be fantastic!

galal-hussein commented 8 years ago

@benas thanks :+1:

theborakompanioni commented 8 years ago

@benas I am currently just playing with your project a little bit. Adding angularjs and a build process with grunt/gulp is a lot of work - I cannot guarantee anything at the moment :/ It would be great indeed - I just do not want to make any promises.

theborakompanioni commented 8 years ago

@benas cannot seem to get it working.. it wont connect to mongodb.. @galal-hussein can you guide me into the right direction?

Output:

Creating docker_chesshub_1...
Attaching to docker_elasticsearch_1, docker_mongo_1, docker_chesshub_1
elasticsearch_1 | [2015-11-03 19:53:25,976][INFO ][node                     ] [Coldblood] version[1.4.5], pid[1], build[2aaf797/2015-04-27T08:06:06Z]
elasticsearch_1 | [2015-11-03 19:53:25,977][INFO ][node                     ] [Coldblood] initializing ...
elasticsearch_1 | [2015-11-03 19:53:25,980][INFO ][plugins                  ] [Coldblood] loaded [], sites []
elasticsearch_1 | [2015-11-03 19:53:28,360][INFO ][node                     ] [Coldblood] initialized
elasticsearch_1 | [2015-11-03 19:53:28,360][INFO ][node                     ] [Coldblood] starting ...
elasticsearch_1 | [2015-11-03 19:53:28,485][INFO ][transport                ] [Coldblood] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/172.17.0.40:9300]}
elasticsearch_1 | [2015-11-03 19:53:28,496][INFO ][discovery                ] [Coldblood] elasticsearch/bmgDzccfQXqOuku14EerdQ
elasticsearch_1 | [2015-11-03 19:53:32,257][INFO ][cluster.service          ] [Coldblood] new_master [Coldblood][bmgDzccfQXqOuku14EerdQ][3d9a4ebecc85][inet[/172.17.0.40:9300]], reason: zen-disco-join (elected_as_master)
elasticsearch_1 | [2015-11-03 19:53:32,272][INFO ][http                     ] [Coldblood] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/172.17.0.40:9200]}
elasticsearch_1 | [2015-11-03 19:53:32,273][INFO ][node                     ] [Coldblood] started
elasticsearch_1 | [2015-11-03 19:53:32,360][INFO ][gateway                  ] [Coldblood] recovered [0] indices into cluster_state
mongo_1         | mongod --help for help and startup options
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db/ 64-bit host=8ee2b59d8855
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] db version v2.2.7, pdfile version 4.5
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] git version: 6c2023ca359ed31407d999edcbe8cd7bd1d433b3
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] options: {}
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] journal dir=/data/db/journal
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] recover : no journal files present, no recovery needed
mongo_1         | Tue Nov  3 19:53:26 [websvr] admin web console waiting for connections on port 28017
mongo_1         | Tue Nov  3 19:53:26 [initandlisten] waiting for connections on port 27017
chesshub_1      | 
chesshub_1      | ##############################################################
chesshub_1      | #
chesshub_1      | #   !!! MONGOOSE WARNING !!!
chesshub_1      | #
chesshub_1      | #   This is an UNSTABLE release of Mongoose.
chesshub_1      | #   Unstable releases are available for preview/testing only.
chesshub_1      | #   DO NOT run this in production.
chesshub_1      | #
chesshub_1      | ##############################################################
chesshub_1      | 
chesshub_1      | Elasticsearch INFO: 2015-11-03T19:54:38Z
chesshub_1      |   Adding connection to http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-03T19:54:38Z
chesshub_1      |   starting request { method: 'HEAD',
chesshub_1      |     requestTimeout: 5000,
chesshub_1      |     castExists: true,
chesshub_1      |     path: '/',
chesshub_1      |     query: {} }
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-03T19:54:38Z
chesshub_1      |   starting request { method: 'POST', path: '/chesshub', query: {} }
chesshub_1      |   
chesshub_1      | 
chesshub_1      | 
chesshub_1      | events.js:72
chesshub_1      |         throw er; // Unhandled 'error' event
chesshub_1      |               ^
chesshub_1      | Error: failed to connect to [mongo:27017]
chesshub_1      |     at null.<anonymous> (/var/www/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:549:74)
chesshub_1      |     at emit (events.js:106:17)
chesshub_1      |     at null.<anonymous> (/var/www/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15)
chesshub_1      |     at emit (events.js:98:17)
chesshub_1      |     at Socket.<anonymous> (/var/www/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:533:10)
chesshub_1      |     at Socket.emit (events.js:95:17)
chesshub_1      |     at net.js:441:14
chesshub_1      |     at process._tickCallback (node.js:448:13)
galal-hussein commented 8 years ago

@theborakompanioni I can't replicate the problem, it works normally from my end:

root@chesshub-test:~/gamehub.io/docker# docker-compose up
Pulling elasticsearch (elasticsearch:1.4)...
1.4: Pulling from library/elasticsearch

d0ca40da9e35: Pulling fs layer
d1f66aef36c9: Pulling fs layer
1a8edfaacca3: Pulling fs layer
344de82d795d: Pulling fs layer
466fa4dbf23b: Pulling fs layer
260ad3becbcd: Pull complete
46372db681df: Pull complete
1225640cd7bb: Pull complete
06aa7049d4e1: Pull complete
22ffac48db15: Pull complete
35fe0c819b68: Pull complete
4b702c5af205: Pull complete
b6406d6de786: Pull complete
bc2745277865: Pull complete
c196e3c74b18: Pull complete
9ce2a4e715ab: Pull complete
e4fabfacf54a: Pull complete
412048d1f339: Pull complete
0fa4c1fd1b19: Pull complete
8c448edbf9cf: Pull complete
0147ae796fb6: Pull complete
048d9a916e41: Pull complete
9bcce8fc5ac8: Pull complete
909b93fcb394: Pull complete
e9e128d0a82f: Pull complete
43ba830526e0: Pull complete
ee62aaedb823: Pull complete
6eef77176484: Pull complete
Digest: sha256:b0ba4211b8fc4a3d0ee76120375bbddd7ecf84d2fb47bb1d3a8996992a4c6ef4
Status: Downloaded newer image for elasticsearch:1.4
Creating docker_elasticsearch_1
Pulling mongo (mongo:2.2.7)...
2.2.7: Pulling from library/mongo
1d53ee5b1800: Pull complete
74872ba2a3b0: Pull complete
258c8eb48222: Pull complete
952a583811c8: Pull complete
b60c8283e3a3: Pull complete
45a54dc4182c: Pull complete
e567a061db31: Pull complete
cb088c3e03d0: Pull complete
2c807aeec66b: Pull complete
20df17ebefde: Pull complete
5a057ed972a8: Pull complete
4a591590883b: Pull complete
3aba272ff46f: Pull complete
e3a439816e21: Pull complete
Digest: sha256:a3bd06d7b3c4588109ea47342695dd7c9fe0b8537dce2f29030fdaa2b36be489
Status: Downloaded newer image for mongo:2.2.7
Creating docker_mongo_1
Building chesshub
Step 1 : FROM node:0.10.40
0.10.40: Pulling from library/node
3407490564d8: Pull complete
d553eedcb1a3: Pull complete
4ece17deb9e8: Pull complete
bb753bb84f77: Pull complete
f75116246600: Pull complete
edd83d5ce2c1: Pull complete
a7d8016a6fdb: Pull complete
Digest: sha256:4bf6c1c6fdc8615fb586d190ebd872bf4f401dae4df34f320691ce2c82cf8c70
Status: Downloaded newer image for node:0.10.40
 ---> a7d8016a6fdb
Step 2 : MAINTAINER Hussein Galal
 ---> Running in f310ca945e43
 ---> 5d40becc4cf7
Removing intermediate container f310ca945e43
Step 3 : ENV GITHUB_REPO https://github.com/galal-hussein/gamehub.io.git
 ---> Running in e55b6a28d602
 ---> 04cbb11d1b4d
Removing intermediate container e55b6a28d602
Step 4 : RUN mkdir -p /var/www/app
 ---> Running in 4da54e054549
 ---> f0f5186e06f3
Removing intermediate container 4da54e054549
Step 5 : WORKDIR /var/www/app
 ---> Running in b335b7a91806
 ---> b2b45ac36fc1
Removing intermediate container b335b7a91806
Step 6 : RUN apt-get update && apt-get install git && git clone $GITHUB_REPO . && npm install
 ---> Running in 717ea1a615c1
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://httpredir.debian.org jessie InRelease
Get:2 http://httpredir.debian.org jessie-updates InRelease [135 kB]
Get:3 http://httpredir.debian.org jessie Release.gpg [2373 B]
Get:4 http://httpredir.debian.org jessie Release [148 kB]
Get:5 http://httpredir.debian.org jessie-updates/main amd64 Packages [3619 B]
Get:6 http://httpredir.debian.org jessie/main amd64 Packages [9035 kB]
Get:7 http://security.debian.org jessie/updates/main amd64 Packages [184 kB]
Fetched 9572 kB in 3s (2900 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
Cloning into '.'...

> bufferutil@1.2.1 install /var/www/app/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Entering directory '/var/www/app/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
make: Leaving directory '/var/www/app/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil/build'

> utf-8-validate@1.2.1 install /var/www/app/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Entering directory '/var/www/app/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build'
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory '/var/www/app/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate/build'

> bufferutil@1.2.1 install /var/www/app/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

make: Entering directory '/var/www/app/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build'
  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/obj.target/bufferutil.node
  COPY Release/bufferutil.node
make: Leaving directory '/var/www/app/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil/build'

> utf-8-validate@1.2.1 install /var/www/app/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

make: Entering directory '/var/www/app/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build'
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  COPY Release/validation.node
make: Leaving directory '/var/www/app/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build'

> kerberos@0.0.4 install /var/www/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory '/var/www/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
  SOLINK_MODULE(target) Release/obj.target/kerberos.node
  COPY Release/kerberos.node
make: Leaving directory '/var/www/app/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'

> bson@0.2.22 install /var/www/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory '/var/www/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
  CXX(target) Release/obj.target/bson/ext/bson.o
  SOLINK_MODULE(target) Release/obj.target/bson.node
  COPY Release/bson.node
make: Leaving directory '/var/www/app/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
connect-flash@0.1.1 node_modules/connect-flash

config@1.16.0 node_modules/config

chess.js@0.1.0 node_modules/chess.js

debug@2.0.0 node_modules/debug
└── ms@0.6.2

cookie-parser@1.3.5 node_modules/cookie-parser
├── cookie@0.1.3
└── cookie-signature@1.0.6

passport-local@1.0.0 node_modules/passport-local
└── passport-strategy@1.0.0

passport@0.2.2 node_modules/passport
├── passport-strategy@1.0.0
└── pause@0.0.1

serve-favicon@2.1.7 node_modules/serve-favicon
├── ms@0.6.2
├── fresh@0.2.4
└── etag@1.5.1 (crc@3.2.1)

morgan@1.3.2 node_modules/morgan
├── basic-auth@1.0.0
├── depd@0.4.5
└── on-finished@2.1.0 (ee-first@1.0.5)

express-session@1.12.1 node_modules/express-session
├── utils-merge@1.0.0
├── cookie-signature@1.0.6
├── on-headers@1.0.1
├── cookie@0.2.3
├── parseurl@1.3.0
├── depd@1.1.0
├── crc@3.3.0
├── uid-safe@2.0.0 (base64-url@1.2.1)
└── debug@2.2.0 (ms@0.7.1)

body-parser@1.8.4 node_modules/body-parser
├── media-typer@0.3.0
├── bytes@1.0.0
├── raw-body@1.3.0
├── depd@0.4.5
├── qs@2.2.4
├── on-finished@2.1.0 (ee-first@1.0.5)
├── iconv-lite@0.4.4
└── type-is@1.5.7 (mime-types@2.0.14)

express@4.9.8 node_modules/express
├── utils-merge@1.0.0
├── fresh@0.2.4
├── media-typer@0.3.0
├── merge-descriptors@0.0.2
├── parseurl@1.3.0
├── cookie@0.1.2
├── escape-html@1.0.1
├── range-parser@1.0.3
├── vary@1.0.1
├── cookie-signature@1.0.5
├── finalhandler@0.2.0
├── methods@1.1.0
├── serve-static@1.6.5
├── path-to-regexp@0.1.3
├── depd@0.4.5
├── qs@2.2.4
├── on-finished@2.1.1 (ee-first@1.1.0)
├── etag@1.4.0 (crc@3.0.0)
├── send@0.9.3 (ms@0.6.2, destroy@1.0.3, on-finished@2.1.0, mime@1.2.11)
├── proxy-addr@1.0.8 (forwarded@0.1.0, ipaddr.js@1.0.1)
├── type-is@1.5.7 (mime-types@2.0.14)
└── accepts@1.1.4 (negotiator@0.4.9, mime-types@2.0.14)

lodash@2.4.2 node_modules/lodash

hbs@2.7.0 node_modules/hbs
├── walk@2.2.1 (forEachAsync@2.2.1)
└── handlebars@1.3.0 (optimist@0.3.7, uglify-js@2.3.6)

moment@2.10.6 node_modules/moment

elasticsearch@3.1.3 node_modules/elasticsearch
├── forever-agent@0.5.2
├── chalk@0.5.1 (ansi-styles@1.1.0, escape-string-regexp@1.0.3, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── bluebird@2.8.2
├── lodash@3.10.1
└── lodash-node@2.4.1

socket.io@1.3.7 node_modules/socket.io
├── debug@2.1.0 (ms@0.6.2)
├── has-binary-data@0.1.3 (isarray@0.0.1)
├── socket.io-adapter@0.3.1 (object-keys@1.0.1, debug@1.0.2, socket.io-parser@2.2.2)
├── socket.io-parser@2.2.4 (isarray@0.0.1, debug@0.7.4, component-emitter@1.1.2, benchmark@1.0.0, json3@3.2.6)
├── engine.io@1.5.4 (base64id@0.1.0, debug@1.0.3, engine.io-parser@1.2.2, ws@0.8.0)
└── socket.io-client@1.3.7 (to-array@0.1.3, indexof@0.0.1, object-component@0.0.3, component-bind@1.0.0, debug@0.7.4, backo2@1.0.2, component-emitter@1.1.2, has-binary@0.1.6, parseuri@0.0.2, engine.io-client@1.5.4)

mongoose@3.9.7 node_modules/mongoose
├── regexp-clone@0.0.1
├── kareem@0.0.4
├── sliced@0.0.5
├── muri@0.3.1
├── hooks@0.3.2
├── mpromise@0.5.4
├── mpath@0.1.1
├── async@0.9.0
├── ms@0.1.0
├── mquery@1.0.0 (debug@0.7.4)
└── mongodb@1.4.12 (readable-stream@2.0.4, kerberos@0.0.4, bson@0.2.22)
 ---> 2bf48c96136c
Removing intermediate container 717ea1a615c1
Step 7 : ADD ./config/default.json config/default.json
 ---> c6f4f1b26975
Removing intermediate container 63325b850137
Step 8 : EXPOSE 3000
 ---> Running in bfb5f63f9bbd
 ---> 6213d7c05ab8
Removing intermediate container bfb5f63f9bbd
Step 9 : CMD node initData.js; node .
 ---> Running in e754b73415ac
 ---> 54c32734984b
Removing intermediate container e754b73415ac
Successfully built 54c32734984b
Creating docker_chesshub_1
Attaching to docker_elasticsearch_1, docker_mongo_1, docker_chesshub_1
elasticsearch_1 | [2015-11-03 22:00:31,556][INFO ][node                     ] [Lorna Dane] version[1.4.5], pid[1], build[2aaf797/2015-04-27T08:06:06Z]
elasticsearch_1 | [2015-11-03 22:00:31,562][INFO ][node                     ] [Lorna Dane] initializing ...
elasticsearch_1 | [2015-11-03 22:00:31,567][INFO ][plugins                  ] [Lorna Dane] loaded [], sites []
elasticsearch_1 | [2015-11-03 22:00:41,697][INFO ][node                     ] [Lorna Dane] initialized
elasticsearch_1 | [2015-11-03 22:00:41,704][INFO ][node                     ] [Lorna Dane] starting ...
elasticsearch_1 | [2015-11-03 22:00:42,888][INFO ][transport                ] [Lorna Dane] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/172.17.0.2:9300]}
elasticsearch_1 | [2015-11-03 22:00:43,165][INFO ][discovery                ] [Lorna Dane] elasticsearch/AdAKr9rST9-Aowo-KJxIEQ
elasticsearch_1 | [2015-11-03 22:00:47,105][INFO ][cluster.service          ] [Lorna Dane] new_master [Lorna Dane][AdAKr9rST9-Aowo-KJxIEQ][2803a0c0c8fc][inet[/172.17.0.2:9300]], reason: zen-disco-join (elected_as_master)
elasticsearch_1 | [2015-11-03 22:00:47,217][INFO ][http                     ] [Lorna Dane] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/172.17.0.2:9200]}
elasticsearch_1 | [2015-11-03 22:00:47,224][INFO ][node                     ] [Lorna Dane] started
elasticsearch_1 | [2015-11-03 22:00:47,275][INFO ][gateway                  ] [Lorna Dane] recovered [0] indices into cluster_state
mongo_1         | mongod --help for help and startup options
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db/ 64-bit host=9200832c6d76
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] db version v2.2.7, pdfile version 4.5
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] git version: 6c2023ca359ed31407d999edcbe8cd7bd1d433b3
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] options: {}
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] journal dir=/data/db/journal
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] recover : no journal files present, no recovery needed
mongo_1         | Tue Nov  3 22:00:55 [initandlisten] waiting for connections on port 27017
mongo_1         | Tue Nov  3 22:00:55 [websvr] admin web console waiting for connections on port 28017
chesshub_1      | 
chesshub_1      | ##############################################################
chesshub_1      | #
chesshub_1      | #   !!! MONGOOSE WARNING !!!
chesshub_1      | #
chesshub_1      | #   This is an UNSTABLE release of Mongoose.
chesshub_1      | #   Unstable releases are available for preview/testing only.
chesshub_1      | #   DO NOT run this in production.
chesshub_1      | #
chesshub_1      | ##############################################################
chesshub_1      | 
chesshub_1      | Elasticsearch INFO: 2015-11-03T22:03:11Z
chesshub_1      |   Adding connection to http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-03T22:03:11Z
chesshub_1      |   starting request { method: 'HEAD',
chesshub_1      |     requestTimeout: 5000,
chesshub_1      |     castExists: true,
chesshub_1      |     path: '/',
chesshub_1      |     query: {} }
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-03T22:03:11Z
chesshub_1      |   starting request { method: 'POST', path: '/chesshub', query: {} }
chesshub_1      |   
chesshub_1      | 
mongo_1         | Tue Nov  3 22:03:11 [initandlisten] connection accepted from 172.17.0.4:41754 #1 (1 connection now open)
mongo_1         | Tue Nov  3 22:03:11 [initandlisten] connection accepted from 172.17.0.4:41757 #2 (2 connections now open)
mongo_1         | Tue Nov  3 22:03:11 [initandlisten] connection accepted from 172.17.0.4:41758 #3 (3 connections now open)
mongo_1         | Tue Nov  3 22:03:11 [initandlisten] connection accepted from 172.17.0.4:41759 #4 (4 connections now open)
mongo_1         | Tue Nov  3 22:03:11 [initandlisten] connection accepted from 172.17.0.4:41760 #5 (5 connections now open)
mongo_1         | Tue Nov  3 22:03:11 [FileAllocator] allocating new datafile /data/db/test.ns, filling with zeroes...
mongo_1         | Tue Nov  3 22:03:11 [FileAllocator] creating directory /data/db/_tmp
mongo_1         | Tue Nov  3 22:03:11 [FileAllocator] done allocating datafile /data/db/test.ns, size: 16MB,  took 0.003 secs
chesshub_1      | Elasticsearch TRACE: 2015-11-03T22:03:13Z
chesshub_1      |   -> HEAD http://elasticsearch:9200/
chesshub_1      |   
chesshub_1      |   <- 200
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-03T22:03:13Z
chesshub_1      |   Request complete
chesshub_1      | 
chesshub_1      | elasticsearch is up and running!
mongo_1         | Tue Nov  3 22:03:13 [FileAllocator] allocating new datafile /data/db/test.0, filling with zeroes...
mongo_1         | Tue Nov  3 22:03:13 [FileAllocator] done allocating datafile /data/db/test.0, size: 64MB,  took 0.002 secs
mongo_1         | Tue Nov  3 22:03:13 [FileAllocator] allocating new datafile /data/db/test.1, filling with zeroes...
mongo_1         | Tue Nov  3 22:03:13 [FileAllocator] done allocating datafile /data/db/test.1, size: 128MB,  took 0.001 secs
mongo_1         | Tue Nov  3 22:03:13 [conn3] build index test.puzzles { _id: 1 }
mongo_1         | Tue Nov  3 22:03:13 [conn3] build index done.  scanned 0 total records. 0.005 secs
mongo_1         | Tue Nov  3 22:03:13 [conn4] build index test.quotes { _id: 1 }
mongo_1         | Tue Nov  3 22:03:13 [conn3] insert test.puzzles keyUpdates:0 locks(micros) w:1415114 1409ms
mongo_1         | Tue Nov  3 22:03:13 [conn4] build index done.  scanned 0 total records. 0.006 secs
mongo_1         | Tue Nov  3 22:03:13 [conn3] build index test.users { _id: 1 }
mongo_1         | Tue Nov  3 22:03:13 [conn3] build index done.  scanned 0 total records. 0.001 secs
chesshub_1      | 
chesshub_1      | /var/www/app/initData.js:38
chesshub_1      |     var fooId = user.id;
chesshub_1      |                     ^
chesshub_1      | TypeError: Cannot read property 'id' of null
chesshub_1      |     at /var/www/app/initData.js:38:21
chesshub_1      |     at /var/www/app/node_modules/mongoose/lib/query.js:1164:16
chesshub_1      |     at /var/www/app/node_modules/mongoose/node_modules/kareem/index.js:101:16
chesshub_1      |     at process._tickCallback (node.js:448:13)
mongo_1         | Tue Nov  3 22:03:13 [conn5] end connection 172.17.0.4:41760 (4 connections now open)
mongo_1         | Tue Nov  3 22:03:13 [conn4] end connection 172.17.0.4:41759 (4 connections now open)
mongo_1         | Tue Nov  3 22:03:13 [conn2] end connection 172.17.0.4:41757 (3 connections now open)
mongo_1         | Tue Nov  3 22:03:13 [conn1] end connection 172.17.0.4:41754 (1 connection now open)
mongo_1         | Tue Nov  3 22:03:13 [conn3] end connection 172.17.0.4:41758 (0 connections now open)
chesshub_1      | 
chesshub_1      | ##############################################################
chesshub_1      | #
chesshub_1      | #   !!! MONGOOSE WARNING !!!
chesshub_1      | #
chesshub_1      | #   This is an UNSTABLE release of Mongoose.
chesshub_1      | #   Unstable releases are available for preview/testing only.
chesshub_1      | #   DO NOT run this in production.
chesshub_1      | #
chesshub_1      | ##############################################################
chesshub_1      | 
mongo_1         | Tue Nov  3 22:03:16 [initandlisten] connection accepted from 172.17.0.4:41761 #6 (1 connection now open)
mongo_1         | Tue Nov  3 22:03:16 [initandlisten] connection accepted from 172.17.0.4:41762 #7 (2 connections now open)
mongo_1         | Tue Nov  3 22:03:16 [initandlisten] connection accepted from 172.17.0.4:41763 #8 (3 connections now open)
mongo_1         | Tue Nov  3 22:03:16 [initandlisten] connection accepted from 172.17.0.4:41764 #9 (4 connections now open)
mongo_1         | Tue Nov  3 22:03:16 [initandlisten] connection accepted from 172.17.0.4:41765 #10 (5 connections now open)

chesshub_1      | GET / 200 174.831 ms - 4953
chesshub_1      | GET /stylesheets/font-awesome.min.css 200 6.782 ms - 21984
chesshub_1      | GET /stylesheets/chesshub.css 200 5.267 ms - 1800
chesshub_1      | GET /stylesheets/chessboard-0.3.0.min.css 200 5.511 ms - 833
chesshub_1      | GET /stylesheets/messenger.css 200 3.353 ms - 3086
chesshub_1      | GET /stylesheets/messenger-spinner.css 200 3.840 ms - 5855
chesshub_1      | GET /stylesheets/bootstrap.min.css 200 404.874 ms - 109518
chesshub_1      | GET /stylesheets/messenger-theme-future.css 200 8.605 ms - 16828
chesshub_1      | GET /javascripts/bootstrap.min.js 200 9.948 ms - 31819
chesshub_1      | GET /javascripts/chessboard-0.3.0.min.js 200 6.135 ms - 14997
chesshub_1      | GET /javascripts/chess.min.js 200 5.784 ms - 17118
chesshub_1      | GET /javascripts/lodash.min.js 200 4.383 ms - 28151
chesshub_1      | GET /javascripts/moment.min.js 200 3.742 ms - 32364
chesshub_1      | GET /javascripts/jquery-2.1.1.min.js 200 795.938 ms - 84245
chesshub_1      | GET /javascripts/messenger.min.js 200 5.408 ms - 19068
chesshub_1      | GET /javascripts/messenger-theme-future.js 200 3.623 ms - 1301
chesshub_1      | GET /javascripts/chesshub.js 200 9.043 ms - 14274
chesshub_1      | GET /fonts/fontawesome-webfont.woff?v=4.2.0 200 8.660 ms - 65452
chesshub_1      | GET /javascripts/highcharts.js 200 979.496 ms - 153909
chesshub_1      | GET /images/chesspieces/wikipedia/wP.png 200 6.213 ms - 1571
chesshub_1      | GET /images/chesspieces/wikipedia/bR.png 200 3.856 ms - 748
chesshub_1      | GET /images/chesspieces/wikipedia/wB.png 200 11.439 ms - 2374
chesshub_1      | GET /images/chesspieces/wikipedia/bK.png 200 11.252 ms - 3009
chesshub_1      | GET /images/chesspieces/wikipedia/bP.png 200 4.437 ms - 777
chesshub_1      | GET /images/chesspieces/wikipedia/bB.png 200 3.955 ms - 1405
chesshub_1      | GET /images/chesspieces/wikipedia/bN.png 200 5.652 ms - 1875
chesshub_1      | GET /images/chesspieces/wikipedia/wR.png 200 3.984 ms - 1097
chesshub_1      | GET /images/chesspieces/wikipedia/bQ.png 200 5.871 ms - 2648
chesshub_1      | GET /images/chesspieces/wikipedia/wQ.png 200 6.235 ms - 3812
chesshub_1      | GET /images/chesspieces/wikipedia/wN.png 200 5.135 ms - 2388
chesshub_1      | GET /images/chesspieces/wikipedia/wK.png 200 3.836 ms - 2823

can you make sure that mongo container is up, and please post the logs of the container.

theborakompanioni commented 8 years ago

First of all: I am docker newbie and may be on a completely wrong track here. I think the problem is that mongodb is not yet ready (Sometimes elastic is not ready, but that seems to be less of a problem). I have upgraded to docker 1.9.0 and docker-compose 1.5.0.. after that, it initially worked. After rebooting it could not connect to mongodb (again). Now it has been working 5 times in a row.. then it's failing with the same error once again.

Sometimes it does not even work after mongo prints

[initandlisten] waiting for connections on port 27017
[void@localhost docker]$ nc -vv localhost 27017
Ncat: Version 6.47 ( http://nmap.org/ncat )
libnsock nsi_new2(): nsi_new (IOD #1)
libnsock nsock_connect_tcp(): TCP connection requested to 127.0.0.1:27017 (IOD #1) EID 8
libnsock nsock_trace_handler_callback(): Callback: CONNECT ERROR [Connection refused (111)] for EID 8 [127.0.0.1:27017]
Ncat: Connection refused.

Is there a way to wait for other docker containers to have been fully started and initialized? It seems that more folks have the same problem.. maybe implement the solution posted here as a workaround: http://stackoverflow.com/questions/21183088/how-can-i-wait-for-a-docker-container-to-be-up-and-running

@galal-hussein Can you try to reproduce it? Just start and stop it a few times. On my machine it is failing on every third try.

Working log (with elasticsearch booting after initData.js):

[void@localhost docker]$ docker-compose up
Starting docker_elasticsearch_1
Starting docker_mongo_1
Starting docker_chesshub_1
Attaching to docker_elasticsearch_1, docker_mongo_1, docker_chesshub_1
elasticsearch_1 | [2015-11-04 20:23:45,090][INFO ][node                     ] [Obadiah Stane] version[1.4.5], pid[1], build[2aaf797/2015-04-27T08:06:06Z]
elasticsearch_1 | [2015-11-04 20:23:45,090][INFO ][node                     ] [Obadiah Stane] initializing ...
mongo_1         | mongod --help for help and startup options
elasticsearch_1 | [2015-11-04 20:23:45,094][INFO ][plugins                  ] [Obadiah Stane] loaded [], sites []
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db/ 64-bit host=1ee26d23f4ba
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] db version v2.2.7, pdfile version 4.5
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] git version: 6c2023ca359ed31407d999edcbe8cd7bd1d433b3
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] options: {}
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] journal dir=/data/db/journal
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] recover begin
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] info no lsn file in journal/ directory
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] recover lsn: 0
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] recover /data/db/journal/j._0
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] recover cleaning up
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] removeJournalFiles
mongo_1         | Wed Nov  4 20:23:44 [initandlisten] recover done
mongo_1         | Wed Nov  4 20:23:45 [initandlisten] preallocateIsFaster=true 2.32
chesshub_1      | 
chesshub_1      | ##############################################################
chesshub_1      | #
chesshub_1      | #   !!! MONGOOSE WARNING !!!
chesshub_1      | #
chesshub_1      | #   This is an UNSTABLE release of Mongoose.
chesshub_1      | #   Unstable releases are available for preview/testing only.
chesshub_1      | #   DO NOT run this in production.
chesshub_1      | #
chesshub_1      | ##############################################################
chesshub_1      | 
mongo_1         | Wed Nov  4 20:23:45 [initandlisten] waiting for connections on port 27017
mongo_1         | Wed Nov  4 20:23:45 [websvr] admin web console waiting for connections on port 28017
chesshub_1      | Elasticsearch INFO: 2015-11-04T20:23:45Z
chesshub_1      |   Adding connection to http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-04T20:23:45Z
chesshub_1      |   starting request { method: 'HEAD',
chesshub_1      |     requestTimeout: 5000,
chesshub_1      |     castExists: true,
chesshub_1      |     path: '/',
chesshub_1      |     query: {} }
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-04T20:23:45Z
chesshub_1      |   starting request { method: 'POST', path: '/chesshub', query: {} }
chesshub_1      |   
chesshub_1      | 
mongo_1         | Wed Nov  4 20:23:45 [initandlisten] connection accepted from 172.17.0.5:47526 #1 (1 connection now open)
chesshub_1      | Elasticsearch TRACE: 2015-11-04T20:23:45Z
chesshub_1      |   -> HEAD http://elasticsearch:9200/
chesshub_1      |   
chesshub_1      |   <- 0
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch ERROR: 2015-11-04T20:23:45Z
chesshub_1      |   Error: Request error, retrying -- connect ECONNREFUSED
chesshub_1      |       at Log.error (/var/www/app/node_modules/elasticsearch/src/lib/log.js:213:60)
chesshub_1      |       at checkRespForFailure (/var/www/app/node_modules/elasticsearch/src/lib/transport.js:195:18)
chesshub_1      |       at HttpConnector.<anonymous> (/var/www/app/node_modules/elasticsearch/src/lib/connectors/http.js:154:7)
chesshub_1      |       at ClientRequest.bound (/var/www/app/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)
chesshub_1      |       at ClientRequest.emit (events.js:95:17)
chesshub_1      |       at Socket.socketErrorListener (http.js:1548:9)
chesshub_1      |       at Socket.emit (events.js:95:17)
chesshub_1      |       at net.js:441:14
chesshub_1      |       at process._tickCallback (node.js:448:13)
chesshub_1      | 
chesshub_1      | Elasticsearch TRACE: 2015-11-04T20:23:45Z
chesshub_1      |   -> POST http://elasticsearch:9200/chesshub
chesshub_1      |   
chesshub_1      |   <- 0
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch ERROR: 2015-11-04T20:23:45Z
chesshub_1      |   Error: Request error, retrying -- connect ECONNREFUSED
chesshub_1      |       at Log.error (/var/www/app/node_modules/elasticsearch/src/lib/log.js:213:60)
chesshub_1      |       at checkRespForFailure (/var/www/app/node_modules/elasticsearch/src/lib/transport.js:195:18)
chesshub_1      |       at HttpConnector.<anonymous> (/var/www/app/node_modules/elasticsearch/src/lib/connectors/http.js:154:7)
chesshub_1      |       at ClientRequest.bound (/var/www/app/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)
chesshub_1      |       at ClientRequest.emit (events.js:95:17)
chesshub_1      |       at Socket.socketErrorListener (http.js:1548:9)
chesshub_1      |       at Socket.emit (events.js:95:17)
chesshub_1      |       at net.js:441:14
chesshub_1      |       at process._tickCallback (node.js:448:13)
chesshub_1      | 
mongo_1         | Wed Nov  4 20:23:45 [initandlisten] connection accepted from 172.17.0.5:47529 #2 (2 connections now open)
chesshub_1      | Elasticsearch TRACE: 2015-11-04T20:23:45Z
chesshub_1      |   -> HEAD http://elasticsearch:9200/
chesshub_1      |   
chesshub_1      |   <- 0
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   Unable to revive connection: http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   No living connections
chesshub_1      | 
chesshub_1      | elasticsearch is down!
chesshub_1      | Elasticsearch TRACE: 2015-11-04T20:23:45Z
chesshub_1      |   -> HEAD http://elasticsearch:9200/
chesshub_1      |   
chesshub_1      |   <- 0
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   Unable to revive connection: http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   No living connections
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-04T20:23:45Z
chesshub_1      |   starting request { method: 'POST',
chesshub_1      |     path: '/chesshub/game/1',
chesshub_1      |     body: 
chesshub_1      |      { white: 'Foo',
chesshub_1      |        black: 'Anonymous',
chesshub_1      |        content: '1. e4 e5 2. Nf3 Nc6 3. Bc4 Nf6 4. O-O Bc5 5. c3 O-O 6. d4 exd4 7. cxd4 Bb4',
chesshub_1      |        result: '1-0' },
chesshub_1      |     query: { op_type: 'create' } }
chesshub_1      |   
chesshub_1      | 
mongo_1         | Wed Nov  4 20:23:45 [initandlisten] connection accepted from 172.17.0.5:47532 #3 (3 connections now open)
chesshub_1      | Elasticsearch TRACE: 2015-11-04T20:23:45Z
chesshub_1      |   -> HEAD http://elasticsearch:9200/
chesshub_1      |   
chesshub_1      |   <- 0
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   Unable to revive connection: http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   No living connections
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-04T20:23:45Z
chesshub_1      |   starting request { method: 'POST',
chesshub_1      |     path: '/chesshub/game/2',
chesshub_1      |     body: 
chesshub_1      |      { white: 'Anonymous',
chesshub_1      |        black: 'Bar',
chesshub_1      |        content: '1. e4 c6 2. e5 d5 3. exd6 exd6 4. Nf3 Bg4 5. d4 Nf6 6. Bg5 Be7',
chesshub_1      |        result: '1-0' },
chesshub_1      |     query: { op_type: 'create' } }
chesshub_1      |   
chesshub_1      | 
mongo_1         | Wed Nov  4 20:23:45 [initandlisten] connection accepted from 172.17.0.5:47534 #4 (4 connections now open)
chesshub_1      | Elasticsearch TRACE: 2015-11-04T20:23:45Z
chesshub_1      |   -> HEAD http://elasticsearch:9200/
chesshub_1      |   
chesshub_1      |   <- 0
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   Unable to revive connection: http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch WARNING: 2015-11-04T20:23:45Z
chesshub_1      |   No living connections
chesshub_1      | 
mongo_1         | Wed Nov  4 20:23:45 [initandlisten] connection accepted from 172.17.0.5:47536 #5 (5 connections now open)
mongo_1         | Wed Nov  4 20:23:45 [conn1] end connection 172.17.0.5:47526 (4 connections now open)
mongo_1         | Wed Nov  4 20:23:45 [conn2] end connection 172.17.0.5:47529 (4 connections now open)
mongo_1         | Wed Nov  4 20:23:45 [conn3] end connection 172.17.0.5:47532 (4 connections now open)
mongo_1         | Wed Nov  4 20:23:45 [conn4] end connection 172.17.0.5:47534 (1 connection now open)
mongo_1         | Wed Nov  4 20:23:45 [conn5] end connection 172.17.0.5:47536 (1 connection now open)
chesshub_1      | 
chesshub_1      | ##############################################################
chesshub_1      | #
chesshub_1      | #   !!! MONGOOSE WARNING !!!
chesshub_1      | #
chesshub_1      | #   This is an UNSTABLE release of Mongoose.
chesshub_1      | #   Unstable releases are available for preview/testing only.
chesshub_1      | #   DO NOT run this in production.
chesshub_1      | #
chesshub_1      | ##############################################################
chesshub_1      | 
mongo_1         | Wed Nov  4 20:23:46 [initandlisten] connection accepted from 172.17.0.5:47537 #6 (1 connection now open)
mongo_1         | Wed Nov  4 20:23:46 [initandlisten] connection accepted from 172.17.0.5:47538 #7 (2 connections now open)
mongo_1         | Wed Nov  4 20:23:46 [initandlisten] connection accepted from 172.17.0.5:47539 #8 (3 connections now open)
mongo_1         | Wed Nov  4 20:23:46 [initandlisten] connection accepted from 172.17.0.5:47540 #9 (4 connections now open)
mongo_1         | Wed Nov  4 20:23:46 [initandlisten] connection accepted from 172.17.0.5:47541 #10 (5 connections now open)
elasticsearch_1 | [2015-11-04 20:23:46,864][INFO ][node                     ] [Obadiah Stane] initialized
elasticsearch_1 | [2015-11-04 20:23:46,864][INFO ][node                     ] [Obadiah Stane] starting ...
elasticsearch_1 | [2015-11-04 20:23:46,970][INFO ][transport                ] [Obadiah Stane] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/172.17.0.2:9300]}
elasticsearch_1 | [2015-11-04 20:23:46,981][INFO ][discovery                ] [Obadiah Stane] elasticsearch/0mdnKHVmQUySnZwDA9Z5fA
elasticsearch_1 | [2015-11-04 20:23:50,744][INFO ][cluster.service          ] [Obadiah Stane] new_master [Obadiah Stane][0mdnKHVmQUySnZwDA9Z5fA][a7f977b5da30][inet[/172.17.0.2:9300]], reason: zen-disco-join (elected_as_master)
elasticsearch_1 | [2015-11-04 20:23:50,762][INFO ][http                     ] [Obadiah Stane] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/172.17.0.2:9200]}
elasticsearch_1 | [2015-11-04 20:23:50,763][INFO ][node                     ] [Obadiah Stane] started
elasticsearch_1 | [2015-11-04 20:23:50,772][INFO ][gateway                  ] [Obadiah Stane] recovered [0] indices into cluster_state

Failing log (mongodb not ready when initData.js runs):

[void@localhost docker]$ docker-compose up
Starting docker_elasticsearch_1
Starting docker_mongo_1
Starting docker_chesshub_1
Attaching to docker_elasticsearch_1, docker_mongo_1, docker_chesshub_1
mongo_1         | mongod --help for help and startup options
mongo_1         | Wed Nov  4 20:33:22 [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db/ 64-bit host=1ee26d23f4ba
mongo_1         | Wed Nov  4 20:33:22 [initandlisten] db version v2.2.7, pdfile version 4.5
mongo_1         | Wed Nov  4 20:33:22 [initandlisten] git version: 6c2023ca359ed31407d999edcbe8cd7bd1d433b3
mongo_1         | Wed Nov  4 20:33:22 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
mongo_1         | Wed Nov  4 20:33:22 [initandlisten] options: {}
mongo_1         | Wed Nov  4 20:33:22 [initandlisten] journal dir=/data/db/journal
mongo_1         | Wed Nov  4 20:33:22 [initandlisten] recover : no journal files present, no recovery needed
elasticsearch_1 | [2015-11-04 20:33:22,918][INFO ][node                     ] [Sleeper] version[1.4.5], pid[1], build[2aaf797/2015-04-27T08:06:06Z]
elasticsearch_1 | [2015-11-04 20:33:22,919][INFO ][node                     ] [Sleeper] initializing ...
elasticsearch_1 | [2015-11-04 20:33:22,922][INFO ][plugins                  ] [Sleeper] loaded [], sites []
mongo_1         | Wed Nov  4 20:33:23 [websvr] admin web console waiting for connections on port 28017
chesshub_1      | 
chesshub_1      | ##############################################################
chesshub_1      | #
chesshub_1      | #   !!! MONGOOSE WARNING !!!
chesshub_1      | #
chesshub_1      | #   This is an UNSTABLE release of Mongoose.
chesshub_1      | #   Unstable releases are available for preview/testing only.
chesshub_1      | #   DO NOT run this in production.
chesshub_1      | #
chesshub_1      | ##############################################################
chesshub_1      | 
chesshub_1      | Elasticsearch INFO: 2015-11-04T20:33:23Z
chesshub_1      |   Adding connection to http://elasticsearch:9200/
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-04T20:33:23Z
chesshub_1      |   starting request { method: 'HEAD',
chesshub_1      |     requestTimeout: 5000,
chesshub_1      |     castExists: true,
chesshub_1      |     path: '/',
chesshub_1      |     query: {} }
chesshub_1      |   
chesshub_1      | 
chesshub_1      | Elasticsearch DEBUG: 2015-11-04T20:33:23Z
chesshub_1      |   starting request { method: 'POST', path: '/chesshub', query: {} }
chesshub_1      |   
chesshub_1      | 
chesshub_1      | 
chesshub_1      | events.js:72
chesshub_1      |         throw er; // Unhandled 'error' event
chesshub_1      |               ^
chesshub_1      | Error: failed to connect to [mongo:27017]
chesshub_1      |     at null.<anonymous> (/var/www/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:549:74)
chesshub_1      |     at emit (events.js:106:17)
chesshub_1      |     at null.<anonymous> (/var/www/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15)
chesshub_1      |     at emit (events.js:98:17)
chesshub_1      |     at Socket.<anonymous> (/var/www/app/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:533:10)
chesshub_1      |     at Socket.emit (events.js:95:17)
chesshub_1      |     at net.js:441:14
chesshub_1      |     at process._tickCallback (node.js:448:13)
chesshub_1      | 
chesshub_1      | ##############################################################
chesshub_1      | #
chesshub_1      | #   !!! MONGOOSE WARNING !!!
chesshub_1      | #
chesshub_1      | #   This is an UNSTABLE release of Mongoose.
chesshub_1      | #   Unstable releases are available for preview/testing only.
chesshub_1      | #   DO NOT run this in production.
chesshub_1      | #
chesshub_1      | ##############################################################
chesshub_1      | 
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]
chesshub_1      | MongoDB Connection Error. Please make sure MongoDB is running. -> Error: failed to connect to [mongo:27017]