serf_membership 1.2

Creator: bradpython12

Last updated:

0 purchases

serf_membership 1.2 Image
serf_membership 1.2 Images

Languages

Categories

Add to Cart

Description:

serf membership 1.2

Serf Membership=======This is very simple script for election a leader (primary) from all members tagged with specific role.# How can i use it?If you want to use this you should add 2 tags to every `serf agent`:1. role2. startedat // unixtimestamp `date +%Y%m%d%H%M%S%s%N`Based on these 2 tags `serf_membership` select single master from `role` group.## Usage Example```python>>> from serf_membership.client import SerfMembership>>> members = SerfMembership(role="web")>>> members.primary(){'Status': 'alive', 'DelegateCur': 4, 'Addr': '127.0.0.1', 'Tags': {'startedat': 999999999999999999999999, 'role': 'web', 'dc': 'dc1'}, 'ProtocolMax': 3, 'DelegateMin': 2, 'ProtocolMin': 1, 'ProtocolCur': 2, 'Port': 7946, 'DelegateMax': 4, 'Name': 'os3-2.devnodes.eu-bg-sof.startappcloud.com'}```## Serf run example```/usr/local/bin/serf agent -config-dir=/etc/serf/ -tag startedat=`date +%Y%m%d%H%M%S%s%N````# Installationfrom source # git clone [email protected]:mignev/serf-membership.git # cd serf-membership # python setup.py installwith pip # pip install serf_membership#CopyrightCopyright (c) 2016 Marian Ignev. See LICENSE for further details.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.