Wednesday, November 16, 2022

How I manage SetCronJob servers

In the past few months, I've been working on rebuilding Clustermin to help me manage multiple servers and deploy SetCronJob to DigitalOcean servers.

Six years ago, I created Clustermin and made it into a shell script storage. All server installation and configuration commands were stored as Twig bash scripts in the database. Then they were run on one or multiple servers on-demand and on webhook requests.

It worked fine for years, but it couldn't catch up with my needs.

The framework and libraries it was built on became too old and deprecated. I need to either do a big upgrade or try alternative solutions.

So I tried RunCloud, Cleavr, and Laravel Forge. I couldn't even get them to deploy SetCronJob to one server.

Then I used Ploi for a few months for my side project, and it worked great. With a nice user interface, too.

But it's limited. Everything is at the server level. If I need to add another server to the group, it takes a lot of work. Add a site, add multiple cronjobs, add daemons, add a new SSH key to my Bitbucket repo, etc. Many necessary features are behind a paywall too.

So, I decided to rebuild my old project Clustermin.

The web server cluster

Currently, these features are already implemented:

Cluster management (cluster = group of servers)

Most things are at the cluster level. Add a site to a cluster, and it'll be deployed to all servers. Add a server to a cluster, and it deploys all sites along with their cronjobs, daemons, and SSL certificates. If a server cluster is too early for you, just add one server and that's it.

Server installation and configuration

Services installed and monitored

Your servers will have PHP 8.1, Nginx, Redis, Memcached, and Supervisor, ready to deploy Symfony/Laravel/PHP apps.

Push to deploy, zero downtime

You'll get a deploy URL to add to your Git repo's webhook. It'll deploy your site to multiple servers, one by one, and stops if it encounters any problem with deployment. It uses an atomic switch with symlink switching, so no PHP FPM reload (and downtime) is needed.

Server status and service status monitoring

Clustermin monitors your server CPU, RAM, and disk usage every minute, as well as system service status (cron, nginx, supervisor, php8.1-fpm, redis-server, ufw, ssh, fail2ban, etc).

SSL certificates management

Free Let's encrypt SSL certificates will be deployed to all servers with just one click. You can also add your own SSL certificates too.

File manager

File manager

One of the most used features in the previous version of Clustermin. It's really handy when you need to quickly check your files and see what the heck happened with your deployment.

Redis master-replica cluster

You can also deploy a Redis cluster too. Clustermin supports master-replica setup only. When a new server is added to the Redis cluster, it'll automatically replicate the current primary server. I intend to add other types of server clusters soo (e.g. load balancer, database cluster, etc).

--

If you're interested in Clustermin, you can register an account here. Currently, it's free for up to 4GB total server memory (e.g. 4 small servers with 1GB RAM are free).

No comments:

Post a Comment