Starting an Erlang node in embedded mode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Starting an Erlang node in embedded mode

Andrew Haine
Is there any way to start my application on an Erlang node in embedded start up? 

I receive the following output in log/erlang.log.1:

=PROGRESS REPORT==== 3-Feb-2018::08:08:10 ===
         application: myapplication
          started_at: nonode@nohost

I've tried a bunch of things to change that:
sys.config
myapplication.app

but have not had any luck.

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Starting an Erlang node in embedded mode

Xavier Noria
Is that application part of a release, whose scripts are starting up the node in embedded mode?


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Starting an Erlang node in embedded mode

Andrew Haine
Hi Xavier

I have done the following:

 Creating a Release Package
=> systools:make_script("myapp_rel-1").
=> systools:make_tar("myapp_rel-1").

Creating a Target System
- Start Erlang/OTP from the directory where the mysystem.rel file resides: (which is in the "releases" folder)
  => erl -pa /home/user/myapplication/myapp -1.0/ebin
- Create the target system:
  => target_system:create("myapp_rel-1").

Installing a Target System
=> target_system:install("myapp_rel-1", "/usr/local/myapplication/myapp").

Start Target System from OS:
=>/usr/local/myapplication/myapp/bin/start

It starts successfully and works as expected except for the fact that it doesn't start on an actual named node, e.g [hidden email], it always starts on nonode@nohost.

The intention for this app is to be started by the OS at boot time, perhaps via /etc/init.d, and it needs to be on its own node. 

On Mon, Feb 5, 2018 at 11:17 AM, Xavier Noria <[hidden email]> wrote:
Is that application part of a release, whose scripts are starting up the node in embedded mode?



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Starting an Erlang node in embedded mode

Xavier Noria
So the question is how to give a node a name when launched with a release script?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Starting an Erlang node in embedded mode

Andrew Haine
Correct.

On Mon, Feb 5, 2018 at 1:37 PM, Xavier Noria <[hidden email]> wrote:
So the question is how to give a node a name when launched with a release script?


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Starting an Erlang node in embedded mode

Xavier Noria
If the release was generated with rebar3, there is a standard file called vm.args where you can set the node name and other VM stuff.

That is a release generated by hand with target_system. I generated a sample one and, as you, I don't see anything equivalent to vm.args.

In the generated scripts it seems that the last call ends up passing "$@", have you tried passing -name to start?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions