The click-to-deploy interface for configuring MongoDB clusters on Google Compute Engine allows you to easily select your configuration options. Deploying your MongoDB cluster in this manner is ideal for getting started quickly with development.
By default, the cluster uses the following configuration:
-
Two MongoDB node servers on
n1-highmem-4
(4 cores with 26GB memory) virtual machine instances -
One arbiter node server on a
f1-micro
(1 core with 600MB memory) instance.
You can adjust the number of servers, machine type, disk size, and other settings when you deploy the cluster.
Objectives
- Deploy a MongoDB cluster on Google Compute Engine
- Configure your cluster
Quickly deploy MongoDB on Compute Engine
The Google Developers Console provides a simple interface that you can use to quickly configure your MongoDB cluster.
-
In the MongoDB click-to-deploy page in the Google Developers Console , specify your configuration settings or use the default values.
If you are doing performance testing, choose your data disk size and machine types appropriately. For more information, see performance considerations and tuning .
-
Click Deploy cluster
-
Optional: Install the Cloud SDK to be able to connect to your MongoDB instances when deployment finishes.
The deployment can take a few minutes, when it finishes, you are provided with
a command that you can run to connect to the primary MongoDB server instance
by using the
gcutil ssh
command. You can connect to your instances using ssh
to further configure the instances or to perform other tasks such as testing.
When you are finished with the cluster, you can click the Delete Cluster button in the Developers Console to stop all instances and destroy the associated data disks.
Next steps
You might also want to learn about how the MongoDB cluster was deployed. You can learn how Deployment Manager was used and extend that knowledge to your own projects.
Next: Learn how MongoDB was deployed
Troubleshooting
If a deployment fails to complete successfully, check the error message in the Developers Console. If the problem is a CPU quota issue or other problem that you can correct, delete the deployment, correct the problem, and try again.
If the error message on the Developers Console does not provide
sufficient detail about the failure, check the Deployment Manager output on
the virtual machine instances that were launched. On each instance, there will
be a directory
/gagent/metaOutput
with a set of numbered files:
stdoutN.txt
,
stderrN.txt
,
exitcodeN.txt
. Each set of such files corresponds to the
sequenced command that was executed by Deployment Manager for your deployment
on that instance.
To get a list of your compute engine instances, check the Compute Engine list of virtual machine instances in the Developers Console or run the following command:
$ gcloud compute instances list -l
To ssh to an instance:
$ gcloud compute ssh <instance> --zone=<zone>
If you have problems that you cannot resolve or have questions head to Stack Overflow .