<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">1. 在A进程之上再弄个D进程,监控A的心跳.<br>
      2. A,D都跑同样的gl,之间共享数据(加个rabbitmq或者mneniz),又相互监控<br>
      <br>
                                                                 王炜<br>
      于 2013/1/9 12:08, 郎咸武 写道:<br>
    </div>
    <blockquote
cite="mid:CAPg1=3NF1FmU-OUDZqw8GuyczAPrZUJJ8JcpSMZ4CqVS8vuVHQ@mail.gmail.com"
      type="cite">假如有三台服务器A,B,C做一个集群。
      <div>在其中A 服务器上运行下面代码。</div>
      <div>这是 三台服务器都能使用 gl进程发送消息。</div>
      <div><br>
      </div>
      <div><b>问题是: </b>A 服务器挂掉后,B和C 两台服务器都不能正常使用.</div>
      <div><br>
      </div>
      <div>请问有什么好的方法避免这个问题?</div>
      <div>
        <div><br>
        </div>
        <div>谢谢各位</div>
        <div>
          <br>
        </div>
        <div>郎咸武</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>
          <div>  1 -module(global_t).                                  
                                                                       
                                                                       
                                               </div>
          <div>  2 </div>
          <div>  3 -compile(export_all).</div>
          <div>  4 </div>
          <div>  5    </div>
          <div>  6 start() -></div>
          <div>  7     Pid = spawn(?MODULE, loop, []),</div>
          <div>  8     global:register_name(gl, Pid). </div>
          <div>  9 </div>
          <div> 10 </div>
          <div> 11 loop() -></div>
          <div> 12     io:format("loop~n", []),</div>
          <div> 13     receive </div>
          <div> 14         {Pid,Any} -></div>
          <div> 15             io:format("~p~n", [{Pid,Any}]),</div>
          <div> 16             Pid ! okss,</div>
          <div> 17             loop()</div>
          <div> 18     end.</div>
          <div> 19 </div>
          <div> 20 </div>
          <div> 21     </div>
          <div>~                                                        
                                                                       
                                                                       
                                              </div>
          <div>~                                                        
                                                                       
                                                                       
                                              </div>
          <div>~                   </div>
        </div>
        -- <br>
        只为成功找方法,不为失败找理由
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>