{"id":15010088,"url":"https://github.com/pertsevds/dns_srv_cluster","last_synced_at":"2025-04-09T17:53:43.829Z","repository":{"id":204544061,"uuid":"712114717","full_name":"pertsevds/dns_srv_cluster","owner":"pertsevds","description":"Elixir clustering with DNS SRV records","archived":false,"fork":false,"pushed_at":"2025-03-18T11:15:12.000Z","size":80,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T12:25:26.627Z","etag":null,"topics":["elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/pertsevds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-10-30T20:22:54.000Z","updated_at":"2025-03-18T11:15:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0bf49a6-81eb-4fa8-8acb-72d72424ce17","html_url":"https://github.com/pertsevds/dns_srv_cluster","commit_stats":null,"previous_names":["pertsevds/dns_srv_cluster"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pertsevds%2Fdns_srv_cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pertsevds%2Fdns_srv_cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pertsevds%2Fdns_srv_cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pertsevds%2Fdns_srv_cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pertsevds","download_url":"https://codeload.github.com/pertsevds/dns_srv_cluster/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248083536,"owners_count":21045118,"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":["elixir"],"created_at":"2024-09-24T19:29:59.702Z","updated_at":"2025-04-09T17:53:43.789Z","avatar_url":"https://github.com/pertsevds.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DNSSRVCluster\n\nElixir clustering with DNS SRV records.\n\n---\n\n[![CI](https://github.com/pertsevds/dns_srv_cluster/actions/workflows/ci.yml/badge.svg)](https://github.com/pertsevds/dns_srv_cluster/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/pertsevds/dns_srv_cluster/badge.svg?branch=main)](https://coveralls.io/github/pertsevds/dns_srv_cluster?branch=main)\n[![Hex.pm License](https://img.shields.io/hexpm/l/dns_srv_cluster)](https://hex.pm/packages/dns_srv_cluster)\n[![Hex.pm Version](https://img.shields.io/hexpm/v/dns_srv_cluster)](https://hex.pm/packages/dns_srv_cluster)\n[![Hex.pm Docs](https://img.shields.io/badge/hex-docs-lightgreen)](https://hexdocs.pm/nbpm)\n[![Hex.pm Downloads](https://img.shields.io/hexpm/dt/dns_srv_cluster)](https://hex.pm/packages/dns_srv_cluster)\n\n## Installation\n\nThe package can be installed by adding `dns_srv_cluster` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:dns_srv_cluster, \"~\u003e 0.3.0\"}\n  ]\nend\n```\n\nAdd to your DNS zone your SRV record (https://en.wikipedia.org/wiki/SRV_record):\n\n```sh\n_app._tcp.yourdomain.com. 60 IN SRV 0 10 1234 node1.yourdomain.com.\n_app._tcp.yourdomain.com. 60 IN SRV 0 10 1234 node2.yourdomain.com.\n_app._tcp.yourdomain.com. 60 IN SRV 0 10 1234 node3.yourdomain.com.\n_app._tcp.yourdomain.com. 60 IN SRV 0 10 1234 node4.yourdomain.com.\n```\n\nAdd to your config files (`config/prod.exs`, `config/dev.exs`):\n\n```elixir\nconfig :dns_srv_cluster,\n  query: \"_app._tcp.yourdomain.com\"\n```\n\nAdd this to your `rel/env.sh.eex`:\n\n```sh\nexport RELEASE_DISTRIBUTION=\"${RELEASE_DISTRIBUTION:-\"name\"}\"\nexport RELEASE_NODE=\"${RELEASE_NODE:-\"\u003c%= @release.name %\u003e\"}\"\n```\n\nBy default, nodes from the same release will have the same cookie. If you want different\napplications or releases to connect to each other, then you must set the `RELEASE_COOKIE`,\neither in your deployment platform or inside `rel/env.sh.eex`:\n\n```sh\nexport RELEASE_COOKIE=\"my-app-cookie\"\n```\n\n## Configuration options\n\n  * `query` - your DNS SRV record, for example: \"_app._tcp.yourdomain.com\".\n  * `interval` - the millisec interval between DNS queries. Defaults to `5_000`.\n  * `connect_timeout` - the millisec timeout to allow discovered nodes to connect. Defaults to `10_000`.\n\n\n## If you want it in your supervision tree\n\nDo in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:dns_srv_cluster, \"~\u003e 0.3.0\", runtime: false}\n  ]\nend\n```\n\n`runtime: false` will block application from starting.\n\nAnd use `DNSSRVCluster.Worker` as a child:\n\n```elixir\nchildren = [\n  {DNSSRVCluster.Worker, query: \"_app._tcp.yourdomain.com\"}\n]\n\n{:ok, pid} = Supervisor.start_link(children, strategy: :one_for_one)\n```\n\n## Support Matrix\n\nTests automatically run against a matrix of OTP and Elixir Versions, see the [ci.yml](https://github.com/pertsevds/dns_srv_cluster/tree/main/.github/workflows/ci.yml) for details.\n\n| OTP \\ Elixir | 1.15 | 1.16 | 1.17 | 1.18 |\n|:------------:|:----:|:----:|:----:|:----:|\n| 24           | ✅  | ✅  | N/A  | N/A  |\n| 25           | ✅  | ✅  | ✅  | ✅  |\n| 26           | ✅  | ✅  | ✅  | ✅  |\n| 27           | N/A  | N/A  | ✅  | ✅  |\n\n## Documentation\n\nDocumentation can be found at \u003chttps://hexdocs.pm/dns_srv_cluster\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpertsevds%2Fdns_srv_cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpertsevds%2Fdns_srv_cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpertsevds%2Fdns_srv_cluster/lists"}