{"id":21031986,"url":"https://github.com/navid2zp/citus-failover","last_synced_at":"2025-05-15T12:31:27.751Z","repository":{"id":38342730,"uuid":"356929301","full_name":"Navid2zp/citus-failover","owner":"Navid2zp","description":"Worker failover support for PostgreSQL Citus extension using pg_auto_failover.","archived":false,"fork":false,"pushed_at":"2023-02-21T17:25:37.000Z","size":257,"stargazers_count":26,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T09:12:18.375Z","etag":null,"topics":["citus","citus-extension","citusdb","failover","postgres","postgresql","postgresql-extension"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Navid2zp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-11T17:08:57.000Z","updated_at":"2024-02-28T17:44:38.000Z","dependencies_parsed_at":"2024-06-19T01:34:59.791Z","dependency_job_id":"fe88ba7f-580a-4ba2-89c6-f3823a613b09","html_url":"https://github.com/Navid2zp/citus-failover","commit_stats":{"total_commits":30,"total_committers":4,"mean_commits":7.5,"dds":"0.19999999999999996","last_synced_commit":"479d340055910ed9c1bedc2cf3ca50ff90405541"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fcitus-failover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fcitus-failover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fcitus-failover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Navid2zp%2Fcitus-failover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Navid2zp","download_url":"https://codeload.github.com/Navid2zp/citus-failover/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254341131,"owners_count":22054984,"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":["citus","citus-extension","citusdb","failover","postgres","postgresql","postgresql-extension"],"created_at":"2024-11-19T12:39:32.757Z","updated_at":"2025-05-15T12:31:26.808Z","avatar_url":"https://github.com/Navid2zp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/navid2zp/citus-failover\" /\u003e\n  \u003cimg alt=\"Go version\" src=\"https://img.shields.io/github/go-mod/go-version/navid2zp/citus-failover\" /\u003e\n  \u003cimg alt=\"Build\" src=\"https://img.shields.io/github/workflow/status/navid2zp/citus-failover/Go\" /\u003e\n\t\u003cimg alt=\"Docker size\" src=\"https://img.shields.io/docker/image-size/navid2zp/citus-failover\" /\u003e\n\t\u003cimg alt=\"Docker version\" src=\"https://img.shields.io/docker/v/navid2zp/citus-failover\" /\u003e\n\t\u003cimg alt=\"Docker pulls\" src=\"https://img.shields.io/docker/pulls/navid2zp/citus-failover\" /\u003e\n\u003c/p\u003e\n\n# citus-failover\nWorker failover support for citus community version using pg_auto_failover.\n\n## What is this?\n\nThis is a simple service to monitor changes in a [pg_auto_failover][1] monitor and update workers' addresses in [citus][2] coordinator. The community version of citus does not support failover so you have to update the workers manually in case of a failover.\n\n## How it works?\n\nIt will check both the citus coordinator and pg_auto_failover monitor and if it finds a worker node that is not primary, it will replace it with the primary one.\n\n## Usage\n\nYou need to provide the connection details for both your coordinator and your monitor. Note that the coordinator should also be monitored by pg_auto_failover and you should provide the formation that is responsible for your coordinator, the primary node then will be found and used to update the workers.\n\nYou need to provide a config file. Check [`config.example.yml`][3] for a sample config.\n\n**Monitor**:\nPSQL connection details for your monitor.\n\n**Coordinator**:\nYou need to provide the formation for your coordinator nodes as `Formation` instead of any host. It will be used to find the primary coordinator. \n\n### Run using binaries\n\n```\n./citus-failover -f path/to/config.yml\n```\n\n### Run using docker\n\nCreate a config file somewhere in your host. Then mount the path as `/config` to the container.\n\nMap the port for API if enabled.\n\n```\ndocker run -d -v /config/folder/path:/config -p 3002:3002 navid2zp/citus-failover:latest\n```\n\n## REST API\n\nA simple REST API is available. You can use it to check the state of your nodes. Set `API.Enabled` to `true` in your config file to enable the API. You also need to provide a secret string for the API. Then you'll need to provide this secret string in the header of your requests as `SECRET` to be authenticated and authorized.\n\n\n\nAvailable endpoints:\n\n`/v1/nodes`: List of all the nodes in your monitor.\n\n`/v1/coordinator`: Primary coordinator address.\n\n`/v1/coordinators`: List of all available coordinator nodes.\n\n`v/1/workers`: List of primary worker nodes.\n\n\n[1]: https://github.com/citusdata/pg_auto_failover\n[2]: https://github.com/citusdata/citus\n[3]: https://github.com/Navid2zp/citus-failover/blob/main/config.example.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavid2zp%2Fcitus-failover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavid2zp%2Fcitus-failover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavid2zp%2Fcitus-failover/lists"}