Picture of Isaac Woo
MongoDB installation problem in docker-based Ubuntu 14.04
by Isaac Woo - Friday, 14 October 2016, 3:04 AM
 

Hello, I've recently been having problems installing the adapt authoring tool via ssh (no GUI) in an Ubuntu 14.04 container in Docker.

Everything's been all right until I reached the MongoDB step.
I followed the steps provided in their documentation, but am stuck when trying to run MongoDB immediately after installation.

(listed here: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/)

The terminal tells me that service "mongod" is unrecognized.

Assistance in identifying the problem and how to fix it would be highly appreciated.

I've attached a screenshot below.

 

Thank you,
Isaac


Picture of jPablo Caballero
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by jPablo Caballero - Friday, 14 October 2016, 5:58 AM
 

Isaac,

In the 'service' command you must specify first the service, and then the verb ('start', 'stop', 'status')

Try:

    service mongodb start

(or service mongod start... I'm not sure which one will work for you).

 

Picture of Isaac Woo
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by Isaac Woo - Friday, 14 October 2016, 7:21 AM
 

Thanks for the suggestion.

My apologies though, it seems that the screenshot I've provided is inaccurate.

The screenshot I've uploaded is actually a reproduction of the problem (that went wrong).

I had actually correctly typed "service mongod[b] start" when trying to run MongoDB.
I tried it again just in case, and confirmed just now that a simple syntax error wasn't the cause of the problem.

No go for both versions. I tried both with and without the 'b' at the end.
Same message as screenshot, saying "service not recognized."

Other suggestions are welcome.

Thanks!

Picture of jPablo Caballero
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by jPablo Caballero - Friday, 14 October 2016, 8:57 AM
 

Are you in a container ( Docker, lxc ...? )

Picture of Isaac Woo
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by Isaac Woo - Friday, 14 October 2016, 9:42 AM
 
Yes, I'm installing inside Docker.
Picture of jPablo Caballero
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by jPablo Caballero - Friday, 14 October 2016, 9:55 AM
 

Ok, I had problems with Mongo in containers, but I was using LXC containers. However, the root of my problem was really on the host system (Ubuntu 14.04 too), and the symptoms were similar: mongo not finishing installing correctly, or refusing to start the service... so here's the info I found, in case it helps you.

The original info I found was:

https://lxadm.com/Unprivileged_lxc_containers_and_open_file_limit_problem

The solution I found was to add these lines in /etc/security/limits.conf on the HOST 

 

# adjusted for lxc
*          hard nofile 65536
*          soft nofile 65000
*          hard nproc 65000
*          soft nproc 65000

remember to stop the guest (container)  and also log-out / reboot the host so those limits take effect....

Hope it helps you somehow

 

Picture of Isaac Woo
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by Isaac Woo - Friday, 21 October 2016, 2:19 AM
 

Thank you for the suggestion.

I'm currently working in a server via ssh but I don't have administrator rights. (Can't modify the host itself.)
I talked to the admin about your idea, but he says that LXC and Docker are different and that your solution most likely won't work in the current case. I'm no expert on the issue, so I could not convince him otherwise.

I've been trying to figure it out for the past week, but to no avail.

I've tried a 16.04 container to see if that circumvents the issue.
I don't get the invoke-rc.d error messages but still end up with an unrecognized service message
(I completed the additional step in 16.04 to create the systemd service file but still have the problem.)

I thank you for your interest and time. Any other insights or suggestions are appreciated.

Isaac.

Picture of jPablo Caballero
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by jPablo Caballero - Friday, 21 October 2016, 5:12 PM
 

Sorry it didn't help you. 

Yes, LXC and Docker are quite different, but I have no experience with Docker...

Picture of William O'Brien
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by William O'Brien - Friday, 21 October 2016, 1:15 PM
 

My suggestion would be to use the official Mongo image from docker hub and link this to the container in which you are running the adapt authoring tool.  You can do this easily enough using docker-compose to start up and link the 2 containers.  Having a separate container for Mongo would be in line with Docker best practice.

Picture of Gary Ritchie
Re: MongoDB installation problem in docker-based Ubuntu 14.04
by Gary Ritchie - Wednesday, 26 October 2016, 1:43 PM
 

Isaac, have you made any progress?

If you're familiar with docker-compose, you can give this a try: https://github.com/garyritchie/docker-adaptauthoring

Works well on a Linux host and I recently tested it on Windows running latest Docker. It's a little rough so I'm looking for feedback.