Module: Synapse

Defined in:
lib/synapse/service_watcher/zookeeper_dns.rb,
lib/synapse.rb,
lib/synapse/log.rb,
lib/synapse/base.rb,
lib/synapse/version.rb,
lib/synapse/haproxy.rb,
lib/synapse/service_watcher.rb,
lib/synapse/service_watcher/dns.rb,
lib/synapse/service_watcher/base.rb,
lib/synapse/service_watcher/ec2tag.rb,
lib/synapse/service_watcher/docker.rb,
lib/synapse/service_watcher/zookeeper.rb

Overview

Watcher for watching Zookeeper for entries containing DNS names that are continuously resolved to IP Addresses. The use case for this watcher is to allow services that are addressed by DNS to be reconfigured via Zookeeper instead of an update of the synapse config.

The implementation builds on top of the existing DNS and Zookeeper watchers. This watcher creates a thread to manage the lifecycle of the DNS and Zookeeper watchers. This thread also publishes messages on a queue to indicate that DNS should be re-resolved (after the check interval) or that the DNS watcher should be shut down. The Zookeeper watcher waits for changes in backends from zookeeper and publishes those changes on an internal queue consumed by the DNS watcher. The DNS watcher blocks on this queue waiting for messages indicating that new servers are available, the check interval has passed (triggering a re-resolve), or that the watcher should shut down. The DNS watcher is responsible for the actual reconfiguring of backends.

Defined Under Namespace

Modules: Logging Classes: BaseWatcher, DnsWatcher, DockerWatcher, EC2Watcher, Haproxy, ServiceWatcher, Synapse, ZookeeperDnsWatcher, ZookeeperWatcher

Constant Summary collapse

VERSION =
"0.11.1"

Instance Method Summary collapse

Instance Method Details

#logObject



2
3
4
# File 'lib/synapse/base.rb', line 2

def log
  @@log ||= Logger.new(STDERR)
end