3

1.次を使用してアプリを実行しようとしている場合:

# ./rebar clean compile generate
# rel/master/bin/master console

次のエラーが表示されます。

application: app_name
exited:{shutdown,{app_name}, start, [normal, []]}}
type:permanent
{"kernel pid terminated", application_controler, "{application_start_failure,app_name 
..........

そのため、アプリケーションを開始できません。

2. しかもビルドリリース直後

# rel.... start
# rel.... stop

エラーが発生します: 「ノード master@127.0.0.1 が ping に応答しません」

その間

# rel.... stop <- the same error as above
# rel.... start
# rel.... stop <- is fine (outputs "ok")

アプリの構造:

deps ebin rebar rebar.config src rel

rebar.config

{erl_first_files, []}.
{cover_enabled, true}.
{erl_opts, [debug_info]}.
{sub_dirs, ["rel"]}.
{deps_dir, ["deps]}.
{deps, [some_stable_modules_from_github]}.

reltool.config (relフォルダーから)

{sys, [
     {lib_dirs, ["../..", "../deps"]},
     {rel, "master", "1",
        [app_name, 
         kernel,
         stdlib,
         stdlib,
         sasl,
         some_stable_modules]},
     {rel, "start_clean", "", [kernel, stdlib]},
     {boot_rel, "master"},
     {profile, embedded},
     {excl_sys_filters, ["^bin/.*", "^erts.*/bin/{dialyzer|typer)"])},
     {app, sasl, ["incl_cond", include]},
     {app, hipe, ["incl_cond", exclude]},
     {app, some_stable_module, ["incl_cond", include]},
     {app, master, ["incl_cond", include]}
   ]}.

{target_dir, "master"}.

{overlay, [
          {mkdir, "log/sasl"},
          {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
          {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
          {copy, "files/master", "bin/master"},
          {copy, "files/app.config", "etc/app.config"},
          {copy, "files/vm.args", "etc/vm.args"}
          ]}.

2 つの質問:

  1. を使用してアプリケーションを起動できるのはなぜrel/master/bin/master consoleですか?

  2. 「ノードが ping に応答していません」というエラーが表示されるのはなぜですか?

ありがとう!

PS。一般的には、rebar を使用して作成される基本的なアプリケーションです。mongodb で動作するモジュールをいくつか追加しました。

4

1 に答える 1

1

reltool.config から、app_name アプリケーションがリリースに含まれていないようです。次のことを確認してください。

{app, app_name, ["incl_cond", include]},

ある。それでも問題が解決しない場合は、アプリケーションを手動で起動してみてください。例えば:

erl -pa ebin deps/whatever/ebin ...
> application:start(app_name).

これにより、リリースで何が間違っているか、何が欠けているかのヒントが得られるはずです。

更新: アプリケーションを手動で起動できない場合は、デバッグしてみてください。アプリケーション モジュールでルート スーパーバイザを起動すると仮定すると、スーパーバイザを手動で起動するとどうなりますか? .app/.app.src ファイルを投稿していただけますか? アプリケーションモジュールからの開始機能? スーパーバイザーからの最終的な start_link 関数は?

PS: reltool.config に 2 つの「stdlib」エントリがあります。

于 2012-07-16T09:29:56.693 に答える