samrg472 avatar

[Cluster Daemon - Clustd] Automatic DNS Record Updating using Cloudflare

samrg472

Published: 14 Mar 2018 › Updated: 14 Mar 2018

[Cluster Daemon - Clustd] Automatic DNS Record Updating using Cloudflare

alt



(Source)

Introduction

Clustd is an open source cluster management provider. The goal is to provide automated failover systems for apps, whether the system is down for maintenance or an unexpected event. It features completely automatic health checking with plug and play driver support. These drivers bring the functionality of the cluster alive by managing the system or even external resources on the fly.

Disclaimer: This is not intended to be used in conjunction with software that stores data on its own (e.g. database) , otherwise data will be out of sync. For synchronizing data, see your database manual or another synchronization method (e.g. rsync).

What does a cluster look like?

Each machine runs a clustd daemon. Clustd will automatically determine a new master if a machine goes offline. Driver triggers will be executed when a master machine goes offline. Drivers are intended to connect to a locally running clustd instance. Multiple drivers (even of the same type) can connect to the clustd instance to manage multiple services.

alt

The Cloudflare Driver

alt



(Source)

The purpose of this driver is to automatically update DNS records. In the event some publicly accessible service goes offline, this driver can handle switching the DNS records to an online failover machine. An example setup could be running a shell driver and Cloudflare driver on the same machine. If the master goes offline, the shell driver can start the web app and update the DNS records for complete failover protection.

Configuring the driver is simple and straight forward. Multiple DNS records aren't currently supported, but you can run multiple Cloudflare drivers to get around this limitation, if it's necessary to update multiple records.

host: ws://127.0.0.1:3001
secret: 'cluster secret'
cloudflare:
  email: -email-
  api_key: -api_key-
  dns_record:
    zone_id: -zone_id-
    name: mydomain.com
    value: 1.2.3.4
    ttl: 1 # 1 means auto
    proxied: true # Whether to proxy traffic through cloudflare

The Cloudfare web panel doesn't make it trivial to find the DNS record ID. So this will automatically search your DNS records to find the corresponding record and update it accordingly.

Find the driver here: https://github.com/steemdunk/clustd-driver-cloudflare

Setting up a cluster

Clustd documentation can be found at https://github.com/steemdunk/clustd, this is necessary for the initial cluster setup. Drivers are meant to be setup after the cluster is setup.

Other Relevant Dev Updates



Posted on Utopian.io - Rewarding Open Source Contributors

Leave [Cluster Daemon - Clustd] Automatic DNS Record Updating using Cloudflare to:

Written by

Creator of @steemdunk, Follower of The Lord.

Read more #utopian-io posts


Best Posts From samrg472

We have not curated any of samrg472's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From samrg472