Project

frosty

0.0
No commit activity in last 3 years
No release in over 3 years
Provides Libraries to query and save to etcd based on the enigma project
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

SwedishChef

This is built around the Enigma infrastructure standards and is meant to be used in chef cookbooks and as part of a knife plugin.

Ruby gem to handle passing and retrieving node and service information from and to etcd

Ex:

swedish = SwedishChef.new(etcd_ip, etcd_port)
swedish.environment = 'production'

node = swedisch.node('node1')
service = swedish.service('memcached')

service.endpoints <- returns an array of endpoints

endpoint1 = service.endpoints[1]

## Below should throw an error if no other endpoint exists to promote
service.demote_endpoint(endpoint1) <- should select a new master and demote the old
service.save()

## print the role of each endpoint
service.endpoints.each do |endpoint|
  puts endpoint.role

  ## promote all nodes not already master
  unless endpoint.role == 'master'
    service.promote_endpoint(endpoint)
  end
end

The result should be that the node gets registered/checks in to etcd.

If the service did not already exist in the environment then the first node to create the service by checking in will be declared master.

both the node and service will be registered under environment in etcd/keys like etcd/keys/production/services/memcached and etcd/keys/production/nodes/ip

storage for our environment is another interesting challenge and while it is a service it should also be a seperate entity.

etcd/keys/production/storage/jira_data/master <- master storage server hosting jira_data etcd/keys/production/storage/jira_data/slaves/host1/last_sync <- 20130930012145

storage can and should be declared similarly to declaring a service.