2015-02-06 36 views
1

我們有一個ActivePivot多維數據集,它是一個多態多維數據集(2個節點),其中1個節點本身是一個水平分佈的多維數據集(8個節點)。在使用JGroup TCP進行分發的Tomcat中運行。它每天都會重新啓動,但每次關閉時(節點服務都按順序停止),日誌中會顯示各種錯誤。這是無害的,但從監測的角度來看卻是令人厭煩的。如何幹淨關閉分佈式ActivePivot設置?

從第一天(全部爲同一節點)例:

19:04:43.100 ERROR [Pool-LongPollin][streaming] A listener dropped (5f587379-ac67-4645-8554-2e02ed739924). The number of listeners is now 1 
19:04:45.767 ERROR [Pool-LongPollin][streaming] Publishing global failure 
19:05:16.313 ERROR [localhost-start][core] Failed to stop feed type MDXFEED with id A1C1D8D92CF7D867F09DCB7E65077B18.0.PT0 

實例從另一天(從多個不同的節點相同的錯誤):

19:00:17.353 ERROR [pivot-remote-0-][distribution] A safe broadcasting task could not be performed 
com.quartetfs.fwk.QuartetRuntimeException: [<node name>] Cannot run a broadcasting task with a STOPPED messenger 

有誰知道的清潔方式關閉下來像這樣的設置?

回答

2

出現這些錯誤是因爲在應用程序關閉時ActivePivotManager正在積極停止分發,而不等待每個分佈式ActivePivot都被通知其他多維數據集已停止。

要順利停止分發,可以使用DistributionUtil類中的方法。例如:

public class DistributionStopper { 

protected final IActivePivotManager manager; 

public DistributionStopper (IActivePivotManager manager){ 
    this.manager = manager; 
} 

public void stop(){ 
    // Get all the schemas from the manager 
    final Collection<IActivePivotSchema> schemas = manager.getSchemas().values(); 

    // To store all the available messengers 
    final List<IDistributedMessenger<?>> availableMessengers = new LinkedList<>(); 

    // Find all the messengers 
    for(IActivePivotSchema schema : schemas){ 
     for(String pivotId : schema.getPivotIds()){ 
      // Retrieve the activePivot matching this id 
      final IMultiVersionActivePivot pivot = schema.retrieveActivePivot(pivotId); 

      if(pivot instanceof IMultiVersionDistributedActivePivot){ 
       IDistributedMessenger<IActivePivotSession> messenger = ((IMultiVersionDistributedActivePivot) pivot).getMessenger(); 
       if(messenger != null){ 
        availableMessengers.add(messenger); 
       } 
      } 
     } 
    } 

    // Smoothly stop the messengers 
    DistributionUtil.stopMessengers(availableMessengers); 
} 

} 

然後註冊此自定義類用作取決於activePivotManager單豆一個Spring bean,爲了管理者的一個前呼籲其與destroyMethod。

@Bean(destroyMethod="stop") 
@DependsOn("activePivotManager") 
public DistributionStopper distributionStopper(IActivePivotManager manager){ 
    return new DistributionStopper(manager); 
} 
+0

它似乎要做的工作,謝謝。我有另一個關機錯誤:無法在[http:// localhost:8080/remoting/LongPollingService];上訪問HTTP調用程序遠程服務;嵌套的異常是java.net.SocketException:連接重置,但我想這必須是關於多維數據集和活動服務器的關閉順序的另一個問題。 – 2015-02-25 15:06:51

+0

更正:建議的解決方案是一種改進,但我仍然看到問題:19:00:50.403 INFO [localhost-start] [DistributionStopper]分佈式信使已停止,19:00:50.403 INFO [pivot-remote-0 - ] [distribution ]在廣播任務期間遇到異常。正在重試...(...導致...信使未連接),19:00:50.403錯誤[pivot-remote-0 - ] [分配]無法執行安全廣播任務:無法運行廣播任務與一個STOPPED信使。 – 2015-03-11 08:57:01