How to deploy MongoDB?
NOTE: Spheron Compute offers the flexibility to create custom configurations for your instance.
Spheron allows you to deploy a compute instance pre-installed with MongoDB, all set up and ready to use on the Akash Network.
To deploy MongoDB follow these steps:
- Click "New Cluster" on the top right corner.
- Choose "Compute" to use CPU-based instances for running containers.
- Choose your desired Compute Type option under Compute Type.
- Select Start from Marketplace App.
- Pick MongoDB from the marketplace.
- Select your preferred Region, if any. If you do not add a region, the container will be deployed in any region for Spot, or in the eu-east region for On Demand. Click here to know more.
- Spheron will automatically select the recommended plan for the specific template. If you intend to move forward with the recommended plan, just Click "Deploy" to initiate deployment.
- Select the instance plan that suits your needs. You can use the "Create Custom Plan" toggle to create custom plans for your CPU based instance.
- Configure Storage (SSD) plan for your instance. Use the "Add Persistent Storage" toggle to add persistent storage for your instance.
- You can add advanced configuration if required. Click here to know more.
- Click "Deploy" to initiate deployment.
- Root Username - The username used for accessing the MongoDB database.
- Root Password - The password associated with the MongoDB database user.
MongoDB can be accessed only after the Compute Instance is provisioned. Thus, you need to wait for the installation to complete before you can start using it.
You can use the connection string URI to connect to MongoDB. The standard URI connection scheme has the following format:
mongodb://- A required prefix to identify that this is a string in the standard connection format.
username:password(optional) - Authentication credentials passed in App Configuration. If specified, the client will attempt to authenticate the user to the
host[:port]- The host and port number where the mongod instance is running. Use the
Connection URLprovided by Spheron under Port Policy Info.
/defaultauthdb(optional) - The authentication database to use if the connection string includes
username:passwordauthentication credentials, but the authSource option is unspecified. If both authSource and defaultauthdb are unspecified, the client will attempt to authenticate the specified user to the admin database.
?options(optional) - A query string that specifies connection specific options as
<name>=<value>pairs. If the connection string does not specify a database/ you must specify a slash
(/)between the last host and the question mark
(?)that begins the string of options.
For more information, refer to the MongoDB docs (opens in a new tab).