«

»

NDB – Scale Storage for a MongoDB Instance

Since a few NDB versions back it is supported to scale/increase database storage  (data, journal and log) for MongoDB instance via API and CLI, see for example NDB 2.5.1.1 Release Notes to find out NDB capabilities for a MongoDB instance including:

  • Single instance vs Replica set
  • Greenfield which is a DB provisioned by NDB vs Brownfield which is a DB registered to NDB

I have received a few quistions about how to do this via API so here we go. First some basic info about the API call.

  • HTTP Method
    • Post
  • NDB URI
    • /era/v0.9/databases/<DB_uuid>/update/extend-storage
  • Body/Payload
    • {
        "actionArguments": [
          {
            "name": "working_dir",
            "value": "/tmp"
          },
          {
            "name": "pre_script_cmd",
            "value": ""
          },
          {
            "name": "post_script_cmd",
             "value": ""
          },
          {
            "name": "storage_size",
            "value": "<value_of_your_choice>"
          },
          {
            "name": "data_percent",
            "value": "<value_of_your_choice>"
          },
          {
            "name": "journal_percent",
            "value": "<value_of_your_choice>"
          },
          {
            "name": "log_percent",
            "value": "<value_of_your_choice>"
          }
        ],
         "applicationType": "mongodb_database"
      }
      

Let’s try it out, i will increase total storage from 600GB to 700GB.

  1. List current storage definition via:
    1. NDB
    2. DB Server VM (ssh) – Data 340GB, Journal 140GB, & Log 120GB
  2. Now i’ll extend my storage via Postman with 100 GB where 70% will be used for data, 20% for journal and 10% for log
  3. NDB API response via Postman
  4. NDB operation to extend storage
  5. New storage available is now 600GB
    1. NDB
    2. DB Server VM (ssh) – Data increase from 340GB to 410GB, Journal increased from 140GB to 160GB, & Log increased from 120GB to 130GB

That simple👍👍