etcd 2.0 cluster with proxy on Windows Server 2012
August 15, 2015 4 Comments
I got interested in etcd while working on CoreOS for a work project. I’m no fan of Linux, but I like what etcd offers and how simple it is to setup and manage. Thankfully, the etcd team produces a Windows build with every release. I created a Chocolatey package and got it published, then used it to setup the cluster. The service is hosted by nssm, which also has a Chocolatey package and the extremely helpful nssm edit tool for making changes to the service config. Etcd has great documentation here.
Etcd is installed by running:
choco install -y etcd --params="<service parameters>"
Where service parameters is:
etcd --name "%COMPUTERNAME%" ^ --initial-advertise-peer-urls "http://%COMPUTERNAME%:2380" ^ --listen-peer-urls "http://%COMPUTERNAME%:2380" ^ --listen-client-urls "http://%COMPUTERNAME%:2379,http://127.0.0.1:2379" ^ --advertise-client-urls "http://%COMPUTERNAME%:2379" ^ --discovery "https://discovery.etcd.io/<your_token_here>" ^ --debug
Or you can install it in proxy mode by running:
choco install -y etcd --params="--proxy on --listen-client-urls http://127.0.0.1:2379 --discovery https://discovery.etcd.io/<your_token_here>"
Proxy mode is especially useful because it lets applications running on a machine be ignorant of the etcd cluster. Applications connect to localhost on a known port, and etcd in proxy mode manages finding and using the cluster. Even if the cluster is running on CoreOS, running etcd in proxy mode on Windows is a good way to help Windows apps leverage etcd.
Watch a demo of the whole thing here:
Recent Comments