"What is service discovery?" and "Should I investigate consul?" are questions for another day.
Today is the day for the world’s quickest demonstration* of advertising a master-slave-slave redis cluster across consul.
*No effort was made to verify this claim.
Step-by-step:
- It shows a running cluster of consul servers
- Sadly, there is no redis service available. What are we to do?
- Deploy a cluster of redis VMs using BOSH. The deployment includes the consul agent on each VM.
- Watch
consul members
as each of the new redis servers join as consul clients - Celebrate as each of the redis VMs is now advertising itself as a redis service, tagged as either ‘master’ or ‘slave’.
If you’re now interested in consul? Awesome. Read their getting started docs as they are really good.
If you’re a BOSH user (the tool used to boot the redis cluster in the example), then here are the BOSH releases used in the demo:
- redis-boshrelease – Now upgraded support consul announcements
- consul-boshrelease – Use this to either deploy a cluster of consul servers; OR upgrade an existing BOSH deployment to advertise or discover services (a la redis-boshrelease above).