On Digital Ocean

HarperDB is available as a DigitalOcean Droplet on their Marketplace here: https://marketplace.digitalocean.com/apps/harperdb.

Deploying a HarperDB Droplet

HarperDB Droplets can be created with just a few clicks. The following instructions assume you have already created a Digital Ocean account with a payment method.

  1. Begin on the Digital Ocean Marketplace HarperDB application page.
    This page contains additional usage instructions once the Droplet is spun up. 
  2. Click Create HarperDB Droplet.
  3. Configure your plan.
    Any of the options will work for HarperDB.
  4. Add block storage.
    Your HarperDB data will reside on this volume.

    1. Click Add Volume.
    2. Choose your volume size.
    3. Select Manually Format & Mount.
  5. Choose a datacenter region.
    We recommend choosing the region physically closest to you and/or your users.
  6. Configure Authentication.
    Configure this however you like, this will be used for you to access the virtual machine.
  7. Configure the rest of the Droplet.
    None of these options are required for HarperDB, so we recommend leaving them as the defaults.
  8. Click Create Droplet.
  9. Wait for DigitalOcean to provision your Droplet.
  10. Refer to the Digital Ocean Marketplace HarperDB application page for more information on using HarperDB on Digital Ocean.
    Note, the Droplet is packaged with a barebones version of the HarperDB Studio used for basic schema browsing.
  11. The Droplet can be connected and licensed via the HarperDB Studio by configuring it as a User-Installed Instance.

Extend Volume Disk

DigitalOcean only allows a single volume to be added at a time. When HarperDB configures the initial volume during 1-click Droplet creation a Logical Volume Manager (LVM) is used to make it easy to expand the storage. Even if there was not a volume added during the creation the instructions below will help you get LVM configured and running. The below instructions assume that you are on the Volumes configuration screen of your Droplet, accessed with the following instructions:

  1. Select the Digital Ocean project you’re working on.
  2. Select the HarperDB Droplet you would like to edit.
  3. Click Volumes.
Expand LVM with Another Volume

In this case we will be adding an additional volume to increase the HarperDB data storage capacity.

  1. Click Add Volume.
  2. Select the Volume Size.
  3. Name the volume (optional).
  4. Select Manually Format & Mount.
  5. Click Create Volume.
  6. Wait for Digital Ocean to provision the volume.
  7. SSH into the Droplet.
    The DigitalOcean screen will provide SSH instructions. 
  8. Check that the new volume exists with lsblk. The new volume which will not be mounted or formated is named: sdb. Notice the first volume created during droplet creation is already attached to the LVM.
  9. Use the following commands to create what LVM calls a physical volume. Your user will need root permissions to use LVM commands, the sudo password is your Digital Ocean Droplet ID.
    curl http://169.254.169.254/metadata/v1/id -w "\n"
    sudo pvcreate /dev/sdb

  10. Add the physical volume to the existing volume group.
    sudo vgextend hdb_vg /dev/sdb

  11. Extend the existing logical volume.
    sudo lvm lvextend -l +100%FREE /dev/hdb_vg/hdb_lv

  12. Your LVM has now been extended to include the new volume. You can repeat this process as necessary to add storage.

 

Add LVM to Droplet without Volumes

In cases where a volume was not added to the droplet and you need additional HarperDB storage space, this process will configure the LVM and add an initial volume.

  1. Click Add Volume.
  2. Select the Volume Size.
  3. Name the volume (optional).
  4. Select Manually Format & Mount.
  5. Click Create Volume.
  6. Wait for Digital Ocean to provision the volume.
  7. SSH into the Droplet.
    The DigitalOcean screen will provide SSH instructions. 
  8. Check that the new volume exists with lsblk. The new volume which will not be mounted or formated is named: sda.
  9. Use the following commands to create what LVM calls a physical volume. Your user will need root permissions to use LVM commands, the sudo password is your Digital Ocean Droplet ID.
    curl http://169.254.169.254/metadata/v1/id -w "\n"
    sudo pvcreate /dev/sda

  10. Create the Volume Group.
    sudo vgcreate hdb_vg /dev/sda

  11. Create the Logical Volume.
    sudo lvcreate -n hdb_lv -l 100%FREE hdb_vg

  12. Format the Logical Volume.
    sudo mkfs.ext4 -L hdb_data /dev/hdb_vg/hdb_lv

  13. Move existing HarperDB data to another directory, so that is can be move to the new volume later, and then mount with the new LVM.
    harperdb stop
    mkdir /home/ubuntu/hdb_orig/
    mv /home/ubuntu/hdb/* /home/ubuntu/hdb_orig/
  14. Mount the LVM on the HarperDB data directory and check that the LVM mounted.
    sudo mount /dev/hdb_vg/hdb_lv /home/ubuntu/hdb/
    df -h

  15. Move the HarperDB data back to /hdb/.
    mv /home/ubuntu/hdb_orig/* /home/ubuntu/hdb/
  16. The HarperDB data now resides on the new volume. You can continue expanding this storage by following the above instructions for expanding the LVM with another volume.