https://github.com/exosite/libcluster_db
Automatic cluster formation/healing for Elixir applications using database heartbeat.
https://github.com/exosite/libcluster_db
clustering elixir
Last synced: 17 days ago
JSON representation
Automatic cluster formation/healing for Elixir applications using database heartbeat.
- Host: GitHub
- URL: https://github.com/exosite/libcluster_db
- Owner: exosite
- Created: 2018-05-09T09:22:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-07-09T15:19:17.000Z (12 months ago)
- Last Synced: 2025-07-09T16:28:43.117Z (12 months ago)
- Topics: clustering, elixir
- Language: Elixir
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 21
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LibclusterDB
Automatic cluster formation/healing for Elixir applications using database heartbeat.
This is a database heartbeat strategy for [libcluster](https://hexdocs.pm/libcluster/). It currently supports identifying nodes based on Mongodb.
## Installation
```elixir
def application do
[
applications: [
:libcluster_db,
...
],
...
]
def deps do
[{:libcluster_db, github: "exosite/libcluster_db", branch: "master"}]
end
```
## An example configuration
The configuration for libcluster_db can also be described as a spec for the clustering topologies and strategies which will be used. (Now only Mongodb heartbeat implementation.)
### Mongodb
Mongodb heartbeat implementation. We support this format to get the setting values from environment variables. Like this:
`{:system, "MONGODB_URL", "mongodb://localhost:27017/cluster_heartbeat"}`
```elixir
config :libcluster,
topologies: [
example: [
strategy: ClusterDB.Strategy.Mongo,
config: [
mongodb: [
url: "mongodb://localhost:27017/cluster_heartbeat",
type: :unknown,
pool_handler: DBConnection.Poolboy,
collection_name: "node_status"
],
heartbeat: [interval: 1000, delay_tolerance: 1000],
],
]
]
```