機械翻訳について

Compare Model Tool

ドメイン・モデルを操作する場合、異なるモデルの違いを知ることが役立つことがあります。 Compare Model Toolでは、2つのモデル・ファイルが比較され、モデル間の違いを示すモデルが生成されます。

Compare Model Toolを使用するには、compareModelシェル・スクリプトを正しい引数で実行します。 有効な引数のリストを表示するには、使用情報について、-helpオプション(または引数を指定しない)でシェル・スクリプトを実行します。

たとえば、次のモデルを比較します。

新しいモデル

domainInfo:
    AdminUserName: weblogic
    AdminPassword: welcome2
    ServerStartMode: 'prod'
topology:
    Name: domain1
    AdminServerName: admin-server
    SecurityConfiguration:
        NodeManagerUsername : weblogic
        NodeManagerPasswordEncrypted : welcome1
    Cluster:
        cluster-1:
            DynamicServers:
                ServerTemplate:  cluster-1-template
                ServerNamePrefix: managed-server
                DynamicClusterSize: 5
                MaxDynamicClusterSize: 5
                CalculatedListenPorts: false
        cluster-2:
            DynamicServers:
                ServerTemplate:  cluster-2-template
                ServerNamePrefix: managed-server
                DynamicClusterSize: 2
                MaxDynamicClusterSize: 3
                CalculatedListenPorts: false
    Server:
        admin-server:
            ListenPort: 10011
    ServerTemplate:
        cluster-1-template:
            Cluster: cluster-1
            ListenPort : 5001
            JTAMigratableTarget:
                    StrictOwnershipCheck: true
                    Cluster: cluster-1
        cluster-2-template:
            Cluster: cluster-2
            ListenPort : 8001
            ServerStart:
                    Arguments: ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006']
            JTAMigratableTarget:
                    StrictOwnershipCheck: true
                    Cluster: cluster-2
appDeployments:
     Application:
         myear:
             SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app.ear
             Target: [cluster-2,cluster-1]
         yourear:
             SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app2.ear
             ModuleType: ear
             Target: [cluster-2,cluster-1]
resources:
    JMSServer:
        JMSServer1:
            Target: m1
        JMSServer2:
            Target: m2
    JMSSystemResource:
        MyJmsModule:
            Target: mycluster
            SubDeployment:
                JMSServer1Subdeployment:
                    Target: JMSServer1
                JMSServer2Subdeployment:
                    Target: JMSServer2
            JmsResource:
                ConnectionFactory:
                    WebAppConnectionFactory:
                        DefaultTargetingEnabled: true
                        JNDIName: jms/WebCF
                        ClientParams:
                            AllowCloseInOnMessage: true
                            MessagesMaximum: 1
                        DefaultDeliveryParams:
                            DefaultTimeToDeliver: 3
                            DefaultTimeToLive: 3600
                        FlowControlParams:
                            FlowControlEnabled: false
                        LoadBalancingParams:
                            LoadBalancingEnabled: false
                        SecurityParams:
                            AttachJMSXUserId: true
                        TransactionParams:
                            XAConnectionFactoryEnabled: true
                UniformDistributedQueue:
                    MyUniformDistributedQueue:
                        DefaultTargetingEnabled: true
                        JNDIName: jms/myUDQ

古いモデル

domainInfo:
    AdminUserName: weblogic
    AdminPassword: welcome2
    ServerStartMode: prod
topology:
    Name: domain1
    AdminServerName: admin-server
    SecurityConfiguration:
        NodeManagerUsername : weblogic
        NodeManagerPasswordEncrypted : welcome1
    Cluster:
        cluster-1:
            DynamicServers:
                ServerTemplate:  cluster-1-template
                ServerNamePrefix: managed-server
                DynamicClusterSize: 5
                MaxDynamicClusterSize: 5
                CalculatedListenPorts: false
    Server:
        admin-server:
            ListenPort: 10011
    ServerTemplate:
        cluster-1-template:
            Cluster: cluster-1
            ListenPort : 5001
            ServerStart:
                    Arguments: ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006']
            JTAMigratableTarget:
                    StrictOwnershipCheck: true
                    Cluster: cluster-1
appDeployments:
     Application:
         myear:
             SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app.ear
             ModuleType: ear
             Target: [cluster-1,cluster-2]
         myear2:
             SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app2.ear
             ModuleType: ear
             Target: [cluster-1,cluster-2]
