This Cloud-init script can be used to bootstrap a Xen based CoreOS server through Xen orchestra.
Features;
- Workaround for the lack of /etc/environment on 'unsupported' hypervisors
- Static IP allocation to deal with dhcp causing problems (On my network at least)
- etcd2 bootstrap discovery using public service and discovery tokens
- Manual reconfiguration to allow for membership changes after cluster is operational
- Get discovery token
curl -w "\n" 'https://discovery.etcd.io/new?size=3'
- Boot 3 CoreOS servers using a CoreOS ISO live CD, ensuring that for each you've set
- The Token obtained in (1)
- A different, and avaliable, static IP address
- Check the ETCD2 cluster status using
etcdctl cluster-health
- If all nodes are operational, carry on - otherwise troubleshoot and get ETCD2 working
- install coreos using `coreos-install -d /dev/xvda -o xen -C stable'
- Remove the now broken node from the etcdcluster, eg
etcdctl member remove 4ab6f50e40411ab9
- Add a new node with the same name for the rebooted (and empty etcd node), eg
etcdctl member add coreosred http://192.168.1.15:2380
- Copy the output of step (7) into a file named
/etc/default/etcd2
- Also append
ETCD_DISCOVERY=
to Unset the discovery variable set by the cloud-init script
- Also append
- Reboot the server and check cluster health - if all goes well, your properly installed coreos node should now be running etcd2 consistently
Repeat the above steps for the remaining two nodes in your cluster.
- On a etcd2 operational node;
etcdctl member remove 7063a17f2961acfa && etcdctl member add coreosblue http://192.168.1.16:2380
- On the node you just added (here; coreosblue);
cat << EOF > /etc/default/etcd2
> ETCD_NAME="coreosblue"
> ETCD_INITIAL_CLUSTER="coreosyellow=http://192.168.1.17:2380,coreosblue=http://192.168.1.16:2380,coreosred=http://192.168.1.15:2380"
> ETCD_INITIAL_CLUSTER_STATE="existing"
> ETCD_DISCOVERY=
> EOF
sorry I was on 1395 for a lot of time now and I didn't upgrade, so I have a few questions. Do you have some time to discuss soon about your usage of corseos?