0

I am trying to start working with MongoDB but when I write the mongod command I get this error

2019-10-20T23:26:41.054-0500 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] MongoDB starting : pid=4724 port=27017 dbpath=/data/db 64-bit host=MacBook-Pro-de-Andres.local

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] db version v4.2.0

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] git version: a4b751dcf51dd249c5865812b390cfd1c0129c30

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] allocator: system

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] modules: enterprise

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] build environment:

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] distarch: x86_64

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] target_arch: x86_64

2019-10-20T23:26:41.062-0500 I CONTROL [initandlisten] options: {}

2019-10-20T23:26:41.064-0500 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use

2019-10-20T23:26:41.064-0500 I CONTROL [initandlisten] now exiting

2019-10-20T23:26:41.064-0500 I CONTROL [initandlisten] shutting down with code:48

1

1 Answer 1

1

It is a problem with your port number. Since your default port number 27017 is already allocated to mongodb, this error occurs.

In this case, You can do two things.

  • you can stop the mongodb process and run mongod. Either you can run
  • mongod in a different port.

    mongod --port PORT_NUMBER

port number can be 27018 or any number you wish.

Hope you can fix your issue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.