【问题标题】:phoenix framework deployment issue凤凰框架部署问题
【发布时间】:2016-05-08 01:41:24
【问题描述】:

我正在尝试使用 exrm 和 conform 部署 Phoenix 应用程序。在本地 Ubuntu 上测试该版本有效。但是当我在服务器上运行相同时,就会失败。我无法理解确切的原因。

{error_logger,{{2016,1,30},{7,45,44}},"协议:~tp:注册/监听错误:~tp~n",["inet_tcp",etimedout]} {error_logger,{{2016,1,30},{7,45,44}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,} ,{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,344}]},{proc_lib, init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}},{ancestors,[net_sup,kernel_sup,]},{messages,[]},{链接,[#Port,]},{字典,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,987},{stack_size, 27},{减少,842}],[]]} {error_logger,{{2016,1,30},{7,45,44}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution} },{offender,[{pid,undefined},{id,net_kernel},{mfargs,{net_kernel,start_link,[['app@127.0.0.1',longnames]]}},{restart_type,permanent},{shutdown ,2000},{child_type,worker}]}]} {error_logger,{{2016,1,30},{7,45,44}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,{shutdown,{failed_to_start_child,net_kernel ,{'EXIT',nodistribution}}}},{offender,[{pid,undefined},{id,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,无穷大},{child_type,supervisor}]}]} {error_logger,{{2016,1,30},{7,45,44}},crash_report,[[{initial_call,{application_master,init,['Argument__1','Argument__2','Argument__3','Argument__4'] }},{pid,},{registered_name,[]},{error_info,{exit,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution} }}}},{kernel,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,134}]},{proc_lib,init_p_do_apply ,3,[{file,"proc_lib.erl"},{line,240}]}]}},{ancestors,[]},{messages,[{'EXIT',,normal}]},{links,[,]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,376}, {stack_size,27},{reductions,117}],[]]} {error_logger,{{2016,1,30},{7,45,44}},std_info,[{application,kernel},{exited,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel, {'EXIT',nodistribution}}}}},{kernel,start,[normal,[]]}}},{type,permanent}]} {"内核 pid 终止",application_controller,"{application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{kernel,start,[正常,[]]}}}"}

故障转储正在写入:erl_crash.dump...内核 pid 终止 (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',没有分布}}}}},{k

【问题讨论】:

    标签: elixir phoenix-framework conform exrm


    【解决方案1】:

    错误原因一般在第一行error和crashdump:

    {error_logger,{{2016,1,30},{7,45,44}},"Protocol: ~tp: register/listen error: ~tp~n",["inet_tcp",etimedout]}...
    
    ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}}...
    

    在启动期间打开侦听套接字时出现错误,超时etimedout。这可能是由以下几件事引起的:

    • 您的应用程序已经在运行,您不能两次打开同一个端口,
    • 有防火墙限制 - 检查 iptables,尤其是端口 4369(Erlang 端口映射器守护程序)
    • 您的应用没有权限打开该端口

    iex 使用dev 环境启动您的应用程序,而exrm 使用prod。 比较您的 devprod 设置。可能定义了不同的端口。尝试使用iex 运行您的应用,但使用prod 环境。

    MIX_ENV=prod iex -S mix phoenix.server
    

    请记住,生成的版本具有在创建期间评估和硬编码的所有配置值。

    【讨论】:

    • iptables 问题。我已经添加了端口,但没有重新启动 iptables
    • 非常彻底的答案@tkowal!赞一个!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多