Search code examples
elixirremote-accesselixir-iex

Why won't iex connect a remote shell?


Background: we have a production push server in an environment and want to move it to another environment. To do this we installed the new server and then copied the content over. I'm worried that something that got copied needs to be edited but I can't figure out what.

Elixir 1.10.1 I think.

I start up iex using the push_server start_iex script which ends up doing:
/var/www/push_server/releases/0.6.2/iex --cookie 3NEQTAUBMGBZPSFEWWTGFUNUKWVKBAS5VD3TBC3HZYXI7CIMNJRA==== --sname push_server --erl '-mode embedded' --erl-config /var/www/push_server/tmp/push_server-0.6.2-20230630162707-579c.runtime --boot /var/www/push_server/releases/0.6.2/start --boot-var RELEASE_LIB /var/www/push_server/lib --vm-args /var/www/push_server/releases/0.6.2/vm.args --werl

I then try to run a second session with a remote console (push_server remote), which ends up doing this:
/var/www/push_server/releases/0.6.2/iex --cookie 3NEQTAUBMGBZPSFEWWTGFUNUKWVKBAS5VD3T3HZYXI7CIMNJRA==== --sname rem-c8cc-push_server --remsh push_server --boot /var/www/push_server/releases/0.6.2/start_clean --boot-var RELEASE_LIB /var/www/push_server/lib

The result is:

Erlang/OTP 23 [erts-11.0.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

Could not contact remote node push_server@emtpush, reason: :nodedown. Aborting...

I have the same cookie in both commands. If I run node in the first session it gives me the node name that the second session says is down. The same command for the second shell works fine on the existing production server (thus my concern that there may be something that has been copied and pasted and needs to be edited).

I also tried specifying the remsh as push_server@emtpush, [email protected] and push_server@localhost. The IP address complained that the system is not set to use fully qualified hostnames, and the other two failed with the same error message (but in the latter case with emtpush replaced by localhost).

Is there anything obviously wrong here?

What other data can I analyze to try to find an answer?


Solution

  • It turns out that I could edit the env.sh file under the releases directory and uncomment the lines

    export RELEASE_DISTRIBUTION=name
    export [email protected]
    

    I'm not sure why this is necessary on the new server and wasn't on the old, but I'm happy to proceed.