Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alisinabh/libcluster_yasd

YASD strategy implementation for libcluster. YASD is a minimal service discovery service.
https://github.com/alisinabh/libcluster_yasd

Last synced: about 2 months ago
JSON representation

YASD strategy implementation for libcluster. YASD is a minimal service discovery service.

Awesome Lists containing this project

README

        

# YASD Strategy for libcluster

This is the [YASD](https://github.com/alisinabh/yasd) strategy implementation for libcluster to join Erlang nodes.

## Installation

Add `:libcluster_yasd` to you deps:

```elixir
def deps do
[
{:libcluster_yasd, "~> 0.1.0"}
]
end
```

The docs can be found at [https://hexdocs.pm/libcluster_yasd](https://hexdocs.pm/libcluster_yasd).

## Usage

Make sure your application is started with correct node name.
Node name should be in format of `{app_name}@{node_ip}` for example `:"[email protected]"`.

To start your app with the correct node name you can use `--name` switch. Example:
```
elixir --name "[email protected]" --cookie "secret_cookie" -S mix run --no-halt
```

NOTE: **All nodes should have the same cookie in order to connect**

```elixir
topologies = [
my_yasd: [
strategy: ClusterYASD.Strategy,
config: [
base_url: "http://yaasd:4001"
]
]
]
```
And finally add it to your supervision tree.

```elixir
{Cluster.Supervisor, [topologies, [name: MyApp.ClusterSupervisor]]}
```

## What is YASD?

Your can learn more about YASD on its github page [github.com/alisinabh/yasd](https://github.com/alisinabh/yasd).

## License

MIT