visualixir
visualixir copied to clipboard
How to visualize another app?
Hello!
I'm trying to visualize a Elixir 1.6 / Phoenix app I have running in my machine. I launch it like this:
elixir --sname myapp -S mix phx.server
and then I run visualixir like this:
elixir --sname visualixir --hidden -S mix phoenix.server
Then I add the node in the GUI (myapp@holly
) but nothing happens on the GUI. I see this on the logs:
[debug] INCOMING "add" on "nodes" to VisualixirWeb.NodesChannel
Transport: Phoenix.Transports.WebSocket
Parameters: "myapp@holly"
[debug] Pinging node myapp@holly returned :pang
What am I doing wrong?
[debug] Pinging node myapp@holly returned :pang
Does the first node actually return myapp@holly
(or rather in Elixir :"myapp@holly"
) when you run node().
(in Elixir :erlang.node()
)?
If I run iex --sname hello
then I get:
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Interactive Elixir (1.6.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(hello@MacBook-Pro-van-Luc)1>
So my node name would be hello@MacBook-Pro-van-Luc
.
Fill that in when running visualixir and it should work?
What does your terminal show you when running above command?
I start my app with:
iex --sname myapp -S mix phx.server
From iex, the node is:
iex(myapp@holly)2> :erlang.node()
:myapp@holly
I have tried both myapp@holly
and :myapp@holly
and I still get the [debug] Pinging node :myapp@holly returned :pang
log message.
Curious.
From the visualixir iex session, does Node.ping(:"myapp@holly")
also give you :pang
?
I wonder if epmd isn't running for some reason.
From the visualixir iex session, does Node.ping(:"myapp@holly") also give you :pang?
Yes, it takes some seconds to respond, and finally returns :pang
.
It's interesting that it takes a few seconds… it sounds like maybe it's trying to connect to an external host. Does holly
have an entry in /etc/hosts
?
What does epmd -names
give you, with both nodes running?
It's interesting that it takes a few seconds…
5 seconds should be the normal timeout so that makes sense.
What does
epmd -names
give you, with both nodes running?
This is definitely the next step.
Does
holly
have an entry in/etc/hosts
?
No it doesn't. holly
is the name of my computer (OSX).
What does
epmd -names
give you, with both nodes running?
➔ epmd -names
epmd: up and running on port 4369 with data:
name visualixir at port 57596
name myapp at port 57590
I'm a little stumped.
Does nc -w 0 localhost 57596 && echo $?
give you 0
?
Does nc -w 0 localhost 57596 && echo $? give you 0?
No, it doesn't return 0
, it returns $
.
No, it doesn't return
0
, it returns$
.
Uh, echo $?
should return an integral value, and $
is not integral... What shell are you using?
hi, i have the same problem here
I am running on a MacOS Mojave 10.14.4 with elixir/mix 1.8.1 using Zsh (as a shell)
my app is started with elixir --sname myapp -S mix run --no-halt
since it is not using the full phoenix framework, but only Plug, Cowboy and Absinthe
it is discoverable using epmd -names
and nc -w 0 localhost 57596 && echo $?
(using the correct port number) returns 0
I was also having problems on OSX - seems related to this https://github.com/elixir-lang/elixir/issues/3955
I did get it to work doing the following:
- make sure sname has
localhost
elixir --sname visualixir@localhost -S mix phx.server
- same for the second app
iex --sname having_fun@localhost
- manually connect
Node.connect :visualixir@localhost
Once I manually connected, refresh page and the node appears.