Beispiel #1
0
    seeds = []
    address = '127.0.0.3:14922'
    cluster = HerdCluster(seeds=seeds, address=address, groups=groups, ping_time=5000, managers=managers)
    cluster.start()
    
print "Starting Herd Cluster"
g1 = Greenlet(node1)
g1.start()
g2 = Greenlet(node2)
g2.start()

#Start gossip
gevent.sleep(10)
print "Send a Message to phalliday group via CLUSTER NODE #1"
msg = { 'update_local_data': 'phalliday<===>What about now?'}
manager_client = HerdClusterClient(seeds=['127.0.0.2'])
response = manager_client.request(msg)

gevent.sleep(8)
print "Verify that CLUSTER NODE #1 has the gossip"
msg2 = { 'get_local_data': 'phalliday' }
manager_client = HerdClusterClient(seeds=['127.0.0.2'])
response = manager_client.request(msg2)

gevent.sleep(8)
print "Remove CLUSTER NODE #1 from the phalliday group"
msg2 = { 'remove_group': 'phalliday' }
manager_client = HerdClusterClient(seeds=['127.0.0.2'])
response = manager_client.request(msg2)

gevent.sleep(10)
Beispiel #2
0
from herd.cluster.client import HerdClusterClient

msg = { 'get_local_data': 'phalliday' }
client = HerdClusterClient(seeds=['127.0.0.3'])
client.request(msg)