2012-07-06 1 views
3

WLST을 통해 원격 업로드 및 배포를 수행하려고합니다. WebLogic 서버의 경로에 이미있는 응용 프로그램을 성공적으로 배포하는 데 성공했습니다. 하지만 지금은 원격으로 사용할 수 있도록 배포하고 싶습니다.WLST를 사용하여 원격 업로드

배포하기 전에 WLST을 통해 WebLogic 서버에 WAR/EAR을 업로드 할 수있는 가능성은 있습니까? 이 있습니까?

weblogic 12C를 실행 중입니다.

weblogic.Deployer invoked with options: -adminurl t3://WeblogicServer:7001 -user weblogic -deploy /tmp/HelloWorld.war -remote -upload 
<6 juil. 2012 17 h 58 CEST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, HelloWorld [archive: /tmp/HelloWorld.war], to configured targets.> 
[J2EE Deployment SPI:260080]Unable to define the application install directory at "/tmp/helloworld.war". Directory could not be created or is a file. 

을 그리고 난 서버에서 확인할 때, 아무것도 배치되지 않은 :

java -cp wlserver/server/lib/weblogic.jar weblogic.Deployer -adminurl t3://WeblogicServer:7001 -user weblogic -password weblogic -deploy /tmp/HelloWorld.war -remote -upload 

대가로 줘 :

내가 함께했습니다.

답변

4

나는 해결책을 발견 : 우리는뿐만해야 weblogic.Deployer가이 디렉토리를 사용하므로/tmp 디렉토리를 소스으로 사용하십시오.

그래서 명령은 다음과 같습니다

java -cp wlserver/server/lib/weblogic.jar weblogic.Deployer -adminurl 
t3://WeblogicServer:7001 -user weblogic -password weblogic -deploy 
/home/admin/HelloWorld.war -remote -upload 
2

예, 있습니다. WLST deploy command reference을보십시오 (이 링크는 10gR3 용입니다).
기본값은 false이므로 true과 함께 remoteupload 옵션을 지정할 수 있습니다.

