Deploy Worldpress in Coreos Cluster Using Fleet
Contents
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.
Ok, ssh
to one of your cluster node, let’s start.
Step 1 Create MySQL service
Create a unit file mysql.service
|
|
To start service, run
fleetctl start mysql.service
To view its status, (normally it should be active and running) run
fleetctl list-units
Step 2 Create WordPress service
Create the second unit file wordpress.service
|
|
Run
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=0
aims to turning off timeouts, as thedocker pull
may take a whileX-ConditionMachineOf=mysql.service
means wordpress service runs on the same host with mysql service
Author Wenfeng
LastMod 2016-06-03