Fresh install mongodb on Ubuntu - After running mongo command mongod disappears

587 views
Skip to first unread message

Nathan Nass

unread,
Jun 12, 2014, 11:33:08 AM6/12/14
to mongod...@googlegroups.com
Hello, 

I am new to mongodb and was trying to install on ubuntu 14.04 via the instructions in the mongo manual. I originally was able to run mongodb, but after a time the installation did not work. I tried to to a fresh install of mongodb, and again it worked for a brief time but then failed. I investigated the /usr/bin folder, but it seems that mongod has disappeared. I am wondering if I missed some configuration or installation step?

For reference I have included the complete terminal output and partial log file for the final installation attempt. 

Thank you,
Nathan

usr1@httpQuery:~/httpProject/httptest$ sudo apt-get install mongodb-org
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
  mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 5 newly installed, 0 to remove and 69 not upgraded.
Need to get 0 B/114 MB of archives.
After this operation, 287 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 62259 files and directories currently installed.)
Preparing to unpack .../mongodb-org-shell_2.6.1_amd64.deb ...
Unpacking mongodb-org-shell (2.6.1) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_2.6.1_amd64.deb ...
Unpacking mongodb-org-server (2.6.1) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../mongodb-org-mongos_2.6.1_amd64.deb ...
Unpacking mongodb-org-mongos (2.6.1) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../mongodb-org-tools_2.6.1_amd64.deb ...
Unpacking mongodb-org-tools (2.6.1) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_2.6.1_amd64.deb ...
Unpacking mongodb-org (2.6.1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up mongodb-org-shell (2.6.1) ...
Setting up mongodb-org-server (2.6.1) ...
mongod start/running, process 29466
Setting up mongodb-org-mongos (2.6.1) ...
Setting up mongodb-org-tools (2.6.1) ...
Setting up mongodb-org (2.6.1) ...
usr1@httpQuery:~/httpProject/httptest$ which mongod
/usr/bin/mongod
usr1@httpQuery:~/httpProject/httptest$ mongod -version
db version v2.6.1
2014-06-12T10:56:04.440-0400 git version: 4b95b086d2374bdcfcdf2249272fb552c9c726e8
usr1@httpQuery:~/httpProject/httptest$ sudo service mongod status
mongod start/running, process 29466
usr1@httpQuery:~/httpProject/httptest$ sudo service mongod stop
mongod stop/waiting
usr1@httpQuery:~/httpProject/httptest$ sudo service mongod start
mongod start/running, process 29537
usr1@httpQuery:~/httpProject/httptest$ sudo service mongod restart
mongod stop/waiting
mongod start/running, process 29570
usr1@httpQuery:~/httpProject/httptest$ mongo
MongoDB shell version: 2.6.1
connecting to: test
> quit()
usr1@httpQuery:~/httpProject/httptest$ sudo service mongod status
mongod start/running, process 29570
usr1@httpQuery:~/httpProject/httptest$ which mongo
/usr/bin/mongo
usr1@httpQuery:~/httpProject/httptest$ which mongod
/usr/bin/mongod
usr1@httpQuery:~/httpProject/httptest$ which mongodb
usr1@httpQuery:~/httpProject/httptest$ mongo
MongoDB shell version: 2.6.1
connecting to: test
2014-06-12T11:10:16.901-0400 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2014-06-12T11:10:16.902-0400 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
usr1@httpQuery:~/httpProject/httptest$ which mongod
usr1@httpQuery:~/httpProject/httptest$


..... Log output

2014-06-12T10:54:59.702-0400 [FileAllocator] done allocating datafile /var/lib/mongodb/local.0, size: 64MB,  took 0.001 secs
2014-06-12T10:54:59.704-0400 [initandlisten] build index on: local.startup_log properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.startup_log" }
2014-06-12T10:54:59.705-0400 [initandlisten]     added index to empty collection
2014-06-12T10:54:59.705-0400 [initandlisten] waiting for connections on port 27017
2014-06-12T10:55:59.693-0400 [clientcursormon] mem (MB) res:35 virt:349
2014-06-12T10:55:59.693-0400 [clientcursormon]  mapped (incl journal view):160
2014-06-12T10:55:59.693-0400 [clientcursormon]  connections:0
2014-06-12T10:56:33.269-0400 [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2014-06-12T10:56:33.269-0400 [signalProcessingThread] now exiting
2014-06-12T10:56:33.269-0400 [signalProcessingThread] dbexit:
2014-06-12T10:56:33.269-0400 [signalProcessingThread] shutdown: going to close listening sockets...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] closing listening socket: 8
2014-06-12T10:56:33.269-0400 [signalProcessingThread] closing listening socket: 9
2014-06-12T10:56:33.269-0400 [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2014-06-12T10:56:33.269-0400 [signalProcessingThread] shutdown: going to flush diaglog...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] shutdown: going to close sockets...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] shutdown: waiting for fs preallocator...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] shutdown: lock for final commit...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] shutdown: final commit...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] shutdown: closing all files...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] closeAllFiles() finished
2014-06-12T10:56:33.269-0400 [signalProcessingThread] journalCleanup...
2014-06-12T10:56:33.269-0400 [signalProcessingThread] removeJournalFiles
2014-06-12T10:56:33.272-0400 [signalProcessingThread] shutdown: removing fs lock...
2014-06-12T10:56:33.272-0400 [signalProcessingThread] dbexit: really exiting now
2014-06-12T10:56:36.642-0400 ***** SERVER RESTARTED *****
2014-06-12T10:56:36.648-0400 [initandlisten] MongoDB starting : pid=29537 port=27017 dbpath=/var/lib/mongodb 64-bit host=httpQuery
2014-06-12T10:56:36.648-0400 [initandlisten] db version v2.6.1
2014-06-12T10:56:36.648-0400 [initandlisten] git version: 4b95b086d2374bdcfcdf2249272fb552c9c726e8
2014-06-12T10:56:36.648-0400 [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-06-12T10:56:36.648-0400 [initandlisten] allocator: tcmalloc
2014-06-12T10:56:36.648-0400 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/var/lib/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2014-06-12T10:56:36.650-0400 [initandlisten] journal dir=/var/lib/mongodb/journal
2014-06-12T10:56:36.650-0400 [initandlisten] recover : no journal files present, no recovery needed
2014-06-12T10:56:36.740-0400 [initandlisten] waiting for connections on port 27017
2014-06-12T10:56:40.900-0400 [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
2014-06-12T10:56:40.900-0400 [signalProcessingThread] now exiting
2014-06-12T10:56:40.900-0400 [signalProcessingThread] dbexit:
2014-06-12T10:56:40.900-0400 [signalProcessingThread] shutdown: going to close listening sockets...
2014-06-12T10:56:40.900-0400 [signalProcessingThread] closing listening socket: 8
2014-06-12T10:56:40.900-0400 [signalProcessingThread] closing listening socket: 9
2014-06-12T10:56:40.900-0400 [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
2014-06-12T10:56:40.900-0400 [signalProcessingThread] shutdown: going to flush diaglog...
2014-06-12T10:56:40.900-0400 [signalProcessingThread] shutdown: going to close sockets...
2014-06-12T10:56:40.900-0400 [signalProcessingThread] shutdown: waiting for fs preallocator...
2014-06-12T10:56:40.900-0400 [signalProcessingThread] shutdown: lock for final commit...
2014-06-12T10:56:40.900-0400 [signalProcessingThread] shutdown: final commit...
2014-06-12T10:56:40.906-0400 [signalProcessingThread] shutdown: closing all files...
2014-06-12T10:56:40.906-0400 [signalProcessingThread] closeAllFiles() finished
2014-06-12T10:56:40.906-0400 [signalProcessingThread] journalCleanup...
2014-06-12T10:56:40.906-0400 [signalProcessingThread] removeJournalFiles
2014-06-12T10:56:40.908-0400 [signalProcessingThread] shutdown: removing fs lock...
2014-06-12T10:56:40.908-0400 [signalProcessingThread] dbexit: really exiting now
2014-06-12T10:56:41.038-0400 ***** SERVER RESTARTED *****
2014-06-12T10:56:41.046-0400 [initandlisten] MongoDB starting : pid=29570 port=27017 dbpath=/var/lib/mongodb 64-bit host=httpQuery
2014-06-12T10:56:41.046-0400 [initandlisten] db version v2.6.1
2014-06-12T10:56:41.046-0400 [initandlisten] git version: 4b95b086d2374bdcfcdf2249272fb552c9c726e8
2014-06-12T10:56:41.046-0400 [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-06-12T10:56:41.046-0400 [initandlisten] allocator: tcmalloc
2014-06-12T10:56:41.046-0400 [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/var/lib/mongodb" }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
2014-06-12T10:56:41.051-0400 [initandlisten] journal dir=/var/lib/mongodb/journal
2014-06-12T10:56:41.051-0400 [initandlisten] recover : no journal files present, no recovery needed
2014-06-12T10:56:41.172-0400 [initandlisten] waiting for connections on port 27017
2014-06-12T10:56:44.654-0400 [initandlisten] connection accepted from 127.0.0.1:37045 #1 (1 connection now open)
2014-06-12T10:56:54.461-0400 [conn1] end connection 127.0.0.1:37045 (0 connections now open)
2014-06-12T10:57:41.167-0400 [clientcursormon] mem (MB) res:35 virt:350
2014-06-12T10:57:41.167-0400 [clientcursormon]  mapped (incl journal view):160
2014-06-12T10:57:41.167-0400 [clientcursormon]  connections:0
usr1@httpQuery:~/httpProject/httptest$

Ernie Hershey

unread,
Jun 12, 2014, 11:48:22 AM6/12/14
to mongodb-user
Hi Nathan,

That's really strange. Is it possible another process on the same machine uninstalled the mongodb-org-server package? 

If you run this does it show all the mongodb-org packages? 

dpkg-query -l 'mongodb-org*'

Ernie


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/766f0126-1aea-41c7-ade9-29254cebbae6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nathan Nass

unread,
Jun 12, 2014, 12:12:21 PM6/12/14
to mongod...@googlegroups.com
Hi Ernie,
I am not sure if another process would have uninstalled it. I am running a recently allocated vm on a shared hosting service, so I don't think so. I had originally tried working with the clojure driver monger, and I was able to insert one record following the tutorial before the original install stopped working. Since I tried a fresh install and the same result happened without using the clojure driver (ie just using the command line as indicated above) I am not sure whether it is related.

When I run dpkg, I just get the mongodb-org packages along with the unstable versions 

usr1@httpQuery:~/httpProject/httptest$ dpkg-query -l 'mongodb-org*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version         Architecture    Description
+++-=====================-===============-===============-===============================================
ii  mongodb-org           2.6.1           amd64           MongoDB open source document-oriented database
ii  mongodb-org-mongos    2.6.1           amd64           MongoDB sharded cluster query router
ii  mongodb-org-server    2.6.1           amd64           MongoDB database server
ii  mongodb-org-shell     2.6.1           amd64           MongoDB shell client
ii  mongodb-org-tools     2.6.1           amd64           MongoDB tools
un  mongodb-org-unstable  <none>          <none>          (no description available)
un  mongodb-org-unstable- <none>          <none>          (no description available)
un  mongodb-org-unstable- <none>          <none>          (no description available)
un  mongodb-org-unstable- <none>          <none>          (no description available)
un  mongodb-org-unstable- <none>          <none>          (no description available)

These are the files that remain in the /usr/bin directory:
usr1@httpQuery:~/httpProject/httptest$ ls -l /usr/bin/ | grep mongo
-rwxr-xr-x 1 root   root    11871000 May  5 11:13 mongo
-rwxr-xr-x 1 root   root    23408296 May  5 11:13 mongodump
-rwxr-xr-x 1 root   root    23352616 May  5 11:13 mongoexport
-rwxr-xr-x 1 root   root    23400504 May  5 11:13 mongofiles
-rwxr-xr-x 1 root   root    23375272 May  5 11:13 mongoimport
-rwxr-xr-x 1 root   root    23345384 May  5 11:13 mongooplog
-rwxr-xr-x 1 root   root    23156920 May  5 11:13 mongoperf
-rwxr-xr-x 1 root   root    23443528 May  5 11:13 mongorestore
-rwxr-xr-x 1 root   root    18252920 May  5 11:13 mongos
-rwxr-xr-x 1 root   root    23397576 May  5 11:13 mongostat
-rwxr-xr-x 1 root   root    23340712 May  5 11:13 mongotop

Thank you,
Nathan

Victor Hooi

unread,
Jun 16, 2014, 1:47:02 AM6/16/14
to mongod...@googlegroups.com
Hi Nathan,

Your dpkg-query output is showing that the MongoDB 2.6.1 packages are actually still installed. However, your /usr/bin/mongod binary itself is missing. As Ernie said, this is rather strange. Before you re-install anything, can you please run the following and reply here with the output:

sudo grep -B 3 -i mongo /var/log/apt/history.log
sudo zgrep -B 3 -i mongo /var/log/apt/history.log.*.gz

This will give us the installation/uninstallation events around MongoDB.

You can then reinstall the mongodb-org-server package with the following command:

sudo apt-get install --reinstall mongodb-org-serve

Please let me know if you have any queries about any of the above.

Regards,
Victor

Nathan Nass

unread,
Jun 16, 2014, 9:28:07 AM6/16/14
to mongod...@googlegroups.com
Hi Victor,

Thank you for your reply. I received a note from support today about the server that was running that instance of mongo. It appears that it was compromised, and they disabled ssh access to it, so I don't think I can investigate it further. But I would assume that this strange behavior is related to this compromise. I am not sure why only mongod would be removed leaving the other files. This weekend, I was able to create a new server with an instance of mondo db using the same setup, and it appears to be functioning well. If I get a chance to access the server again I will try to read those log files and post the information here.

Thanks again,
Nathan 
Reply all
Reply to author
Forward
0 new messages