PS 1은 다음 remote 옵션은 웹 로직 9.0 및 이전 버전 (사용할 수 없습니다하지만 당신은 항상 weblogic.jar 새를 얻을 시도 할 수
PS 2 :. 당신은 관리 인터페이스에 대한 원격 액세스 (일반적으로 포트가 필요합니다 . 7001 및/또는 7002) 즉, 등, 개방 방화벽을 의미
PS 3 :.이 우리가 당신을 도와 도움이 될 수도로, 당신의 웹 로직 서버의 버전을 제공하십시오

+0

내 게시물을 업데이트했습니다. – Lite

+0

그런 오류는 본 적이 없습니다. 내가 뭔가를 찾으면 한 번보세요. – Viccari

+0

OK 시도 중입니다 – Lite

0

가 배포 취소를 할 + 배포 할 수 있습니다, 자신을 쓰는. 배포 라인은 다음과 같습니다

배포 (프로젝트, 아카이브 , apptargets, '무대'계획 , 원격 = '진실', 업로드 = '진실', archiveVersion = archiveversion, planVersion = planversion)

배포에 버전 번호를 사용
  • 단점은이 계획이
  • 을 작동하지 않는 재배치 할 것입니다

    전체 스크립트

: 자신 출력 (라인 다음 코드는, 내가 배치 할 몇 가지 공백을 추가했다 그것 여기)

from java.io import FileReader 
from datetime import datetime 


def deployApp(project, archive, archiveversion, plan, planversion, apptargets): 

#### UNDEPLOY app   
try: 

    domainConfig() 
    cd('/') 
    found = false 
    for app in cmo.getAppDeployments(): 
     name=app.getName() 

     try:     
      cd('/AppDeployments/' + name) 
      applicationName=get('ApplicationName') 

      if applicationName==project: 
       print '\n__ FOUND aplication: ', name 
       found = true 

       version=get('VersionIdentifier') 
       sourcePath=get('SourcePath') 
       planPath=get('PlanPath') 

       targets='' 
       for target in cmo.getTargets(): 

        targetName=target.getName() 
        if targets=='': 
         targets=targetName 
        else: 
         targets=targets + ', ' + targetName 

       print ' applicationName:\t', applicationName 
       print ' version:\t\t', version 
       print ' sourcePath:\t', sourcePath 
       print ' planPath:\t', planPath 
       print ' targets:\t\t', targets 

       if version==archiveversion + '#' + planversion: 
        print '\nCorrect Application version found. No installation needed\n' 
        return 
       else: 
        print '\n__ REMOVING application: ',applicationName, '  version:', version 
        undeploy(project) 

     except:  
      print "IGNORE ERROR: (deployed applicaties gegevens ophalen) ", sys.exc_info()[0] 

    if found==false: 
     print "Application " + project + "not found." 

except:  
    print "Failure in application remove part: ", sys.exc_info()[0] 
    raise 


# get deploy targets 
try: 
    if apptargets==None: 
     serverConfig() 
     cd('/') 
     targetList = []    
     for cluster in cmo.getClusters(): 
      targetList.append(cluster.getName()) 
     apptargets = ",".join(targetList) 

     print 'USING default app target:', apptargets, " (apptargets not found in environmentfile)" 
except: 
    print "Failure while creating default target", sys.exc_info()[0] 
    raise 


#### DEPLOY app 
try:   
    print '\n__ DEPLOYING application: ', project, archiveversion + '#' + planversion + ' target:' + apptargets 

    deploy(project, archive 
    , apptargets, 'stage', plan 
    , remote='true', upload='true', archiveVersion=archiveversion, planVersion=planversion) 
except:  
    print "Failure in deployment part: ", sys.exc_info()[0] 
    raise 


# connect to domein 
# 1) in plain passsword 
# 1) using encrypted domain credential in separate files 
# 2) using encrypted domain credential in home directory user 
def Connect(domainproperties): 
plainUser = domainproperties.getProperty("user") 
plainPassword = domainproperties.getProperty("password") 
if not (plainUser is None) and not (plainPassword is None): 
    print "Connecting with user & password" 
    connect(plainUser, plainPassword, domainproperties.getProperty("url")) 
    return   

encryptedUserConfigFile = domainproperties.getProperty("encryptedCredentialsFile") 
encryptionKeyFile = domainproperties.getProperty("encryptionKeyFile")  
if not (encryptedUserConfigFile is None) and not (encryptionKeyFile is None): 
    print "Connecting with encryptedCredentialsFile: ", encryptedUserConfigFile, " and encryptionKeyFile: ", encryptionKeyFile 
    connect(userConfigFile=encryptedUserConfigFile, userKeyFile=encryptionKeyFile, url=domainproperties.getProperty("url")) 
    return 

print "Connecting with encryptedCredentialsFile in home directory" 
connect(url=domainproperties.getProperty("url")) 
return  



try: 
print "____ running app_deploy.py at " + str(datetime.now()) 

project = sys.argv[1] 
archive = sys.argv[3] 
archiveversion = sys.argv[4] 
plan = sys.argv[5] 
planversion = sys.argv[6]  
environmentfile = sys.argv[2] 

propertyfilereader=FileReader(environmentfile) 
domainproperties=Properties() 
domainproperties.load(propertyfilereader) 

print " environment: ", environmentfile 
print " Ear: ", archive, " version:", archiveversion 
print " plan: ", plan, " version:", planversion 

## Connect 
#connect(domainproperties.getProperty("user"), domainproperties.getProperty("password"), domainproperties.getProperty("url")) 
Connect(domainproperties) 

try: 

    ## Deploy 
    deployApp(project, archive, archiveversion, plan, planversion, domainproperties.getProperty("apptargets")) 

finally: 
    # niet dat het uitmaakt, maar wel zo netjes 
    disconnect() 

except: 
print "ABORT APP DEPLOY: ", # sys.exc_info()[0], "_", sys.exc_info()[1] 
raise 

재미있게 놀아 라.

관련 문제