I'm trying to install Mongodb for Ubuntu 14.04. I followed the official documentation on Mongodb installation from here - https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
I ran the following commands:-
When I execute the command #4, I get this near the end of the output:
Setting up mongodb-org-server (3.6.3) ...
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
initctl: Unknown job: mongod
Setting up mongodb-org-mongos (3.6.3) ...
Setting up mongodb-org-tools (3.6.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb-org (3.6.3) ...After this when I run sudo service mongod start I get:
start: Unknown job: mongod
And running mongo results in:-
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
2018-03-30T12:45:43.635+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-03-30T12:45:43.635+0530 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failedmongo --version results in:-
MongoDB shell version v3.6.3
git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
allocator: tcmalloc
modules: none
build environment:
distmod: ubuntu1404
distarch: x86_64
target_arch: x86_64Both /var/log/mongodb and /var/lib/mongodb are empty folders.
I've uninstalled this using instructions on the same docs page linked above, and reinstalled it. No change.
Can't believe official instructions fail and I can't find solution for this anywhere.
invoke-rc.d: policy-rc.d denied execution of start.
Hi,
Please check the content of policy-rc.d file (commonly located in /usr/sbin/policy-rc.d). This file contains the policy layer of the local system (i.e. your admin, or docker image author) installation for debian/ubuntu services.
Based on the output of the above, it looks like it prevented mongod to be installed and executed. You can try to change the exit code of policy-rc.d to exit 0 to remove the error. See also Debian: invoke-rc.d and policy-rc.d for more information.
And running mongo results in:-
The output result here indicates that there is no mongod running for mongodb://127.0.0.1:27017 and available for connection. Hence the connect failed message.
If you have further question, could you provide:
policy-rc.dRegards,
Wan.