Deploy Mongo Easily With MMS
Join the DZone community and get the full member experience.Join For Free
one of the reason why mongo is gaining a lot of momentum in the industry is the ease of use. just download the package, start mongod and you are done. when you are in production, you cannot surely simply install your mongo as a service, start it and then forget it without any kind of monitoring, because this will surely lead to problems . when is time to create more complex topologies, like sharding or replica set you can commit some mistakes and you have some tedious work to do. i strongly suggest you to have a look at mongo mms , because the online version offers a lot of functionalities for free, and every developer can use it to simplify even deployment of dev servers.
the new version introduced some interesting capabilities to automatically deploy and manage your mongo instances with few clicks of your mouse . suppose you want to create a classic replica set of 3 machines using 3 vm with linux ubuntu. after you register with mms you can simply proceed to install the mms automation agent on your machine with few steps
figure 1: instruction to install automation agent on ubuntu
once you installed the automation agent on all of your machines, you can simply start creating your mongo deployment using mms web interface . agents poll server periodically for instructions, this implies that mms only requires your machines to be able to reach mms site to poll instructions and to send monitoring data. all of your machines can be in a private nat network. if you go in the administration section of mms web interface you can check status of your agents.
figure 2: list of all of your active agents
in this picture you can check not only automation agents, but also monitoring and backup ones. the automation one is the most important, because is the responsible for installing other agents and configuring your mongo instance. now you can move to the deployment tab, and if some of your agents are out of date you can simply upgrade with a simple click .
figure 3: list of all of your deployment servers and in the top area of the page you can check if some of the agents are old
in the upper right part of the deployment area, there is a button called add that can be used to create a new deployment of mongo, in this example i want to create a new replica set.
figure 4: create a replica set from the web interface.
now it is just a matter of configuring all the options. the most important one is the elegible server regexp where you should specify a regex that will select all the servesr that will take part of the replica set. in this example i used three distinct names, and i separated with a pipe to create a regex that choose all the servers, you can use prefix for convenience.
figure 5: options to create a replica set.
you can configure a lot of options and once you are done you can simply press apply. this will create a script to create your new deployment, and you can review it before agents starts applying it to destination machines.
figure 6: pressing apply creates the script but you still have time to review before starting deploy
figure 7: reviewing the script tells you every operation that will be triggered in your environment
pressing confirm & deploy activates the script, and the web interface starts showing you the status of the various machines that will take part of the deploy.
figure 8: deploy starts and the web interface starts waiting for it to finish.
the status is pushed from the automation client to the mms server and you can see the status of the single machines.
figure 9: one of the machine is in goal state, the other two still needs time
in figure 9 you can see that the machine avalanche reached goal state, this means that the automation agent finished applying modification to the system. the other two machines are in waitrsinit, this means that mongo is started and they are starting the replica set. once everything is ok, all the machines are in the goal state and the version of mongo installed in shown in version column.
now you can switch to view mode, where you can look at your deployment.
figure 10: view mode shows the status of your servers, as well as witch instance is primary and which instance is secondary
you can change every aspect of your deployment after it was provisioned, as an example i decided to change priority of one of my server after the replica set was up and running because avalanche vm is stored on an ssd and writing speed is higher than the other two vm.
figure 11: changing options after replica set is created.
you can also change the installed version of mongo, and the automation agents will take care of all operations needed to update or downgrade your instance of mongo.
if you use amazon aws, mongo mms will be also able to automatically provision your virtual machines in the cloud, automatically installing automation agents on it, so you can really deploy everything, from virtual machines to mongo with few clicks.
i must admit that i’m really impressed from deployment capabilities of mongo mms especially because you can manage up to 8 servers for free.
Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.