-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problems with inets on startup #2
Comments
When starting a node not in a distributed setting, I'm able to interact with consulate no problem: > iex -S mix
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [dtrace]
Compiling 1 file (.ex)
Interactive Elixir (1.12.2) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :consulate.start_link
[debug] consulate:start_link()
{:ok, #PID<0.388.0>}
iex(2)> :consulate_client.list_local_services
[debug] consulate:get('/v1/agent/services') -> 'http://127.0.0.1:8500/v1/agent/services?'
{:ok,
%{
"_nomad-client-s6pxrvnmilluqd6pbwhivrfgoxn6y2bp" => %{
"Address" => "127.0.0.1",
"Datacenter" => "dc1",
# ..etc
iex(3)> :consulate.register_node("asdf", 1234)
[debug] consulate:register_node("asdf", 1234)
[debug] consulate:put('/v1/agent/service/register', %{
Check: %{
DeregisterCriticalServiceAfter: "60s",
Interval: "10s",
Name: "Check Erlang Distribuition Port",
Status: "passing",
TCP: "localhost:1234"
},
EnableTagOverride: false,
ID: "asdf",
Meta: %{},
Name: "erlang-service",
Port: 1234
}) -> 'http://127.0.0.1:8500/v1/agent/service/register?' @ "{\"Check\":{\"DeregisterCriticalServiceAfter\":\"60s\",\"Interval\":\"10s\",\"Name\":\"Check Erlang Distribuition Port\",\"Status\":\"passing\",\"TCP\":\"localhost:1234\"},\"EnableTagOverride\":false,\"ID\":\"asdf\",\"Meta\":{},\"Name\":\"erlang-service\",\"Port\":1234}"
{:ok, 1} |
When running the app with mix with
When running in a release, I see that some of the required modules (inets, httpc, and consulate) are loaded, but I can't find inet_tcp in the list of loaded modules (or maybe they are always loaded with kernel?). |
If I add
This seems to mean that |
I will take a look. Thanks for detailed report. |
It seems the module is started during kernel startup and so things like |
Hi!
I've followed the steps outlined in elixirforum post but unfortunately I couldn't get the app to start in s distributed setting with consulate.
If I use a command similar to the one on the forum,
ERL_FLAGS="-epmd_module consulate -start_epmd false" iex --sname foo -S mix phx.server
I get
consulate:start_link/0
undefined error:even though I've already ran
mix deps.compile
and I have_build/dev/lib/consulate/ebin
available.And when using
-pa
option as well with path to consulate ebin, the error becomes different:ERL_FLAGS="-epmd_module consulate -start_epmd false -pa _build/dev/lib/consulate/ebin" iex --sname foo -S mix phx.server
which seems to be coming from https://github.com/erlang/otp/blob/81c6d94625a04f6550e77a068489ca6378cabfee/lib/kernel/src/net_kernel.erl#L1811, which seems like a problem with loading inet_tcp / inet_tcp_dist modules.
I wonder if you could give any hints / pointers for where I could look to resolve these problems?
Repro: https://github.com/ruslandoga/try-consulate
Relevant commit: ruslandoga/try-consulate@dc51789
Versions used:
The text was updated successfully, but these errors were encountered: