<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HarperDB - Architect the cloud</title>
	<atom:link href="https://blog.slepcevic.net/tag/harperdb/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.slepcevic.net</link>
	<description></description>
	<lastBuildDate>Tue, 27 Feb 2024 12:50:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>Deploying HarperDB Docker container on Linode VM using Terraform and cloud-init</title>
		<link>https://blog.slepcevic.net/deploying-harperdb-docker-container-on-linode-vm-using-terraform-and-cloud-init/</link>
					<comments>https://blog.slepcevic.net/deploying-harperdb-docker-container-on-linode-vm-using-terraform-and-cloud-init/#respond</comments>
		
		<dc:creator><![CDATA[Alesandro Slepčević]]></dc:creator>
		<pubDate>Tue, 27 Feb 2024 12:45:04 +0000</pubDate>
				<category><![CDATA[Akamai Connected Cloud]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Terraform]]></category>
		<category><![CDATA[HarperDB]]></category>
		<category><![CDATA[Linode]]></category>
		<guid isPermaLink="false">http://172.233.40.105/blog.slepcevic.net/?p=227</guid>

					<description><![CDATA[<p>This blog post is a small update to the excellent post guys from HarperDB wrote &#8211; https://www.harperdb.io/development/tutorials/deploying-harperdb-on-digital-ocean-linode-with-terraform Since Linode now support cloud-init and metadata service, I decided to extend their example by using cloud-init to do the installation of Docker...</p>
<p>The post <a href="https://blog.slepcevic.net/deploying-harperdb-docker-container-on-linode-vm-using-terraform-and-cloud-init/">Deploying HarperDB Docker container on Linode VM using Terraform and cloud-init</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This blog post is a small update to the excellent post guys from HarperDB wrote &#8211; <a href="https://www.harperdb.io/development/tutorials/deploying-harperdb-on-digital-ocean-linode-with-terraform" target="_blank" rel="noreferrer noopener">https://www.harperdb.io/development/tutorials/deploying-harperdb-on-digital-ocean-linode-with-terraform</a></p>



<p>Since Linode now support <a href="https://www.linode.com/docs/guides/applications/configuration-management/cloud-init/">cloud-init</a> and <a href="https://www.linode.com/docs/guides/using-metadata-cloud-init-on-any-distribution/">metadata service</a>, I decided to extend their example by using cloud-init to do the installation of Docker Engine and HarperDB container. </p>



<p>All you need to do to get HarperDB running is to copy all of these files in the same folder while making sure to keep the filenames the same (<strong>harperdb.yaml</strong> at least). </p>



<p>After that, simply run Terraform init, then Terraform apply and in 2-3 minutes you should have your HarperDB instance up and running. </p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="1083" height="540" src="https://blog.slepcevic.net/wp-content/uploads/2024/02/harpervscode.png" alt="This is how your folder structure should look like when you copy all the files. " class="wp-image-253" srcset="https://blog.slepcevic.net/wp-content/uploads/2024/02/harpervscode.png 1083w, https://blog.slepcevic.net/wp-content/uploads/2024/02/harpervscode-300x150.png 300w, https://blog.slepcevic.net/wp-content/uploads/2024/02/harpervscode-1024x511.png 1024w, https://blog.slepcevic.net/wp-content/uploads/2024/02/harpervscode-768x383.png 768w" sizes="(max-width: 1083px) 100vw, 1083px" /></figure>



<figure class="wp-block-pullquote has-small-font-size" style="font-style:normal;font-weight:700"><blockquote><p><strong>Please change the passwords for your Linode VM and HarperDB in the compute.tf &amp; harperdb.yaml files &lt;3</strong><br><strong> Don&#8217;t be that guy! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></strong></p><cite>Alex, 2024</cite></blockquote></figure>



<pre class="wp-block-code"><code>terraform init
terraform apply -var="token=YourLinodeToken"</code></pre>



<p><strong>harperdb.yaml</strong></p>



<pre class="wp-block-code"><code>#cloud-config
runcmd:
  - sudo apt-get update
  - sudo apt-get install -yq ca-certificates curl gnupg lsb-release
  - sudo install -m 0755 -d /etc/apt/keyrings
  - for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
  - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  - sudo chmod a+r /etc/apt/keyrings/docker.gpg
  - echo "deb &#091;arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release &amp;&amp; echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null
  - sudo apt-get update
  - sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  - sudo mkdir /home/harperdb
  - sudo chmod 777 /home/harperdb
  - sudo docker run -d -v /home/harperdb:/home/harperdb/hdb -e HDB_ADMIN_USERNAME=HDB_ADMIN -e HDB_ADMIN_PASSWORD=<strong>password </strong>-p 9925:9925 -p 9926:9926 harperdb/harperdb</code></pre>



<p><strong>compute.tf</strong></p>



<pre class="wp-block-code"><code>resource "linode_instance" "harperdb" {
  image = "linode/ubuntu22.04"
  region = "nl-ams" #Pick The region you want
  type = "g6-standard-1"
  root_pass = "YourRootPassword!" #Change this :D
   metadata {
    user_data = base64encode(file("${path.module}/harperdb.yaml"))
  }
}

resource "linode_firewall" "harperdb_firewall" {
  label = "harperdb"

  inbound {
    label    = "ssh"
    action   = "ACCEPT"
    protocol = "TCP"
    ports    = "22"
    ipv4     = &#091;"0.0.0.0/0"]
    ipv6     = &#091;"::/0"]
  }

  inbound {
    label    = "harperdb"
    action   = "ACCEPT"
    protocol = "TCP"
    ports    = "9925-9926"
    ipv4     = &#091;"0.0.0.0/0"]
    ipv6     = &#091;"::/0"]
  }

  inbound_policy = "DROP"
  outbound_policy = "ACCEPT"
  linodes = &#091;linode_instance.harperdb.id]
}

terraform {
  required_providers {
    linode = {
      source = "linode/linode"
    }
  }
}

provider "linode" {
  token = var.token
}

variable "token" {
    default = ""
    type = string
}</code></pre>



<p>Alex. </p><p>The post <a href="https://blog.slepcevic.net/deploying-harperdb-docker-container-on-linode-vm-using-terraform-and-cloud-init/">Deploying HarperDB Docker container on Linode VM using Terraform and cloud-init</a> first appeared on <a href="https://blog.slepcevic.net">Architect the cloud</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.slepcevic.net/deploying-harperdb-docker-container-on-linode-vm-using-terraform-and-cloud-init/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: blog.slepcevic.net @ 2026-01-06 11:35:11 by W3 Total Cache
-->