0

So mongodb worked on my ubuntu device, then I reinstalled Apache2 and installed mysql/php and some other minor tools and Mongo stopped working. When I would type mongo:

Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :

I look into my mongodb log:

2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] MongoDB starting : pid=10656 port=60 dbpath=/var/lib/mongodb 64-bit host=vitsuji-N501VW
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] db version v4.0.3
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] git version: 7ea530946fa7880364d88c8d8b6026bbc9ffa48c
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] allocator: tcmalloc
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] modules: enterprise 
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] build environment:
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten]     distmod: ubuntu1804
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten]     distarch: x86_64
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten]     target_arch: x86_64
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1, 172.31.29.201", port: 60 }, processManagement: { timeZoneInfo: "/usr/share/zoneinfo" }, security: { authorization: "enabled" }, storage: { dbPath: "/var/lib/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log", quiet: true } }
2018-12-19T21:29:21.316+0300 E STORAGE  [initandlisten] Failed to set up listener: SocketException: Permission denied
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] now exiting
2018-12-19T21:29:21.316+0300 I CONTROL  [initandlisten] shutting down with code:48

My mongodb.conf file look like this:

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1, 10.168.0.73
#127.0.0.1, 10.168.0.73


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security:
security:
  authorization: "enabled"
#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

No processes are running on ports 27017, 37970. If anyone knows what's going on that would be a great help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.