MongoDB

MongoDB

Getting Started with MongoDB on App42 PaaS

This quickstart guide will help you to create MongoDB service on App42 PaaS.


Glossary

Kontena – Kontena is a lightweight container that will run your apps and services in an isolated and secured manner. You can specify the power of the Kontena while setting up infra or creating services. One Kontena power specifies to 256 MB Memory and 128 MHz CPU.

Service – Services in the App42 PaaS are add-on components which are needed in an App. App42 PaaS supports multiple services like SQL databases, NoSQL databases and more.

Prerequisites

To get going with App42 PaaS, below are few prerequisites that will allow you to use AppHQ – App42 PaaS Management Console as well as Command Line Client.


Creating MongoDB service on App42 PaaS Platform

To create a service on App42 PaaS platform, you need to provide certain input parameters like dbname, Kontena Power, Service Type. Below is the screenshot of creating service using Command Line Client. You can also perform the same using AppHQ – App42 PaaS Management Console.

$ app42 createService
Enter Service Name: testMongo
Checking Service Name Availability... OK

1: MySQL 5.5.31
2: Mongodb 2.4.4
3: Couchdb 1.0.1
4: PostgreSQL 9.1.9
Select Service [MySQL 5.5.31]: 2

Enter Database Name: testdb

1: Shared
Select Instance Type [Shared]: 1

1: Amazon (Oregon)
Select IaaS Provider [Amazon (Oregon)]: 1

Specify Kontena Power: 1

Creating Service... OK

Operation is in progress, Please wait...-
Service created successfully.
+---------------+------------------+----------------------------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+
|                                                                                     === testMongo Details ===                          |
+---------------+------------------+----------------------------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+
| Database Name | Iaas Provider    | Token                            | Vm Ip     | State   | User Name        | Vm Port | Service Type  | Password                         | Memory | Service Name |
+---------------+------------------+----------------------------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+
| testdb        | Amazon (Oregon)  | kozy2pdmzj2ml9ascm8xlydg0cn3l2l1 | 10.0.2.12 | RUNNING | a82vwmetq26cri69 | 44336   | Mongodb 2.4.4 | adhsi8uwd118evj9vfhh5huaz8y4uxzm | 256 MB | testMongo    |
+---------------+------------------+----------------------------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+
Accessing MongoDB service from anywhere

In order to access your MongoDB service from outside App42 PaaS platform, you need to bind the IP address with the service you want to access. You can use the provided credentials to access the service by using any client of your choice.

$ app42 bindIP
Enter Service Name: testMongo
Please Provide Source IP
(For public access, use '0.0.0.0'): 0.0.0.0

Binding IP to service... OK

Operation is in progress, Please wait...\
Service bind with IP successfully.
+---------------+------------------+----------------------------------+---------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+
|                                                                                             === testMongo Details ===                                          |
+---------------+------------------+----------------------------------+---------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+
| Database Name | Iaas Provider    | Token                            | Vm Ip         | Source Ip | State   | User Name        | Vm Port | Service Type  | Password                         | Memory | Service Name |
+---------------+------------------+----------------------------------+---------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+
| testdb        | Amazon (Oregon)  | kozy2pdmzj2ml9ascm8xlydg0cn3l2l1 | 54.213.93.154 | 0.0.0.0   | RUNNING | a82vwmetq26cri69 | 44336   | Mongodb 2.4.4 | adhsi8uwd118evj9vfhh5huaz8y4uxzm | 256 MB | testMongo    |
+---------------+------------------+----------------------------------+---------------+-----------+---------+------------------+---------+---------------+----------------------------------+--------+--------------+