1

ポリモーフィック キューブ (2 ノード) である ActivePivot キューブがあり、1 つのノード自体が水平方向に分散されたキューブ (8 ノード) です。配布用に JGroup TCP を使用して Tomcat で実行します。毎日再起動されますが、シャットダウンされるたびに (ノード サービスが順番に停止されます)、さまざまなエラーがログに表示されます。これは無害ですが、監視の観点からは厄介です。

ある日の例 (すべて同じノード):

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

このようなセットアップをシャットダウンするクリーンな方法を知っている人はいますか?

4

1 に答える 1

1

これらのエラーが表示されるのは、アプリケーションのシャットダウン時に、分散された各 ActivePivot に他のキューブが停止したことが通知されるのを待たずに、ActivePivotManager が積極的に分散を停止するためです。

配布をスムーズに停止するには、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 シングルトン Bean に応じて Spring Bean として登録し、その destroyMethod をマネージャーの前に呼び出します。

@Bean(destroyMethod="stop")
@DependsOn("activePivotManager")
public DistributionStopper distributionStopper(IActivePivotManager manager){
    return new DistributionStopper(manager);
}
于 2015-02-12T15:20:47.023 に答える