Homework 1.1 - mongod missing?

I installed vagrant and both VMs are running:

vagrant status
Current machine states:

database not created (virtualbox)
infrastructure not created (virtualbox)

When I try to execute mongod from within the database VM, however, I get the following:

vagrant@database:~$ mongod

The program ‘mongod’ is currently not installed. To run ‘mongod’ please ask your administrator to install the package ‘mongodb-server’

If I search for the executable in the VM, it does, indeed, not to exist:

vagrant@database:~$ find / -name mongod 2>/dev/null

vagrant@database:~$

Any suggestions?

Try:
vagrant provision database
vagrant provision infrastructure

Should I issue vagrant halt first? Currently they’re running:

vagrant status
Current machine states:

database running (virtualbox)
infrastructure running (virtualbox)

Nope, don’t halt it. Run the command as-is.

I ran vagrant provision database, and at the end of the (very long) output was:

database: E
database: : 
database: There are problems and -y was used without --force-yes

The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

The ‘vagrant provision infrastructure’ command did not return an error.

A more thorough error message would have been more useful but I believe that you’re experiencing the problem here:

Apply the fix on the database provision file and re-run the command.

Okay, I updated provision-database as directed, re-ran the command, and it went fine. However, I still don’t seem to have mongoDB installed in the VM:

vagrant@database:~$ mongod

The program ‘mongod’ is currently not installed. To run ‘mongod’ please ask your administrator to install the package ‘mongodb-server’

Run these two commands:
vagrant destroy database
vagrant up --provision database

1 Like

Hi @nrmdmcg,

Adding to @007_jb’s reply:
After updating the provision file, make sure that you destroy the vagrant and bring it up again using the vagrant up command.

Only then changes to provision file will reflect.

If you still face any error, please feel free to post.

Thanks,
Sonali

Okay - this worked; I was able to connect and complete homework 1.1.

Thanks!

1 Like