node.js - Mongodb not starting on ubuntu 14.04 -
i trying install , start mongodb locally:
i go through these steps (as shown in history):
1819 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7f0ceb10 1820 echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list 1821 sudo apt-get update 1822 sudo apt-get install -y mongodb-org 1823 sudo service mongod start but following error log in /var/log/mongodb/mongodb.log
2016-01-05t22:51:21.869+0000 control [main] ***** server restarted ***** 2016-01-05t22:51:21.874+0000 control [initandlisten] mongodb starting : pid=5394 port=27017 dbpath=/var/lib/mongodb 64-bit host=ip-172-31-45-129 2016-01-05t22:51:21.874+0000 control [initandlisten] db version v3.2.0 2016-01-05t22:51:21.874+0000 control [initandlisten] git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7 2016-01-05t22:51:21.874+0000 control [initandlisten] openssl version: openssl 1.0.1f 6 jan 2014 2016-01-05t22:51:21.874+0000 control [initandlisten] allocator: tcmalloc 2016-01-05t22:51:21.874+0000 control [initandlisten] modules: none 2016-01-05t22:51:21.874+0000 control [initandlisten] build environment: 2016-01-05t22:51:21.874+0000 control [initandlisten] distmod: ubuntu1404 2016-01-05t22:51:21.874+0000 control [initandlisten] distarch: x86_64 2016-01-05t22:51:21.874+0000 control [initandlisten] target_arch: x86_64 2016-01-05t22:51:21.874+0000 control [initandlisten] options: { config: "/etc/mongodb.conf", net: { bindip: "127.0.0.1" }, storage: { dbpath: "/var/lib/mongodb", journal: { enabled: true } }, systemlog: { destination: "file", logappend: true, path: "/var/log/mongodb/mongodb.log" } } 2016-01-05t22:51:21.895+0000 e network [initandlisten] failed unlink socket file /tmp/mongodb-27017.sock errno:1 operation not permitted 2016-01-05t22:51:21.895+0000 - [initandlisten] fatal assertion 28578 2016-01-05t22:51:21.895+0000 - [initandlisten] ***aborting after fassert() failure i had mongodb installed worked fine stopped me connecting after changes made other services using mongodb. tried remove instance of mongodb , tried reinstalling, after facing issue.
i try file: /tmp/mongodb-27017.sock not exist on system.
i had same problem after installing mongodb same way, got error message 'failed unlink socket file /tmp/mongodb-27017.sock...'.
after doing bit more digging realised installation hadn't created path /data/db, here's did:
create full path (the flag
-pcreates parent folders if don't exist)sudo mkdir -p /data/dbrecursively change ownership of folder
/data/dbmongodbsudo chown -r mongodb:mongodb /data/db
edit: if you're planning on running different instances of mongodb different project folders, you, , not mongodb, should owner of contents of /data/db, otherwise give error of type exception in initandlisten: 98 unable create/open lock file: /data/db/mongod.lock
remove temporary socket file
sudo rm /tmp/mongodb-27017.sockinitialise mongod service
sudo service mongod start
after running smoothly in system. start or stop , not give me more errors.
hope helps :)
Comments
Post a Comment