pertsevds

pertsevds

Nbpm - Simplifying Node Name to Port Mapping in Elixir

I grew tired of EPMD and made myself a module that converts node names to ports.

With Nbpm you don’t need EPMD daemon. No additional daemons, no additional configs. Easy and simple distribution without EPMD.

Key Features:

1. No additional daemon required

Does not start EPMD or any other service that needs to listen on any port, so you don’t need to add additional firewall rules to grant access to it.

2. Mix.Release compatibility

Nbpm effortlessly integrates with Mix releases, ensuring smooth production deployments. When you run "your_app remote" or "your_app rpc" commands, Nbpm automatically generates random port assignments, simplifying deployment.

3. Node Name to Port Number Mapping

Nbpm provides flexible methods for mapping node names to port numbers:

  • Last Up to 5 Digits: If your node name ends with digits, Nbpm extracts the last up to 5 digits as the port number. For example, if your node name is “my_node12345,” Nbpm assigns port 12345.
  • Special Prefixes: Node names starting with “rem-” or “rpc-” prompt Nbpm to assign random ports, ensuring compatibility with Mix releases.
  • Hash-Based Port: In the absence of the above conditions, Nbpm employs the :erlang.phash2 function to hash the node name, using the resulting hash as the port number. This approach guarantees consistent name-to-port mappings across different machine architectures and ERTS versions.

If anyone is interested, give it a try:

First Post!

pertsevds

pertsevds

Version 0.3.0 released.

Added Mix task to get port number from node name.

Where Next?

Popular in Libraries Top

Qqwy
Solution is a library to help you with working with ok/error-tuples in case and with-expressions by exposing special matching macros, as ...
New
cjen07
parameterized pipe in elixir: |n> edit: negative index in |n> and mixed usage with |> are supported example: use ParamP...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 13801 100
New
marcuslankenau
I feel kind of stuck with the absence of a proper xml library for Elixir. Currently I use SweetXML which was ok for me more or less to pa...
New
sabiwara
Dune is a sandbox for Elixir and aims to safely evaluate user-provided code. You can try it out using this basic Elixir playground made ...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
woutdp
Hi! I wanted to introduce my latest project LiveSvelte. It allows you to render Svelte inside LiveView with end-to-end reactivity. It’s ...
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New
handnot2
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application. This library uses Erlang esaml to provide plug enabl...
New

Other popular topics Top

Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement