{"id":20709011,"url":"https://github.com/difrex/rbmd","last_synced_at":"2025-07-21T11:31:49.219Z","repository":{"id":57609953,"uuid":"79560797","full_name":"Difrex/rbmd","owner":"Difrex","description":"RBD mount wrapper cluster","archived":false,"fork":false,"pushed_at":"2017-09-04T21:18:10.000Z","size":94,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T21:24:10.835Z","etag":null,"topics":["ceph","cluster","rbd","zookeeper"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Difrex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-20T13:21:15.000Z","updated_at":"2017-09-04T11:54:12.000Z","dependencies_parsed_at":"2022-08-27T10:41:23.782Z","dependency_job_id":null,"html_url":"https://github.com/Difrex/rbmd","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Difrex/rbmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Difrex%2Frbmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Difrex%2Frbmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Difrex%2Frbmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Difrex%2Frbmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Difrex","download_url":"https://codeload.github.com/Difrex/rbmd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Difrex%2Frbmd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266291552,"owners_count":23906291,"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":["ceph","cluster","rbd","zookeeper"],"created_at":"2024-11-17T01:34:31.558Z","updated_at":"2025-07-21T11:31:49.184Z","avatar_url":"https://github.com/Difrex.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RBMD\n\n[![Build Status](https://travis-ci.org/Difrex/rbmd.svg?branch=master)](https://travis-ci.org/Difrex/rbmd)\n\n![logo](/img/logo.png)\n\nRBDM is a rbd mount cluster. It can check already mounted images and prevent creating another block device.\n\nIt's can map/unmap and mount/umount.\n\n\n**ALLOW FOR STAGING**\n\nCurrent status: *development*, *testing*\n\n**ALLOW FOR STAGING**\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-generate-toc again --\u003e\n**Table of Contents**\n\n- [RBMD](#rbmd)\n    - [Dependencies](#dependencies)\n    - [Usage](#usage)\n        - [Example](#example)\n    - [Build](#build)\n    - [API](#api)\n        - [GET /v1/status](#get-v1status)\n            - [Example](#example)\n        - [GET /v1/node](#get-v1node)\n            - [Example](#example)\n        - [GET /v1/health](#get-v1health)\n            - [Example](#example)\n        - [POST /v1/mount](#post-v1mount)\n            - [Example](#example)\n        - [POST /v1/umount](#post-v1umount)\n            - [Example](#example)\n        - [POST /v1/resolve](#post-v1resolve)\n            - [Example](#example)\n        - [GET /v1/metrics](#get-v1metrics)\n            - [Example](#example)\n    - [Systemd](#systemd)\n- [Troubleshooting](#troubleshooting)\n    - [Umount request is stuck after deadly.](#umount-request-is-stuck-after-deadly)\n- [AUTHORS](#authors)\n- [LICENSE](#license)\n\n\u003c!-- markdown-toc end --\u003e\n\n\n## Dependencies\n\n* Zookeeper\n* Access to ceph cluster(for map/unmap images)\n\n## Usage\n\n```\nUsage of ./rbmd:\n  -listen string\n    \tHTTP API listen address (default \"127.0.0.1:9076\")\n  -tick int\n    \tTick time loop (default 5)\n  -version\n    \tShow version info and exit\n  -ws string\n    \tWebsockets listen address (default \"127.0.0.1:7690\")\n  -zk string\n    \tZookeeper servers comma separated (default \"127.0.0.1:2181\")\n  -zkPath string\n    \tZookeeper path (default \"/rbmd\")\n```\n\n### Example\n\n```./rbmd -listen 127.0.0.1:9908 -zkPath /rbmd-ru-dc3-rack5```\n\n## Build\n\nRun [build.sh](build.sh) script. It's required docker.\n\n## API\n\n### GET /v1/status\n\nReturn JSON of quorum status\n\n#### Example\n\n```json\n{\n  \"quorum\": {\n    \"node.example.com\": {\n      \"node\": \"node.example.com\",\n      \"ip\": {\n        \"v4\": [\n          \"10.0.3.1\"\n        ],\n        \"v6\": [\n          \"fe80::f869:d0ff:fea3:3c0a\"\n        ]\n      },\n      \"updated\": 1483428452,\n      \"mounts\": null\n    }\n  },\n  \"health\": \"alive.\",\n  \"leader\": \"node.example.com\"\n}\n```\n\n### GET /v1/node\n\nReturn JSON of node stats \n\n#### Example\n```json\n{\n  \"node\": \"node.example.com\",\n  \"ip\": {\n    \"v4\": [\n      \"169.254.156.1\"\n    ],\n    \"v6\": [\n      \"fe80::108d:fcff:fe77:3df6\"\n    ]\n  },\n  \"updated\": 1483095493,\n  \"mounts\": null\n}\n```\n\n### GET /v1/health\n\nReturn string with quorum health check result\n\nStatuses:\n  * alive. Match regexp: ```^alive\\.$``` -- all is good\n  * resizing. Match regexp: ```^resizing\\.$``` -- One or more nodes goind down\n  * deadly. Match regexp: ```^deadly\\.$``` -- One or more nodes is down and they has mapped images\n  \n\n#### Example\n```\ncurl 127.0.0.1:9076/health\nalive.\n```\n\n### POST /v1/mount\n\nMap rbd image and mount it\n\nAllowed mount options:\n * ro\n * noatime\n * relatime\n * nosuid\n * noexec\n * nodiratime\n\n#### Example\n\nAccept JSON\n```json\n{\n    \"node\": \"node.example.com\",\n    \"pool\": \"web\",\n    \"image\": \"pictures\",\n    \"mountpoint\": \"/var/www/pictures\",\n    \"mountopts\": \"noatime,nodiratime\",\n    \"fstype\": \"xfs\"\n}\n```\n\nReturn JSON.\n\nOn success\n```json\n{\n    \"state\": \"OK\",\n    \"message\": \"OK\"\n}\n```\n\nOn failure\n```json\n{\n    \"state\": \"FAIL\",\n    \"message\": \"mount: /dev/null not a block device\"\n}\n```\n\n### POST /v1/umount\n\nUnmount filesystem and unmap RBD device\n\n#### Example\n \nAccept JSON\n```json\n{\n    \"node\": \"node.example.com\",\n    \"mountpoint\": \"/var/www/pictures\",\n    \"block\": \"rbd0\"\n}\n```\n\nReturn JSON.\n\nOn success\n```json\n{\n    \"state\": \"OK\",\n    \"message\": \"OK\"\n}\n```\n\nOn failure\n```json\n{\n    \"state\": \"FAIL\",\n    \"message\": \"Not found\"\n}\n```\n\n### POST /v1/resolve\n\nRemove deadly node from quorum.\n\n#### Example\n\nAccept JSON\n```json\n{\n    \"node\": \"node.example.com\"\n}\n```\n\n### GET /v1/metrics\n\nReturn some metrics\n\n#### Example\n\n```json\n{\n  \"goroutines\": 9,\n  \"nodes\": 2,\n  \"mountstotal\": 0,\n  \"cgocall\": 1\n}\n```\n\n## Systemd\n\nExample unit\n```ini\n[Unit]\nDescription=RBMD\nAfter=network.target\n\n[Service]\nExecStart=/usr/bin/rbmd -listen 0.0.0.0:9076 -ws 0.0.0.0:7690 -zk node1:2181,node2:2181,node3:2181\nKillMode=control-group\nRestart=on-failure\n\n[Install]\nWantedBy=multi-user.target\n```\n\n# Troubleshooting\n\n## Umount request is stuck after deadly.\n\nRemove Zk node */rbmd/cluster/node.fqdn/requests/umount*\n\n# AUTHORS\n\nDenis Zheleztsov \u003cdifrex.punk@gmail.com\u003e\n\n# LICENSE\n\nGPL version 3 see [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdifrex%2Frbmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdifrex%2Frbmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdifrex%2Frbmd/lists"}