In this post, I would like to tell you how to deploy a simple WorldPress service with MySQL database in CoreOS cluster in 3 minutes. You may reference my previous blog to setup a CoreOS cluster locally if you don’t have one.
ssh to one of your cluster node, let’s start.
Step 1 Create MySQL service
Create a unit file
To start service, run
fleetctl start mysql.service
To view its status, (normally it should be active and running) run
Step 2 Create WordPress service
Create the second unit file
fleetctl start wordpress.service
Ok, it’s done! Go http://<your-coreos-host-ip>:8880 and you should see the WordPress install page.
A bit Explanation
TimeoutStartSec=0aims to turning off timeouts, as the
docker pullmay take a while
X-ConditionMachineOf=mysql.servicemeans wordpress service runs on the same host with mysql service