How to change default mongo port on a bitnami instance
1
vote
2
answers
770
views
I am running a bitnami instance of mongodb for our pre-production. The default port for mongo is 27017. But for security reasons i want to change it but it is not possible.
I have tried these things:
changes the port in mongodb.conf and restarted the server. It shows the below error:
**connecting to: mongodb:///opt/bitnami/mongodb/tmp/mongodb-27017.sock/
2018-04-20T12:55:04.373+0530 W NETWORK [thread1]
Failed to connect to /opt/bitnami/mongodb/tmp/mongodb-27017.sock:0, in(connect), reason: Connection refused
2018-04-20T12:55:04.373+0530 E QUERY [thread1] Error: couldn't connect to server /opt/bitnami/mongodb/tmp/mongodb-27017.sock:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed**
I restarted mongod with different port. Still i am not able to do it.
when i switch back to 27017. It comes back to normal.
Any suggestions on how to do it the right way?
Asked by ajit hegde
(9 rep)
Apr 20, 2018, 07:39 AM
Last activity: Jun 28, 2025, 06:02 PM
Last activity: Jun 28, 2025, 06:02 PM