[erlang-questions] Command-line for releases
Jesper Louis Andersen
Sun Dec 28 13:19:17 CET 2014
Well, I just adopt the 'ping' command and implement what I miss if the
system needs to be prodded from the outside. A good example is to poke the
system via cron at regular intervals. So I just rewrite the script
appropriately. I think relx nodetool is different, but you will have to dig
that up yourself.
I think 'erl_call' may be an alternative path you can pursue if you want.
The damning way of providing an HTTP POSTable endpoint seems so futile
compared to an internal call IMO, but is is also possible. Or open an ssh
connection to the shell via the ssh application.
On Sun Dec 28 2014 at 12:48:42 PM Roberto Ostinelli <roberto@REDACTED>
> Thank you Jesper!
> Yes indeed, the erlang:memory() call is just an example (I use folsom too
> for real production system monitoring).
> I use rebar for releases, and the ping command just dumps a "pong"
> response. I'm assuming you refer to the RPC command instead, or maybe the
> nodetool generated by relx is different?
> On Sun, Dec 28, 2014 at 12:28 PM, Jesper Louis Andersen <
> jesper.louis.andersen@REDACTED> wrote:
>> I tend to do two things in this area (note relx):
>> Alter the 'myapp' script such that it takes extra commands and execute
>> this command like "ping" is implemented: call nodetool to do rpc towards
>> the node (IIRC it creates a distributed node, connects it to the running
>> node and runs its stuff).
>> But for stats in general, my approach is very different. I use "folsom"
>> to gather statistics. Note that this is gathering, not
>> persisting/storing. Then another application shovels the gathered
>> statistics to a foreign system for historical data and you plot the data.
>> Knowing that your system used 320 megabytes of space now is of little use
>> unless you happen to know what the typical baseline of your system tend to
>> be. So I gather that information for any production system if I can.
>> I'm pretty aggressive in stats gathering. It is not uncommon to have
>> 1000+ probes in a system for me. This is because I firmly believe that you
>> need to measure in order to improve a system.
>>  In a newly deployed system, I would probably check out exometer.
>> On Sun Dec 28 2014 at 12:16:26 PM Roberto Ostinelli <roberto@REDACTED>
>>> Hi all,
>>> Let's say that you have a running node, started from a release command:
>>> $ myapp start
>>> Now, I'd like to check some current stats of the node (for instance,
>>> with erlang:memory/0), but would like to do it with an external script,
>>> i.e. a command-line tool so that it gets printed in the console, like so:
>>> $ myappctl memory
>>> What is your recommended way to have a command-line tool connect to a
>>> release-started erlang node to issue a command and return a value?
>>> There are many ways, I'd like to hear some recommendations.
>>> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions