[SERVER-14786] Mongodb installation on debian Created: 05/Aug/14  Updated: 01/Apr/15  Resolved: 20/Mar/15

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Lochan Marwaha Assignee: Unassigned
Resolution: Incomplete Votes: 1
Labels: build-later, build-needs-definition
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-14844 2.6.4 Debian 7 configuration errors Closed
Related
related to SERVER-17420 Broken package results in corrupt ins... Closed
Operating System: ALL
Participants:

 Description   

Hi,

Installation for mongodb on debian is not smoooth. Also it doesn't work correctly. I followed the below link provided by mongodb, but still it fails

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/

So after downloading the packages, it throws the error

Get:1 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen mongodb-org-shell amd64 2.6.3 [4,451 kB]
Get:2 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen mongodb-org-server amd64 2.6.3 [9,418 kB]
Get:3 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen mongodb-org-mongos amd64 2.6.3 [7,150 kB]
Get:4 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen mongodb-org-tools amd64 2.6.3 [93.4 MB]
Get:5 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen mongodb-org-tools amd64 2.6.3 [93.4 MB]
Get:6 http://downloads-distro.mongodb.org/repo/debian-sysvinit/ dist/10gen mongodb-org amd64 2.6.3 [3,648 B]
Fetched 63.5 MB in 5min 19s (199 kB/s)
Selecting previously unselected package mongodb-org-shell.
(Reading database ... 129436 files and directories currently installed.)
Unpacking mongodb-org-shell (from .../mongodb-org-shell_2.6.3_amd64.deb) ...
Selecting previously unselected package mongodb-org-server.
Unpacking mongodb-org-server (from .../mongodb-org-server_2.6.3_amd64.deb) ...
Selecting previously unselected package mongodb-org-mongos.
Unpacking mongodb-org-mongos (from .../mongodb-org-mongos_2.6.3_amd64.deb) ...
Selecting previously unselected package mongodb-org-tools.
Unpacking mongodb-org-tools (from .../mongodb-org-tools_2.6.3_amd64.deb) ...
Selecting previously unselected package mongodb-org.
Unpacking mongodb-org (from .../mongodb-org_2.6.3_amd64.deb) ...
Processing triggers for man-db ...
Setting up mongodb-org-shell (2.6.3) ...
Setting up mongodb-org-server (2.6.3) ...
[FAIL] Starting database: mongod failed!
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mongodb-org-mongos (2.6.3) ...
Setting up mongodb-org-tools (2.6.3) ...
dpkg: dependency problems prevent configuration of mongodb-org:
mongodb-org depends on mongodb-org-server; however:
Package mongodb-org-server is not configured yet.

So in configuration files you need to change the dbpath or different variables and owner of different location to work it out. Also as suggested by mongodb to have a dedicated OS user for mongodb will not work because pid is not configurable till 2.6 release. So you always have to do sudo to start the mongo database. I believe we need to fix this and have smooth installation and run in Debian. Any suggestions please.



 Comments   
Comment by Ernie Hershey [ 28/Feb/15 ]

lochanmarwaha@gmail.com - The installation got to the end but couldn't start the database. Do you have anything in /var/log/mongodb/mongod.log after the failed installation? One common reason that the server fails to start is not having enough space on the filesystem containing data files, in this case, /var/lib/mongodb. Is the filesystem that directory is on very small?

Comment by Laurent Roger [ 01/Oct/14 ]

I was able to fix this issue with the following steps :

# apt-get remove mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
...
# dpkg --get-selections | grep mongo
mongodb-org					deinstall
mongodb-org-server			deinstall
mongodb-server				deinstall
# apt-get autoremove --purge mongodb-server
# apt-get autoremove --purge mongodb-org
# apt-get autoremove --purge mongodb-org-server
(complains about locale settings)
# export LANGUAGE=en_US.UTF-8
# export LANG=en_US.UTF-8
# export LC_ALL=en_US.UTF-8
# locale-gen en_US.UTF-8
# dpkg-reconfigure locales
# apt-get install mongodb-org-server
# apt-get install mongodb-org

Comment by Daryl Tucker [ 30/Sep/14 ]

I used an older method of installing MongoDB, where the packages had the *-10gen* suffix. I've been able to upgrade a few times without any issues, but today I experienced this issue.

I made sure to remove the older *-10gen sources and made sure I had the new *-org sources.

I tried removing mongo-*, as well as installing specific versions of every package (ie: -server -console), which didn't work.

Finally, I manually killed the mongo server (`ps aux | grep mongo`), and just ran a normal upgrade, which worked.

It seems there was an issue with killing the older version to 'configure' the newer one.

Generated at Thu Feb 08 03:35:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.