{"id":13707131,"url":"https://github.com/nanopack/yoke","last_synced_at":"2025-09-28T11:31:07.828Z","repository":{"id":44419970,"uuid":"45634141","full_name":"nanopack/yoke","owner":"nanopack","description":"Postgres high-availability cluster with auto-failover and automated cluster recovery.","archived":true,"fork":false,"pushed_at":"2016-01-07T00:37:05.000Z","size":13378,"stargazers_count":1344,"open_issues_count":10,"forks_count":64,"subscribers_count":77,"default_branch":"master","last_synced_at":"2024-11-15T10:59:46.670Z","etag":null,"topics":["auto-failover","availability-cluster","cluster","golang","nanobox","nanopack","postgres","redundancy"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nanopack.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":"2015-11-05T19:26:45.000Z","updated_at":"2024-10-22T18:34:57.000Z","dependencies_parsed_at":"2022-07-15T15:00:58.454Z","dependency_job_id":null,"html_url":"https://github.com/nanopack/yoke","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopack%2Fyoke","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopack%2Fyoke/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopack%2Fyoke/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanopack%2Fyoke/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanopack","download_url":"https://codeload.github.com/nanopack/yoke/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234512396,"owners_count":18844842,"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":["auto-failover","availability-cluster","cluster","golang","nanobox","nanopack","postgres","redundancy"],"created_at":"2024-08-02T22:01:20.914Z","updated_at":"2025-09-28T11:31:07.480Z","avatar_url":"https://github.com/nanopack.png","language":"Go","funding_links":[],"categories":["Go","Compiled list","Utilities"],"sub_categories":["plv8:"],"readme":"[![yoke logo](http://nano-assets.gopagoda.io/readme-headers/yoke.png)](http://nanobox.io/open-source#yoke)\n[![Build Status](https://travis-ci.org/nanopack/yoke.svg)](https://travis-ci.org/nanopack/yoke)\n\nYoke is a Postgres redundancy/auto-failover solution that provides a high-availability PostgreSQL cluster that's simple to manage.\n\n\n### Requirements\n\nYoke has the following requirements/dependencies to run:\n\n- A 3-server cluster consisting of a 'primary', 'secondary', and 'monitor' node\n- 'primary' \u0026 'secondary' nodes need ssh connections between each other (w/o passwords)\n- 'primary' \u0026 'secondary' nodes need rsync (or some alternative sync_command) installed\n- 'primary' \u0026 'secondary' nodes should have postgres installed under a postgres user, and in the `path`. Yoke tries calling 'postgres' and 'pg_ctl'\n- 'primary' \u0026 'secondary' nodes run postgres as a child process so it should not be started independently\n\nEach node in the cluster requires its own config.ini file with the following options (provided values are defaults):\n\n```ini\n[config]\n# the IP which this node will broadcast to other nodes\nadvertise_ip=\n# the port which this node will broadcast to other nodes\nadvertise_port=4400\n# the directory where postgresql was installed\ndata_dir=/data\n# delay before node decides what to do with postgresql instance\ndecision_timeout=30\n# log verbosity (trace, debug, info, warn error, fatal)\nlog_level=warn\n# REQUIRED - the IP:port combination of all nodes that are to be in the cluster (e.g. 'role=m.y.i.p:4400')\nprimary=\nsecondary=\nmonitor=\n# SmartOS REQUIRED - either 'primary', 'secondary', or 'monitor' (the cluster needs exactly one of each)\nrole=\n# the postgresql port\npg_port=5432\n# the directory where node status information is stored\nstatus_dir=./status\n# the command you would like to use to sync the data from this node to the other when this node is master\nsync_command=rsync -ae \"ssh -o StrictHostKeyChecking=no\" --delete {{local_dir}} {{slave_ip}}:{{slave_dir}}\n\n[vip]\n# Virtual Ip you would like to use\nip=\n# Command to use when adding the vip. This will be called as {{add_command}} {{vip}}\nadd_command=\n# Command to use when removing the vip. This will be called as {{remove_command}} {{vip}}\nremove_command=\n\n[role_change]\n# When this nodes role changes we will call the command with the new role as its arguement '{{command}} {{(master|slave|single}))'\ncommand=\n```\n\n\n### Startup\nOnce all configurations are in place, start yoke by running:\n\n```\n./yoke ./primary.ini\n```\n\n**Note:** The ini file can be named anything and reside anywhere. All Yoke needs is the /path/to/config.ini on startup.\n\n\n### Yoke CLI - yokeadm\n\nYoke comes with its own CLI, yokeadm, that allows for limited introspection into the cluster.\n\n#### Building the CLI:\n\n```\ncd ./yokeadm\ngo build\n./yokeadm\n```\n\n##### Usage:\n\n```\nyokeadm (\u003cCOMMAND\u003e:\u003cACTION\u003e OR \u003cALIAS\u003e) [GLOBAL FLAG] \u003cPOSITIONAL\u003e [SUB FLAGS]\n```\n\n##### Available Commands:\n\n- list   : Returns status information for all nodes in the cluster\n- demote : Advises a node to demote\n\n### Documentation\n\nComplete documentation is available on [godoc](http://godoc.org/github.com/nanopack/yoke).\n\n\n### Licence\n\nMozilla Public License Version 2.0\n\n[![open source](http://nano-assets.gopagoda.io/open-src/nanobox-open-src.png)](http://nanobox.io/open-source)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanopack%2Fyoke","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanopack%2Fyoke","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanopack%2Fyoke/lists"}