Maxcluster: cluster-control restart PHP with deployer
Fabian Blechschmidt
Most of our customers are hosted on maxcluster. And thanks to their cluster-control one can automate a lot of things using it. For example restarting PHP after deployment. You don’t want this on a production environment, but sometimes it might make sense to have it on a stage machine.
host('customer.winkelwagen.de')
// ...
->set('mc-cluster', 'C-1234')
->set('mc-server', 'srv-a');
<?php
task('maxcluster:apache:restart', function () {
$apiKey = escapeshellarg(getenv('MAXCLUSTER_PA_TOKEN'));
run("cluster-control login --pa_token=$apiKey");
run('cluster-control php:restart {{mc-cluster}} {{mc-server}}');
run("cluster-control logout");
})->select('stage=prod');
Other articles from this category
PHPStorm/IDEA, composer updates and 100% CPU
In one of our projects PHPStorm ran a while on 100% CPU, an investigation showed, that the process „checking for available composer updates“ ran and used all the resources. Most likely it got stuck somewhere. To get rid of the problem, one can turn off this feature. In IDEA Ultimate here: [Settings] -> Languages & […]
Custom Fields, dots and MySQL’s JSON_EXTRACT
We all know custom fields – hopefully – at least this is not about the basics. You can add custom fields to nearly all entites: orders, products, categories, … You can name them whatever you like, e.g. pluginname.property – but using dots . in your custom field name is a bad idea, because then you […]
gpg failed to sign the data
I was doing some work, when suddenly my git failed to commit changed. I dig a little around, asked StackOverflow but it didn’t help. Finally when running the commit manually and not through PHPStorm I got a proper error: Ah! The key is expired! Got it. Did you know you can extend a GPG key? […]