Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

cloudfoundry-community-attic/etcd-boshrelease

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BOSH Release for etcd

Usage

To use this bosh release, first upload it to your bosh:

bosh target BOSH_HOST
git clone https://github.com/cloudfoundry-community/etcd-boshrelease.git
cd etcd-boshrelease
bosh upload release releases/etcd-3.yml

For bosh-lite, you can quickly create a deployment manifest & deploy a 3 VM cluster:

templates/make_manifest warden
bosh -n deploy

For Openstack (Nova Networks), create a three-node cluster:

templates/make_manifest openstack-nova
bosh -n deploy

For AWS EC2, create a three-node clusterg:

templates/make_manifest aws-ec2
bosh -n deploy

Now store some data on one node:

$ curl -X PUT -L http://10.244.0.10:4001/v2/keys/url -d value="db.example.com"
{"action":"set","node":{"key":"/url","value":"db.example.com","modifiedIndex":4,"createdIndex":4}}

And fetch it from another node:

$ curl http://10.244.0.6:4001/v2/keys/url                                     
{"action":"get","node":{"key":"/url","value":"db.example.com","modifiedIndex":4,"createdIndex":4}}

See the list of machines:

$ curl http://10.244.0.6:4001/v2/machines   
http://10.244.0.14:4001, http://10.244.0.6:4001, http://10.244.0.10:4001

You can now start/stop nodes (bosh jobs) and the cluster elects a new leader in the meantime:

$ curl http://10.244.0.10:4001/v2/leader
http://10.244.0.6:7001

# restart 10.244.0.6
$ bosh -n restart etcd_leader_z1 0

$ curl http://10.244.0.10:4001/v2/leader
http://10.244.0.14:7001

Override security groups

For AWS & Openstack, the default deployment assumes there is a default security group. If you wish to use a different security group(s) then you can pass in additional configuration when running make_manifest above.

The security group should allow port 22 and 4001 (for incoming etcd traffic), and port 7001 between the servers themselves.

Create a file my-networking.yml:

---
networks:
  - name: etcd1
    type: dynamic
    cloud_properties:
      security_groups:
        - etcd

Where - etcd means you wish to use an existing security group called etcd.

You now suffix this file path to the make_manifest command:

templates/make_manifest openstack-nova my-networking.yml
bosh -n deploy