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

tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
mcrumm
If you would like to migrate away from node/npm/webpack while still using sass, the dart_sass package provides a installer and runner for...
New
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
Jskalc
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue. It’s a seamless integration of Vue and Phoenix LiveView, i...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

Sub Categories:

We're in Beta

About us Mission Statement