<commit_before>h2. Broham: A simple, global, highly-available, none-too-bright service registry.

**Broham always knows where his bros are, bro!** Using broham, a newly-created cloud machine can annouce its availability for a certain role ("nfs_server" or "db_slave-2"), allowing any other interested nodes to discover its public_ip, private_ip, etc.

Examples:

<pre><code>
  require 'broham'
  Settings.access_key_id     = '<KEY>'
  Settings.secret_access_key = '<KEY>'

  # create a context for the 'chad' cluster
  class Chad < Broham::Cluster ; end
  Chad.establish_connection
  Chad.create_domain

  # On NFS server start, register an nfs share
  Chad.register_nfs_share '/home'
  #=> #<Chad @attributes={"timestamp"=>["20100405072638"], "client_path"=>["/home"], "server_path"=>["/home"], "role"=>["nfs_server"], "public_ip"=>["250.249.248.247"], "private_ip"=>["192.168.69.22"], "default_ip"=>["192.168.69.22"]}
  # On the nfs clients, get the local IP and server-side path of the share, ready to insert into /etc/fstab
  Chad.nfs_device_path 
  #=> "192.168.69.22:/home"

  # Register as one of many nodes with a given role
  Chad.register_as_next 'dj'
  #=> #<Chad @attributes={"timestamp"=>["20100405072931"], "role"=>["dj-1"], "idx"=>["1"], "default_ip"=>["192.168.69.10"], "public_ip"=>["250.249.248.247"], "private_ip"=>["192.168.69.10"]}
  
  # Find the highest-yet-registered node in the 'dj' role and immediately
  # register as the next one. Even if a thundering herd of hosts try to register
  # in this role, Broham will ensure that exactly one host claims each index.
  Chad.host('dj') ; Chad.register_as_next 'dj'
  #=> #<Chad @attributes={"timestamp"=>["20100405073626"], "role"=>["dj"], "idx"=>["2"], "default_ip"=>["192.168.69.14"], "public_ip"=>["250.249.248.247"], "private_ip"=>["192.168.69.14"]}]<commit_msg>README fixes<commit_after>h2. Broham: A simple, global, highly-available, none-too-bright service registry.

**Broham always knows where his bros are, bro!** Using broham, a newly-created cloud machine can annouce its availability for a certain role ("nfs_server" or "db_slave-2"), allowing any other interested nodes to discover its public_ip, private_ip, etc.

It uses Amazon's SimpleDB service, so the registry is global, highly-available, secure, accessible from any programming language (or even @curl@ if you're clever), and simple. As for Broham himself, he fills out a suit OK but isn't too bright: there's no monitoring or logging, for instance.

Broham plays nicely with "Chef":http://github.com/opscode/chef and indeed was written to coordinate node assignment for a "hadoop cluster chef setup.":http://github.com/mrflip/hadoop_cluster_chef

Examples:

<pre><code>
  require 'broham'
  Settings.access_key_id     = '<KEY>'
  Settings.secret_access_key = '<KEY>'

  # create a context for the 'chad' cluster
  class Chad < Broham::Cluster ; end
  Chad.establish_connection
  Chad.create_domain

  # On NFS server start, register an nfs share
  Chad.register_nfs_share '/home'
  #=> #<Chad @attributes={"timestamp"=>["20100405072638"], "client_path"=>["/home"], "server_path"=>["/home"], "role"=>["nfs_server"], "public_ip"=>["250.249.248.247"], "private_ip"=>["192.168.69.22"], "default_ip"=>["192.168.69.22"]}
  # On the nfs clients, get the local IP and server-side path of the share, ready to insert into /etc/fstab
  Chad.nfs_device_path 
  #=> "192.168.69.22:/home"

  # Register as one of many nodes with a given role
  Chad.register_as_next 'dj'
  #=> #<Chad @attributes={"timestamp"=>["20100405072931"], "role"=>["dj-1"], "idx"=>["1"], "default_ip"=>["192.168.69.10"], "public_ip"=>["250.249.248.247"], "private_ip"=>["192.168.69.10"]}
  
  # Find the highest-yet-registered node in the 'dj' role and immediately
  # register as the next one. Even if a thundering herd of hosts try to register
  # in this role, Broham will ensure that exactly one host claims each index.
  Chad.host('dj') ; Chad.register_as_next 'dj'
  #=> #<Chad @attributes={"timestamp"=>["20100405073626"], "role"=>["dj"], "idx"=>["2"], "default_ip"=>["192.168.69.14"], "public_ip"=>["250.249.248.247"], "private_ip"=>["192.168.69.14"]}]
{'fraction_non_alphanumeric': 0.16814797021378813, 'fraction_numerical': 0.07350468412202739, 'mean_word_length': 5.06113537117904, 'pattern_counts': {'":': 2, '<': 19, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 20, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1013408', 'n_tokens_mistral': 1641, 'n_tokens_neox': 1404, 'n_words': 409}