For using :observer.start i’m looking for a way to connect from my development machine to a remote node through ssh with proxy. Because the domain we use it only for internal use on our server platform.
When we where using -sname when starting the server I was able to connect to the remote host.
Before with sname I was able to make it work by doing
epmd -names on the remote
Port in epmd -names around localhost
ssh -L4369:localhost:4369 -L39974:localhost:39974 firstname.lastname@example.org
Then locally I did
iex --sname debug --cookie cookie -S mix
But with name even when adding both
node2 and node2.host.example in host file
iex --name debug --cookie cookie -S mix
when I do Node.connect(:“email@example.com”) it fails.
If I understand you right, you used the first line to start IEX and the second inside of iex? Well, if you had posted the errormessage you got, it would probably tell, that either :sname is not a known node, or that you used another name when testing it…
When using shortnames, you need to Node.connect(:"edge@node2") and the FQDN when using long_names, at least if I recall correctly.
When using longnames, of course you have to use longnames, eg: :"firstname.lastname@example.org".
The last time I had to work with distributed Nodes, I was able to simply use the IP-addresses in the host part as in :"email@example.com". I’m not sure though if I had to start them with a certain argument to make it work or if that works automatically.
Are the names of your nodes also with @127.0.0.1 or do they use firstname.lastname@example.org.
Because when I start I do see my local client, in epmd -names on the server
name observer at port 33388
name node at port 33388
But when I try to connect with Node.connect(:"email@example.com") on my local machine it gives false
And if I use the remsh it returns
Could not contact remote node firstname.lastname@example.org, reason: :nodedown
I start them explicitly with the machine name of 127.0.0.1 so I do not accidentally even expose them outside the machine (further reinforced by iptables and SELinux). All my connections are done over SSH tunnels.
@minhajuddin and @OvermindDL1, this also means one has to install gtk/wx/other x-related things on the to-be-observed machine, right?
I am asking because my releases are currently running mostly on amazon linux without any x dependencies installed and I would like to use something like observer too to have some more tools for investigating issues.
@OvermindDL1 would you be able to share in more details what exactly needs to be set up to make this work?
I’ve been able to follow along with this guide to connect through an SSH tunnel, but it involves:
a lot of manual typing
hard-coded values that you need to look up again, as storing ports and the production cookie in a shell script seem like a very bad (insecure) idea.
What exactly do the X11-forwarding settings do? Are they part of the server SSH settings or your local machine’s? Does the server’s ERTS contain :observer, or is this not required when you remsh through the SSH tunnel?
Correct! Just enable X11 forwarding on the server, connect to it via ssh username@serveraddress -X then just use the distillery script to connect a shell to it then :observer.start() starts right up sending to the local system via the X11 protocol. It’s really easy once you get used to it, and it really is that simple.