aiocluster
Project description
aiocluster
aiocluster is a Python 3.11+ module for distributed systems management, enabling cluster membership tracking, failure detection, configuration sharing, and metadata management. It facilitates scalable and fault-tolerant application sharding through robust cluster coordination capabilities.
References
- ScuttleButt paper: https://www.cs.cornell.edu/home/rvr/papers/flowgossip.pdf
- Phi Accrual error detection: https://www.researchgate.net/publication/29682135_The_ph_accrual_failure_detector
- chitchat https://github.com/quickwit-oss/chitchat/blob/main/README.md
Requirements
- Python 3.11+.
- protobuf
Usage
import asyncio
import logging
from aiocluster import Cluster
from aiocluster import Config
from aiocluster import NodeId
async def main():
node1_id = NodeId(name="simple1", gossip_advertise_addr=("127.0.0.1", 7000))
node2_id = NodeId(name="simple2", gossip_advertise_addr=("127.0.0.1", 7001))
node3_id = NodeId(name="simple3", gossip_advertise_addr=("127.0.0.1", 7002))
config1 = Config(
node_id=node1_id,
gossip_interval=1,
seed_nodes=[("127.0.0.1", 7002)],
cluster_id="simple-aiocluster",
)
config2 = Config(
node_id=node2_id,
gossip_interval=1,
seed_nodes=[("127.0.0.1", 7000)],
cluster_id="simple-aiocluster",
)
config3 = Config(
node_id=node3_id,
gossip_interval=1,
seed_nodes=[("127.0.0.1", 7001)],
cluster_id="simple-aiocluster",
)
cluster1 = Cluster(config1, initial_key_values={"cluster": "1"})
cluster2 = Cluster(config2, initial_key_values={"cluster": "2"})
cluster3 = Cluster(config3, initial_key_values={"cluster": "3"})
async with cluster1, cluster2, cluster3:
await asyncio.sleep(10)
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
asyncio.run(main())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiocluster-1.1.0.tar.gz
(29.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiocluster-1.1.0.tar.gz.
File metadata
- Download URL: aiocluster-1.1.0.tar.gz
- Upload date:
- Size: 29.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25d7afd22a6e65a9ce00bb6b55b1495399f2638c5b6f1d9c8de34af1454e1dd2
|
|
| MD5 |
18531a716c2763ec2fa633b2106a756a
|
|
| BLAKE2b-256 |
7b522540a5f93a9cc604d1807347ff572ddc6db8f426efc9723616d1702b467d
|
File details
Details for the file aiocluster-1.1.0-py3-none-any.whl.
File metadata
- Download URL: aiocluster-1.1.0-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
403a52addf9516a1058350cd5bc933acdc746e170987ada125a110d18d9d2844
|
|
| MD5 |
5fea9f32050fcd6a503fbef6f0b5a7c1
|
|
| BLAKE2b-256 |
6bb93b6adde46b31e37887dc433eee3405c32242e46ba5f7ccb37d6428cb12b9
|