2016-05-14 4 views
1

Хотя феникс-сервер запускается нормально, но я не вижу его в списке приложений на наблюдателе.Приложение не указано в наблюдателе

То, что я сделал это:

elixir -S mix phoenix.server 

И это еще один терминал:

iMac:~ Apple$ iex 
Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] 

Interactive Elixir (1.2.4) - press Ctrl+C to exit (type h() ENTER for help) 
iex(1)> :observer.start 
:ok 

Вот как началось мое приложение:

defmodule Rumbl do 
    use Application 

    # See http://elixir-lang.org/docs/stable/elixir/Application.html 
    # for more information on OTP Applications 
    def start(_type, _args) do 
    import Supervisor.Spec, warn: false 

    children = [ 
     # Start the endpoint when the application starts 
     supervisor(Rumbl.Endpoint, []), 
     # Start the Ecto repository 
     supervisor(Rumbl.Repo, []), 
     # Here you could define other workers and supervisors as children 
     # worker(Rumbl.Worker, [arg1, arg2, arg3]), 
    ] 

    # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html 
    # for other strategies and supported options 
    opts = [strategy: :one_for_one, name: Rumbl.Supervisor] 
    Supervisor.start_link(children, opts) 
    end 

    # Tell Phoenix to update the endpoint configuration 
    # whenever the application is updated. 
    def config_change(changed, _new, removed) do 
    Rumbl.Endpoint.config_change(changed, removed) 
    :ok 
    end 
end 

Наблюдатель: enter image description here

Итак, почему я не вижу его в наблюдателе?

EDIT

Я нажал на Узлах в наблюдателе, а затем «включить распределение», то узлы появился, но как только я выбрал rumbl узел, я получаю сообщение об ошибке:

11:17:11.379 [error] [node: :[email protected], call: {:observer_backend, :sys_info, []}, reason: {:badrpc, :nodedown}] 

хотя узел и работает:

$ elixir --name rumbl -S mix phoenix.server 
[info] Running Rumbl.Endpoint with Cowboy using http on port 4000 
14 May 11:10:33 - info: compiled 5 files into 2 files, copied 3 in 2.9 sec 
[info] GET/
[debug] Processing by Rumbl.PageController.index/2 
    Parameters: %{} 
    Pipelines: [:browser] 
[info] Sent 200 in 104ms 

Я попытался снова выбрал rumbl @ ИМАК, то я получил ошибку:

Child (unknown) crashed exiting: <0.67.0> {{badmatch,{badrpc,nodedown}}, 
              [{observer_app_wx,handle_info,2, 
               [{file,"observer_app_wx.erl"}, 
               {line,283}]}, 
              {wx_object,handle_msg,5, 
               [{file,"wx_object.erl"}, 
               {line,432}]}, 
              {proc_lib,init_p_do_apply,3, 
               [{file,"proc_lib.erl"}, 
               {line,240}]}]} 
iex(2)> 
11:19:56.534 [error] ** wx object server #PID<0.67.0> terminating 
** Last message in was {:active, :[email protected]} 
** When Server state == {:state, #PID<0.59.0>, {:wx_ref, 327, :wxPanel, []}, 
{:wx_ref, 330, :wxListBox, []}, {:wx_ref, 333, :wxScrolledWindow, []}, 
{:paint, {:wx_ref, 342, :wxFont, []}, {:wx_ref, 346, :wxPen, []}, 
    {:wx_ref, 343, :wxBrush, []}, {:wx_ref, 344, :wxBrush, []}, 
    {:wx_ref, 345, :wxPen, []}}, :elixir, 
{:app, 
    {{:box, 16, 47, 57, 23, {:str, 5, 5, '<0.35.0>', #PID<0.35.0>}}, 
    [{{:box, 89, 47, 58, 23, {:str, 5, 5, '<0.36.0>', #PID<0.36.0>}}, 
    [{{:box, 163, 47, 58, 23, {:str, 5, 5, 'elixir_sup', #PID<0.37.0>}}, 
     [{{:box, 237, 12, 103, 23, 
      {:str, 5, 5, 'elixir_code_server', #PID<0.39.0>}}, []}, 
     {{:box, 237, 47, 72, 23, {:str, 5, 5, 'elixir_config', #PID<0.38.0>}}, 
     []}, 
     {{:box, 237, 82, 80, 23, {:str, 5, 5, 'elixir_counter', #PID<0.40.0>}}, 
     []}]}]}]}, :undefined, [], {356, 117}}, :undefined, :undefined, true} 
** Reason for termination == 
** {{:badmatch, {:badrpc, :nodedown}}, 
[{:observer_app_wx, :handle_info, 2, [file: 'observer_app_wx.erl', line: 283]}, 
    {:wx_object, :handle_msg, 5, [file: 'wx_object.erl', line: 432]}, 
    {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]} 


11:19:56.549 [error] GenServer :appmon_info terminating 
** (MatchError) no match of right hand side value: {:badrpc, :nodedown} 
    observer_app_wx.erl:283: :observer_app_wx.handle_info/2 
    wx_object.erl:432: :wx_object.handle_msg/5 
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3 
Last message: {:EXIT, #PID<0.67.0>, {{:badmatch, {:badrpc, :nodedown}}, [{:observer_app_wx, :handle_info, 2, [file: 'observer_app_wx.erl', line: 283]}, {:wx_object, :handle_msg, 5, [file: 'wx_object.erl', line: 432]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}} 
State: {:state, #PID<0.67.0>, [], 20507, [#PID<0.67.0>]} 

Fixed

Когда я включаю "включить распределение", я уже вошел в ту же печенье, используемое в rumbl узле как:

elixir --sname rumbl --cookie secret_token -S mix phoenix.server 

тогда, я выбрал rumbl узел и все приложения перечислены!

ответ

1

Наблюдатель по умолчанию показывает приложения, работающие на том же узле, что и Observer. Запустив сервер с elixir -S ..., а затем запустив :observer.start в новом iex, вы размножаете 2 узла.

Вы можете увидеть данные другого узла, давая, что Узел --name (или --sname):

elixir --name rumbl -S mix phoenix.server 

, а затем выбрать этот узел из меню «Nodes» наблюдателя.

+0

см. EDIT – simo

+0

. Я согласен с ответом, но, пожалуйста, установите cookie рядом с настройками имени, спасибо – simo

Смежные вопросы