Open dusty opened 5 years ago
i am still getting this error. and this -
──── kubectl logs pod/mongo-0 mongo
Error parsing command line: unrecognised option '--smallfiles'
try 'mongod --help' for more information
──── kubectl logs pod/mongo-0 mongo-sidecar
...
Error in workloop { MongoError: failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/topologies/server.js:336:35)
at Pool.emit (events.js:182:13)
at Connection.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:280:12)
at Object.onceWrapper (events.js:273:13)
at Connection.emit (events.js:182:13)
at Socket.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/connection.js:189:49)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
name: 'MongoError',
message:
'failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]' }
i am still getting this error. and this -
──── kubectl logs pod/mongo-0 mongo Error parsing command line: unrecognised option '--smallfiles' try 'mongod --help' for more information
──── kubectl logs pod/mongo-0 mongo-sidecar ... Error in workloop { MongoError: failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017] at Pool.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/topologies/server.js:336:35) at Pool.emit (events.js:182:13) at Connection.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:280:12) at Object.onceWrapper (events.js:273:13) at Connection.emit (events.js:182:13) at Socket.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/connection.js:189:49) at Object.onceWrapper (events.js:273:13) at Socket.emit (events.js:182:13) at emitErrorNT (internal/streams/destroy.js:82:8) at emitErrorAndCloseNT (internal/streams/destroy.js:50:3) name: 'MongoError', message: 'failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]' }
looks like i have to use version 4.0 - https://stackoverflow.com/questions/57492145/error-when-creating-a-mongodb-replicaset-shows-unrecognized-option-smallfil
Thank you @dusty! This was really helpful. I wish I had found your post sooner. I wasted a few hours trying to figure out all the issues and then found this post when I was stuck with the connection refused issue from the sidecar.
When running this codelab, the replica set is not created. The sidecar showed the following
It appears to be related to
https://github.com/cvallance/mongo-k8s-sidecar/issues/75
I added the following and that message went away
Then the sidecar was providing an error about connecting to mongo
It seems that it is because mongo by default only listens on 127.0.0.1. So, I updated the mongo-statefulset.yaml file to include a bind_ip arg.
Then it worked.