스크립트를 사용하여 애플리케이션 레벨에서 Stateful 세션 Bean 장애 복구 구성

스크립트 및 wsadmin 도구를 사용하여 Stateful 세션 Bean 장애 복구에 대해 애플리케이션을 구성합니다.

시작하기 전에

이 태스크를 시작하기 전에, wsadmin 도구가 실행 중이어야 합니다. 자세한 정보는 "wsadmin 스크립트 클라이언트 시작"을 참조하십시오.

이 태스크 정보

AdminConfig 오브젝트를 사용하여 애플리케이션에서 구성을 설정할 수 있습니다. 이 태스크에서는 AdminConfig 오브젝트를 사용하여 애플리케이션에서 모든 EJB 모듈에 대한 Stateful 세션 Bean 장애 복구 구성을 표시합니다. 그런 다음 AdminConfig 오브젝트를 사용하여 동일한 애플리케이션의 모든 EJB 모듈에서 Stateful 세션 Bean 장애 복구 구성을 수정합니다.

프로시저

  1. wsadmin 스크립트 클라이언트를 시작하십시오.
    • Jacl 사용
      wsadmin
                              
    • Jython 사용
      wsadmin -lang Jython
                              
  2. 애플리케이션에 대한 배치 구성 오브젝트를 식별하여 이를 deployment 변수로 지정하십시오. 예를 들면, 다음과 같습니다.
    • Jacl 사용
      set app [$AdminConfig getid /Deployment:EJBinWARTest/]
      set depObj [$AdminConfig showAttribute $app deployedObject]
                              
    • Jython 사용
      app = AdminConfig.getid("/Deployment:EJBinWARTest/" )
      depObj = AdminConfig.showAttribute(app, "deployedObject" )
                              
  3. 애플리케이션 구성 오브젝트를 가져오십시오. 오브젝트가 없는 경우 작성하십시오.
    • Jacl 사용
      # Get the single application configuration object:
      set appConfig [lindex [$AdminConfig showAttribute $depObj configs] 0]
      
      
      # Create the application configuration object if not present: 
      
      if { ($appConfig == "") } {
        puts "\nappConfig not present - creating one"
        set appConfig [$AdminConfig create ApplicationConfig $depObj {{enableSFSBFailover true} {overrideDefaultDRSSettings false}}]
        set attrs [list config $appConfig]
        set targetMappings [lindex [$AdminConfig showAttribute $depObj targetMappings] 0]
        $AdminConfig modify $targetMappings [list $attrs]
              } else {
        puts "\nappConfig present"
      }
                               
    • Jython 사용
      appConfig = AdminConfig.showAttribute (depObj, 'configs')
      appConfig = appConfig.replace('[','').replace(']','')
      
      if (appConfig):
        print "\nappConfig present"
      else:
        print "\nappConfig not present - creating one"
        acAttrs = []
        attr1 = ["enableSFSBFailover", "true"]
        attr2 = ["overrideDefaultDRSSettings", "false"]
        acAttrs.append(attr1)
        acAttrs.append(attr2)
        appConfig = AdminConfig.create('ApplicationConfig', depObj, acAttrs)
        tmAttrs = ['config', appConfig]
        targetMappings = AdminConfig.showAttribute (depObj, 'targetMappings')
        targetMappings = targetMappings[1:len(targetMappings)-1]
        AdminConfig.modify(targetMappings, [tmAttrs])
                               
  4. 애플리케이션의 Stateful 세션 Bean 장애 복구 구성을 표시하십시오.
    • Jacl 사용
      puts "\nStateful session bean failover settings at the application level"
      puts [$AdminConfig show $appConfig]
      
      
      # Show the drsSettings of the application:
      
      set drsSettings [$AdminConfig showAttribute $appConfig drsSettings]
      if { ($drsSettings == "") } {
        puts "drsSettings not present"
              } else {
        puts "\ndrsSettings of the application:"
        puts [$AdminConfig show $drsSettings]
      }
                              
    • Jython 사용
      print "\nStateful session bean failover configuration of the application :"
      print AdminConfig.show(appConfig)
      
      drsSettings = AdminConfig.showAttribute (appConfig, 'drsSettings')
      if (drsSettings):
        print "\ndrsSettings of the application:"
        print AdminConfig.show(drsSettings)
      else:
        print "drsSettings not present"
                              
  5. 애플리케이션의 Stateful 세션 Bean 장애 복구를 사용하십시오.
    • Jacl 사용
      $AdminConfig modify $appConfig {{enableSFSBFailover "true"}}
                              
    • Jython 사용
      # Enable Stateful session bean failover for the application:
      AdminConfig.modify(appConfig, [['enableSFSBFailover', 'true']])
                              
  6. 애플리케이션의 데이터 복제 서비스 설정을 추가하거나 수정하십시오.
    • Jacl 사용
      # To add or modify drsSettings for the application:
      
      set drsSettings [$AdminConfig showAttribute $appConfig drsSettings]
      if { ($drsSettings == "") } {
        puts "\ndrsSettings not present - creating them"
        $AdminConfig create DRSSettings $appConfig "{messageBrokerDomainName ReplicationDomain2}"
              } else {
        set newMessageBrokerDomainName "{messageBrokerDomainName ReplicationDomain2}"
        $AdminConfig modify $drsSettings $newMessageBrokerDomainName
      }
      
      $AdminConfig modify $appConfig {{overrideDefaultDRSSettings "true"}}
      
      
      # Show the new or modified drsSettings of the application:
      
      set drsSettings [$AdminConfig showAttribute $appConfig drsSettings]
      puts "\nModified drsSettings of the application:"
      puts [$AdminConfig show $drsSettings]
                              
    • Jython 사용
      drsSettings = AdminConfig.showAttribute (appConfig, 'drsSettings')
      if (drsSettings):
        newMessageBrokerDomainName = "{messageBrokerDomainName ReplicationDomain2}"
        AdminConfig.modify(drsSettings, newMessageBrokerDomainName)
      else:
        print "\ndrsSettings not present - creating them"
        drsAttr1 = ["messageBrokerDomainName","ReplicationDomain2"]
        drsAttrs = []
        drsAttrs.append(drsAttr1)
        AdminConfig.create("DRSSettings",appConfig,drsAttrs)
      
      
      AdminConfig.modify(appConfig, [['overrideDefaultDRSSettings', 'true']])
      
      # Show the new or modified drsSettings of the application:
      
      drsSettings = AdminConfig.showAttribute (appConfig, 'drsSettings')
      print "\nNew or Modified drsSettings of the application:"
      print AdminConfig.show(drsSettings)
                              

주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_ejbsfsbapp
파일 이름:txml_ejbsfsbapp.html