Skip to content

Latest commit

 

History

History
86 lines (63 loc) · 2.08 KB

README.md

File metadata and controls

86 lines (63 loc) · 2.08 KB

Overview

EPMD server - library and CLI parts in one jar.

Usage

As application

Run it as a regular Java CLI app:

$> java -jar epmd-2.0.2.jar server
2019-03-17 01:38:09.302  INFO : EPMD server started (debug: false, port: 4369, allowed-ips: [localhost/127.0.0.1], unsafe-commands: true)

To get names of all registered nodes:

$> java -jar epmd-2.0.2.jar names
2019-03-17 01:45:39.310  INFO : EPMD up and running on port 4369 with the registered node(s):
 - node 'echo' at port 60045

To see another options and commands, just type:

$> java -jar epmd-2.0.2.jar --help
Usage: epmd [-dhV] [-p=PORT] [COMMAND]

Erlang port mapper daemon. This is a small name server used by Erlang programs
when establishing distributed Erlang communications.

Options:
  -p, --port=PORT   Let epmd listen to another port than default 4369. This can also
                      be set using environment variable ERL_EPMD_PORT
  -d, --debug       Enables debugging logs
  -h, --help        Show this help message and exit.
  -V, --version     Print version information and exit.

Commands:
  help    Displays help information about the specified command
  names   Lists names registered with the currently running epmd.
  server  Starts the epmd server.
  stop    Forcibly unregisters a live node from the epmd database.
  kill    Kills the currently running epmd.

Run 'epmd help COMMAND' for more information on a command.

As library

Maven:

<dependencies>
    ...
    <dependency>
        <groupId>io.appulse.epmd.java</groupId>
        <artifactId>server</artifactId>
        <version>2.0.2</version>
    </dependency>
    ...
</dependencies>

Gradle:

compile 'io.appulse.epmd.java:server:2.0.2'

To start EPMD server in your code:

import io.appulse.epmd.java.server.SubcommandServer;
// ...
val server = SubcommandServer.builder()
    .port(6666) // if not set, default is 4369
    .ip(SubcommandServer.ANY_ADDRESS) // if not set, default is LOOPBACK
    .build();

server.run(); // it starts the server and blocks the current thread
// ...