how can i attach nodes which started with sname(shortnames)?

I have started my napplication node with sname,

iex --sname gateway --cookie erlang -S mix phx.Server

I started livebook in mac m1 and i want to attach gateway@jerry, but throw the following error

Connecting runtime failed - node :"gateway@zhangchao-mini" is unreachable

I have check the following setting with hostname

scutil --get HostName

I have checked the livebook’s pull request and Support setting node name/sname using environment vars by zachallaun · Pull Request #1672 · livebook-dev/livebook · GitHub ,but it has changed a lot, what can i do to attach the sname node

Hey @jerry-chao! Livebook now always uses long names distribution, so in order to connect, you need to start your app as:

iex --name gateway@127.0.0.1 --cookie erlang -S mix phx.server

For more details see Always run distribution in long names mode by jonatanklosko · Pull Request #2646 · livebook-dev/livebook · GitHub .

2 Likes