{"id":19378816,"url":"https://github.com/linbit/drbd-reactor","last_synced_at":"2025-04-23T19:32:31.610Z","repository":{"id":82827749,"uuid":"339761085","full_name":"LINBIT/drbd-reactor","owner":"LINBIT","description":"Monitors DRBD resources via plugins.","archived":false,"fork":false,"pushed_at":"2025-03-24T09:54:16.000Z","size":1291,"stargazers_count":38,"open_issues_count":0,"forks_count":10,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-02T19:11:32.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LINBIT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-17T15:06:25.000Z","updated_at":"2025-03-24T09:54:21.000Z","dependencies_parsed_at":"2023-05-10T20:00:44.951Z","dependency_job_id":"72f7a9b6-aecb-4597-8068-3786e7844d68","html_url":"https://github.com/LINBIT/drbd-reactor","commit_stats":null,"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LINBIT%2Fdrbd-reactor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LINBIT%2Fdrbd-reactor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LINBIT%2Fdrbd-reactor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LINBIT%2Fdrbd-reactor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LINBIT","download_url":"https://codeload.github.com/LINBIT/drbd-reactor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250499922,"owners_count":21440715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T09:07:29.656Z","updated_at":"2025-04-23T19:32:30.863Z","avatar_url":"https://github.com/LINBIT.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# drbd-reactor\n\n`drbd-reactor` is a daemon consisting of a core that does DRBD events processing and plugins that can react on\nchanges in a DRBD resource.\n\n# Plugins\n\n| Plugin                           | Purpose                             |\n| -------------------------------- | ------------------------------------|\n| [debugger](/doc/debugger.md)     | Demo that prints state changes      |\n| [promoter](/doc/promoter.md)     | Simple HA for resources             |\n| [umh](/doc/umh.md)               | User mode helper                    |\n| [prometheus](/doc/prometheus.md) | Prometheus endpoint                 |\n| [agentx](/doc/agentx.md)         | AgentX subagent for SNMP monitoring |\n\n## Implementation\n\n- [x] debugger\n- [x] promoter\n- [x] umh (user defined filters)\n- [ ] umh (replacement for kernel called helpers: Under active development)\n- [x] prometheus\n\n# Configuration\n\nThis daemon is configured via a configuration file. The only command line option allowed is the path to the\nconfiguration. The default location for the config is `/etc/drbd-reactor.toml`. The repository contains an example\n[drbd-reactor.toml](/example/drbd-reactor.toml). This file should act as the entry point only to specify a snippets\ndirectory where one places one snippet per plugin instance. Users should  use `drbd-reactorctl` to manage these\nsnippets.\n\n## Automatic Reload\n\nIn very dynamic environments it might be favorable to automatically reload the daemon whenever a configuration\nsnippet is added or removed. This can be done by using the `drbd-reactor-reload` systemd path unit that is shipped\nin the `example` directory:\n\n```shell\ncp example/drbd-reactor-reload.{path,service} /etc/systemd/system/\nsystemctl enable --now drbd-reactor-reload.path\n```\n\n# Building\n\nThis is a Rust application. If you have a Rust toolchain and `cargo` installed (via distribution packages or\n[rustup](https://rustup.rs)) you can build it via:\n\n```shell\ncargo build\n```\n\n# Architecture\n\n## Core\n\nThe core consists of 2 threads. The first one is responsible for actual `drbdsetup events2` processing. It\nsends update event structs on a channel to the main thread.\n\nThe main thread keeps track of the overall DRBD resource state by applying these updates to an internal map of\nresource structs. Think of these as the output of `drbdsetup status --json`. The second purpose is to generate\n`PluginUpdate` enums if important properties of a resource changed. For example one variant of the\n`PluginUpdate` is `ResourceRole`, that is generated if the role of a resource changed. These variants follow\nthe same structure: They contain the event type, information that identifies the actual DRBD object (resource\nname, peer ID, volume ID,...) and the `old` and `new` states. These old/new states contain the rest of\nthe relevant information within this event (e.g., the `may_promote`, and `promotion_score`). Think of `old`\nand `new` structs as easy to consume diffs. A `PluginUpdate` also contains the current, complete state of the\nresource.\n\n## Plugins\n\nPlugins are maintained in this repository. Every plugin is started as its own thread by the `core`.\nCommunication is done via channels where plugins only consume information.\n\nThe core expose a `PluginUpdate` channel, the plugin decides if it wants to use the diffs from `old` and\n`new`, and/or the complete current state from `resource`.\n\n# Contributions\n\nContributions are obviously always welcome! Please talk to us first *before* you start working on a new\nplugin. Please check the state of plugins at the beginning of the document, and don't work on plugins that are\ncurrently under development by somebody else.\n\n## Dependencies\n\nWe have to be a bit careful introducing new dependencies as we want to provide `drbd-reactor` via a\n[PPA](https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack). So please use only dependencies that\nare packaged as `librust-` package in Ubuntu Focal. We might relax that, but that would need to be a very very\nconvincing argument. Again, talk to us early.\n\n# Current implementation considerations\n\nCurrently plugins have to filter their `PluginUpdate` stream by themselves. This keeps the core simple, but\nallowing some kind of filtered subscription could make sense. If we don't do that, and keep the \"all plugins\nget all events\" semantic, we could switch to a broadcast channel, there are some crates out there.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinbit%2Fdrbd-reactor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinbit%2Fdrbd-reactor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinbit%2Fdrbd-reactor/lists"}