Automate the scaling out of Hadoop

May 31, 2015 503 views
Configuration Management Networking DNS Ubuntu

I would like some advice on scaling out a Hadoop cluster, I have created 3 droplets and everything works fine.

I think I can automate the creating of the droplets using the API and I can script some of the Hadoop configuration required but I cannot see a way to resolve the IP address of newly created droplets.

can we set the private IP address when we create the droplet or can we find out what the IP addresses it was set to once created?

1 Answer

When creating a new Droplet, the IP addresses are not assigned until after it has been provisioned. So they are not included in the initial response from the API. Though you can retrieve them programmatically. The JSON response to the create API call will provide a "links" object that can be used to check on the status of the create event. For example, it might look like:

  "droplet": {
    "id": 3164494,
    "name": "",
    "memory": 512,
    "vcpus": 1,
    "disk": 20,
    "locked": true,
    "status": "new",
    "kernel": {
      "id": 2233,
      "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
      "version": "3.13.0-37-generic"
    "created_at": "2014-11-14T16:36:31Z",
    "features": [
    "backup_ids": [

    "snapshot_ids": [

    "image": {
    "size": {
    "size_slug": "512mb",
    "networks": {
    "region": {
    "tags": [

  "links": {
    "actions": [
        "id": 36805096,
        "rel": "create",
        "href": ""

The link to the action object (in this case can then be called to see if the even is completed. Just check for the status field in the reply:

  "action": {
    "id": 36804636,
    "status": "completed",
    "type": "create",
    "started_at": "2014-11-14T16:29:21Z",
    "completed_at": "2014-11-14T16:30:06Z",
    "resource_id": 3164444,
    "resource_type": "droplet",
    "region": "nyc3",
    "region_slug": "nyc3"

Once the status reports completed rather than in-progress, you can retrieve the IP addresses by querying the Droplet's API endpoint.

You can find out more about using the actions endpoint and see a full example in this tutorial:

In version two of the DigitalOcean API, each event that occurs creates [an "Action" object]( These serve both as records of events that have occurred in the past and as a way to check the progress of an on-going event. From creating a new Droplet to transferring an image to a new region, an Action object will provide you with useful information about the event. This article will explain Action objects and show how they can be used in practice.
Have another answer? Share your knowledge.