resources:
    WebAppContainer:
        WAPEnabled: '@@PROP:WAPENABLED@@'
        FilterDispatchedRequestsEnabled: true
        AllowAllRoles: true
        XPoweredByHeaderLevel: NONE
        ServletAuthenticationFormURL: true
        ServletReloadCheckSecs: 1
        ChangeSessionIDOnAuthentication: true
        MimeMappingFile: wlsdeploy/config/amimemappings.properties
        AuthCookieEnabled: true
        WorkContextPropagationEnabled: true
        ReloginEnabled: true
        GzipCompression:
            GzipCompressionContentType: [ text/html, text/xml, text/plain ]
            GzipCompressionEnabled: true
    JMSServer:
        JMSServer1:
            Target: m1
        JMSServer2:
            Target: m2
    JMSSystemResource:
        MyJmsModule:
            Target: mycluster
            SubDeployment:
                JMSServer1Subdeployment:
                    Target: JMSServer1
                JMSServer2Subdeployment:
                    Target: JMSServer2
            JmsResource:
                ConnectionFactory:
                    WebAppConnectionFactory:
                        DefaultTargetingEnabled: true
                        JNDIName: jms/WebCF
                        ClientParams:
                            AllowCloseInOnMessage: true
                            MessagesMaximum: 1
                        DefaultDeliveryParams:
                            DefaultTimeToDeliver: 3
                            DefaultTimeToLive: 3600
                        FlowControlParams:
                            FlowControlEnabled: false
                        LoadBalancingParams:
                            LoadBalancingEnabled: false
                        SecurityParams:
                            AttachJMSXUserId: true
                        TransactionParams:
                            XAConnectionFactoryEnabled: true
                    MDBConnectionFactory:
                        DefaultTargetingEnabled: true
                        JNDIName: jms/mdbCF
                        TransactionParams:
                            XAConnectionFactoryEnabled: true
                UniformDistributedQueue:
                    MyUniformDistributedQueue:
                        DefaultTargetingEnabled: true
                        JNDIName: jms/myUDQ
                        ResetDeliveryCountOnForward: true

2つのモデル・ファイルを比較するには、次のようにツールを実行します:

$ weblogic-deploy\bin\compareModel.cmd -oracle_home c:\wls12213 new_model.yaml old_model.yaml

ツールの出力は次のようになります:

モデルの比較: new=/tmp/model2.yaml vs old=/tmp/model1.yaml

新しいモデルと古いモデルの違い:

resources:
    JMSSystemResource:
        MyJmsModule:
            JmsResource:
                ConnectionFactory:
                    '!MDBConnectionFactory':
    '!WebAppContainer':
appDeployments:
    Application:
        '!myear2':
        yourear:
            SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app2.ear
            ModuleType: ear
            Target: [ cluster-2, cluster-1 ]
        myear:
            Target: [ cluster-2, cluster-1 ]
topology:
    ServerTemplate:
        cluster-1-template:
            '!ServerStart':
        cluster-2-template:
            Cluster: cluster-2
            ListenPort: 8001
            ServerStart:
                Arguments: [ '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006' ]
            JTAMigratableTarget:
                StrictOwnershipCheck: True
                Cluster: cluster-2
    Cluster:
        cluster-2:
            DynamicServers:
                ServerTemplate: cluster-2-template
                ServerNamePrefix: managed-server
                DynamicClusterSize: 2
                MaxDynamicClusterSize: 3
                CalculatedListenPorts: False
  1. モデル・パス: resources->JMSSystemResource->MyJmsModule->JmsResource->UniformDistributedQueue->MyUniformDistributedQueue->ResetDeliveryCountOnForwardは新しいモデルに存在しませんが、前のモデルに存在

  2. モデル・パス: appDeployments->Application->myear->ModuleTypeは新しいモデルに存在しませんが、前のモデルに存在

新しいモデルと古いモデルの比較:

  1. topologyセクションにcluster-2およびcluster-2-templateが追加されました。
  2. topologyセクションのcluster-1-templateServerStartを削除しました。
  3. appDeploymentsセクションに2つのアプリケーションyourearおよびmyearをデプロイしました。
  4. appDeploymentsセクションのアプリケーションmyearを削除しました。
  5. resourceセクションのMyJmsModule JMSモジュールからMDBConnectionFactoryを削除しました。
  6. resourceセクションでWebAppContainerを削除しました。
  7. 属性ResetDeliveryCountOnForwardMyUniformDistributedQueueから削除しました。
  8. アプリケーションmyearのデプロイメント・ターゲットが変更されました。
  9. アプリケーションmyearの属性'ModuleType'を削除しました。

!は、モデルから非属性キー要素を削除するための表記です。 欠落した属性は結果のモデルから省略されますが、出力にメッセージとして表示されます。 属性値がリストの場合、リスト内のすべての個々のアイテムが同じで順序が異なる場合でも、属性は異なる数としてカウントされます。

2つのモデル・ファイルを比較して出力をファイルに生成するには、次のようにツールを実行します:

$ weblogic-deploy\bin\compareModel.cmd -oracle_home c:\wls12213 -output_dir c:\cm-output new_model.yaml old_model.yaml

The following files will be written to the directory:

diffed_model.json
diffed_model.yaml
compare_model_stdout

環境変数

次の環境変数を設定できます。

  • JAVA_HOME JDKのロケーション。 これは有効なJava 7以降のJDKである必要があります。
  • WLSDEPLOY_PROPERTIES Javaに渡されるシステム・プロパティ。

Compare Model ToolではWLSTを使用せずにJythonを直接使用するため、JAVA_HOMEはコマンドの実行に使用されるJDKになります(WLSTを使用する他のツールとは異なり)。

compareModelのパラメータ表

パラメータ 定義 デフォルト
-oracle_home Oracleインストールのホーム・ディレクトリ。 ORACLE_HOME環境変数が設定されていない場合は必須です。
-output_dir (必須)出力を格納するディレクトリ。
-variable_file トークン置換に使用される変数ファイル。