M312 Chapter 3: Lab Analyze Profiler Data Mlaunch?

Hello - after SSH’ing I get the below error. Any thoughts? Thanks

Last login: Mon Oct 29 10:54:11 2018 from 10.0.2.2
vagrant@m312:~ mlaunch --single A different environment already exists at /home/vagrant/data. vagrant@m312:~

2 Likes

I had the same issue. Tried deleting the contents of data directory but same error.

Then, I used vagrant destroy to delete the VM and vagrant up to create a fresh instance. Works after that

Another solution :slight_smile:
“A different environment already exists at /home/vagrant/data.”

vagrant@m312:~$ ls /home/vagrant/data/

authdb db mongod.log

vagrant@m312:~$ ps -ef|grep mongo

vagrant 1956 1925 0 06:28 pts/0 00:00:00 grep --color=auto mongo
vagrant@m312:~$ mv /home/vagrant/data /home/vagrant/data_bak

vagrant@m312:~$ mlaunch --single

launching: “mongod” on port 27017
vagrant@m312:~$

6 Likes

A much better alternative from @Raul_10566.

In case anyone stumbles across this post, there are two things to note:

  1. The default directory that mlaunch uses:

    So it will fail to launch if there are db or log files in the default directory. Specify --dir if you want to use a different directory.
  2. The port you specify needs to be free. 27017 is the default port and as a result there should be no running mongod or mongos instances on the specified port:
    ps -ef | grep mongo
    And if you need to stop the running servers, login to it and run db.shutdownServer() on the admin db. Or specify a different port using --port.

The lectures doesn’t explain any of this but the documentation for mtools is concise.

2 Likes

thanks a lot works for me

1 Like

Hello and thank you from the future @007_jb!!

2 Likes

Hi:
Can you please reference the Documentation w.r.t. this topic?
Thanks,
RT

Hi:
Can you please reference the Documentation w.r.t. this topic?
Thanks,
RT