[Cluster Daemon] - Add Shell Driver for Cluster Control [part 3]
(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. When the system is ready, it will deployed in production on @steemdunk to minimize any form of downtime for the bot and web services.
Disclaimer: This is not intended to be used in conjunction with a database, otherwise data will be out of sync. See your database manual for setting up clusters that will preserve the integrity of your database across multiple machines.
What does a cluster look like?
Reminder from part 2 of what the full cluster will look like. This driver allows you to put the full setup into action for testing and deployment across multiple machines. :)
Each machine runs a clustd daemon. The daemon provides automatic consensus on deciding a new master if the master goes down. Drivers control what actions to perform when this happens.
Shell Driver
This is the first release of the shell driver. It is the most basic of all but can be used to virtually control anything on the system with a shell script. The script is executed as the same user as the driver process. Scripts must not require any form of manual intervention! This includes sudo that requires a password.
The "1" and "2" and the script output is retrieved from the configuration as an environment variable. This is the output of the driver with full debugging enabled.
The following configuration is used:
host: ws://127.0.0.1:3001
secret: 'cluster secret'
script:
shell: /bin/bash
cwd: .
start: ./start.sh
stop: ./stop.sh
env:
TEST: 1
MY_VAR: 2
Of course, you can specify any shell or command. The start/stop commands don't even need to be scripts. It can be something as simple as systemctl start myservice (this command may require root depending on your system configuration). Scripts are the recommended way to go if more than a single line is needed.
Find the driver here: https://github.com/steemdunk/clustd-driver-shell
Now what?
clustd can now be deployed in a fully functional and useful manner. The previous parts setup the cluster, but wasn't able to provide usefulness. The shell driver will now fill the missing gap to provide full functionality you would expect of a cluster.
This is the first step towards creating a cluster for @steemdunk and will be deployed there first on a couple of machines. Afterwards automatic DNS record updating and notification drivers can be implemented to ensure uptime of web services and to personally notify me of issues.
Previous parts
If you're new to the project, be sure to check out the previous parts to get a full idea on the project.
Components
Posted on Utopian.io - Rewarding Open Source Contributors
Leave [Cluster Daemon] - Add Shell Driver for Cluster Control [part 3] to:
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
- The greatest threat for some... The greatest hope for others.
- GODcoin Dev Blog #1 - Intro & P2P Networking with Epidemic Broadcast Trees
- [Cluster Daemon - Clustd] Automatic DNS Record Updating using Cloudflare
- [Cluster Daemon] - Add Shell Driver for Cluster Control [part 3]
- [Cluster Daemon] - Plug & Play Driver Support [part 2]
- Cluster Daemon - Creating an Automated Failover System [part 1]
- [Utopian-IO] Revisions to the Moderation Payment Script
- Steemdunk Dev Update: Automatic Reward Claiming
- Witness Update and Call to Action - Feb 13th, 2018
- Zram and Zswap - The Full Rundown
- [Utopian-IO] New Moderation Pay Script
- Witness Update - WOW - Already Ranked 108 - Plans for Public RPC Node
- Running a Witness - Utopian Developer && Creator of Steemdunk
- [Utopian-IO] Contributor Report - Full Documentation, Session Cleaning, and Bug Fixes
- [Utopian-IO] It's Been a Long Journey
- [Utopian-IO] Retrieving Top Projects with the Utopian API
- Steem Dunk - We now use SteemConnect - Get Started in a Single Step - NEW Landing Page
- [Utopian-IO] Session System for the Backend and Frontend
- Recovering a Steemit Account using Steem-JS
- Refactoring and Cleaning the Utopian API [Part 2]