使用 wsadmin Scripting 的 AdminTask 物件 ConfigArchiveOperations 指令群組
您可以使用 Jython 或 Jacl Scripting 語言,來配置您環境中的伺服器。ConfigArchiveOperations 群組中的指令和參數可用來匯出或匯入伺服器配置和整個 Cell 配置。
exportProxyProfile
使用 exportProxyProfile 指令,將安全 Proxy 伺服器的整個 Cell 配置匯出至配置保存檔。exportProxyProfile 指令在分散式與 z/OS® 作業系統之間不會起作用。
目標物件
無。
必要參數
- -archive
- 指定所匯出之配置保存檔的完整檔案路徑。(字串,必要)
回覆值
指令不傳回輸出。
批次模式用法範例
使用 Jython 字串:
AdminTask.exportProxyProfile('[-archive "c:/myCell.car"]')
使用 Jython 字串:
AdminTask.exportProxyProfile('-archive c:/myCell.car')
使用 Jython 清單:
AdminTask.exportProxyProfile(['-archive', 'c:/myCell.car'])
使用 Jython 清單:
AdminTask.exportProxyProfile(['-archive', 'c:/myCell.car'])
互動模式用法範例
- 使用 Jython:
AdminTask.exportProxyProfile('-interactive')
exportProxyServer
使用 exportProxyServer 指令,將安全 Proxy 伺服器配置匯出至配置保存檔中所定義的節點。指令會匯出伺服器所在節點的 meta 資料檔。之後當您匯入配置保存檔,來驗證目標節點是否相容於從中匯出伺服器的節點時,即可使用此資訊。
exportProxyServer 指令會將伺服器配置虛擬化,並將伺服器匯出至配置保存檔。這項程序會中斷配置保存檔中之伺服器配置與系統中配置之間任何現有的關聯。
目標物件
無必要參數
- -archive
- 指定所匯出之配置保存檔的完整路徑。(字串,必要)
- -serverName
- 指定安全 Proxy 伺服器名稱。(字串,必要)
選用參數
- -nodeName
- 指定安全 Proxy 伺服器的節點名稱。只有當安全 Proxy 伺服器名稱在整個 Cell 中不是唯一時,才需要這個參數。(字串,選用)
回覆值
指令不傳回輸出。
範例
批次模式下的用法範例:
- 使用 Jython 字串:
AdminTask.exportProxyServer('[-archive c:/myProxyServer.car -nodeName node1 -serverName server1]')
- 使用 Jython 清單:
AdminTask.exportProxyServer(['-archive', 'c:/myProxyServer.car', '-nodeName', 'node1', '-serverName', 'server1'])
- 使用 Jython 字串:
AdminTask.exportProxyServer('[-archive /myProxyServer.car -nodeName node1 -serverName server1]')
- 使用 Jython 清單:
AdminTask.exportProxyServer(['-archive', '/myProxyServer.car', '-nodeName', 'node1', '-serverName', 'server1'])
互動模式下的用法範例:
- 使用 Jython:
AdminTask.exportServer ('-interactive')
exportServer
使用 exportServer 指令,將伺服器配置匯出至配置保存檔中所定義的節點。請使用 exportProxyServer 指令,來匯出 Proxy 伺服器配置。
exportServer 指令會將伺服器配置虛擬化,並將伺服器匯出至配置保存檔。這項程序會中斷配置保存檔中的伺服器配置與系統中的配置之間任何現有的關聯。這項程序也會將應用程式從您指定的伺服器移除,中斷您指定的伺服器與伺服器、叢集或服務整合匯流排成員的核心群組之間的關係。
exportServer 指令會匯出伺服器所在節點的 meta 資料檔。之後當您匯入配置保存檔,來驗證目標節點是否相容於從中匯出伺服器的節點時,即可使用此資訊。
目標物件
無參數和回覆值
- -archive
- 指定所匯出之配置保存檔的完整路徑。(字串,必要)
- -nodeName
- 指定伺服器的節點名稱。只有當伺服器名稱在整個 Cell 中不是唯一時,才需要這個參數。(字串,選用)
- -serverName
- 指定伺服器名稱。(字串,必要)
範例
批次模式下的用法範例:
- 使用 Jacl:
$AdminTask exportServer {-archive c:/myServer.car -nodeName node1 -serverName server1}
- 使用 Jython 字串:
AdminTask.exportServer('[-archive c:/myServer.car -nodeName node1 -serverName server1]')
- 使用 Jython 清單:
AdminTask.exportServer(['-archive', 'c:/myServer.car', '-nodeName', 'node1', '-serverName', 'server1'])
互動模式下的用法範例:
- 使用 Jacl:
$AdminTask exportServer {-interactive}
- 使用 Jython 字串:
AdminTask.exportServer ('[-interactive]')
- 使用 Jython 清單:
AdminTask.exportServer (['-interactive'])
exportWasprofile
目標物件
無參數和回覆值
- -archive
- 指定所匯出之配置保存檔的完整檔案路徑。(字串,必要)
範例
批次模式下的用法範例:- 使用 Jacl:
$AdminTask exportWasprofile {-archive c:/myCell.car}
- 使用 Jython 字串:
AdminTask.exportWasprofile('[-archive c:/myCell.car]')
- 使用 Jython 清單:
AdminTask.exportWasprofile(['-archive', 'c:/myCell.car'])
- 使用 Jacl:
$AdminTask exportWasprofile {-interactive}
- 使用 Jython 字串:
AdminTask.exportWasprofile ('[-interactive]')
- 使用 Jython 清單:
AdminTask.exportWasprofile (['-interactive'])
importApplicationsFromWasprofile
這個 Script 會將所指定應用程式伺服器的 Java EE 應用程式,從 AdminTask exportWasprofile 指令產生的配置保存檔 (.car file),匯入至目標 Cell 配置。
如果要匯入的 Java EE 應用程式相依於共用程式庫,則共用程式庫必須加以配置且位於目標節點上,才能順利啟動所匯入的應用程式。您無法匯入已經部署在指定目標 Cell 中的 Java EE 應用程式。
目標物件
無。
參數和回覆值
- -archive
- 指定配置保存檔的完整檔案路徑。(字串,必要)
- -targetNodeName
- 指定將從中匯入應用程式之目標應用程式伺服器的節點名稱。指定的節點必須存在於目標系統中。如果您已經為 targetClusterName 參數指定值,請勿指定這個參數。(字串,如果未指定 targetClusterName 參數,則為必要的)
- -targetServerName
- 指定要匯入應用程式的目標應用程式伺服器名稱。指定的伺服器必須存在於目標系統中。如果您已經為 targetClusterName 參數指定值,請勿指定這個參數。(字串,如果未指定 targetClusterName 參數,則為必要的)
- -targetClusterName
- 指定要匯入應用程式的目標叢集名稱。指定的叢集必須存在於目標系統中。如果您已經為 targetNodeName 和 targetServerName 參數指定值,請勿指定這個參數。(字串,如果未指定 targetNodeName 和 targetServerName 參數,則為必要的)
- -sourceServerName
- 指定將從中匯入應用程式的來源伺服器名稱。指定的伺服器必須存在於配置保存檔中。在下列情況下,這個參數是必要的。可以是:
- 有多部伺服器存在配置保存檔中,「而且」來源和目標伺服器名稱不同,或者
- 已指定 targetClusterName 參數。
(字串,選用)
範例輸出
指令不傳回輸出。
範例
批次模式下的用法範例:
- 使用 Jacl:
$AdminTask importApplicationsFromWasprofile {-archive c:/myCell.car -targetNodeName myNodeName -targetServerName myServerName -sourceServerName mySourceServerName}
$AdminTask importApplicationsFromWasprofile {-archive c:/myCell.car -targetClusterName myClusterName -sourceServerName mySourceServerName}
- 使用 Jython 字串:
AdminTask.importApplicationsFromWasprofile('[-archive c:/myCell.car -targetNodeName myNodeName -targetServerName myServerName -sourceServerName mySourceServerName]')
AdminTask.importApplicationsFromWasprofile('[-archive c:/myCell.car -targetClusterName myClusterName -sourceServerName mySourceServerName]')
- 使用 Jython 清單:
AdminTask.importApplicationsFromWasprofile(['-archive', 'c:/myCell.car', '-targetNodeName', 'myNodeName', '-targetServerName', 'myServerName', '-sourceServerName', 'mySourceServerName'])
AdminTask.importApplicationsFromWasprofile(['-archive', 'c:/myCell.car', '-targetClusterName', 'myClusterName', '-sourceServerName', 'mySourceServerName'])
互動模式下的用法範例:
- 使用 Jacl:
$AdminTask importApplicationsFromWasprofile {-interactive}
- 使用 Jython 字串:
AdminTask.importApplicationsFromWasprofile ('[-interactive]')
- 使用 Jython 清單:
AdminTask.importApplicationsFromWasprofile (['-interactive'])
importProxyProfile
使用 importProxyProfile 指令,將配置保存檔中的 Cell 配置匯入至系統。這個指令只支援單一基本伺服器配置。importProxyProfile 指令在分散式與 z/OS 平台之間不會起作用。
目標物件
無。
必要參數
- -archive
- 指定所匯出之配置保存檔的完整檔案路徑。(字串,必要)
選用參數
- -deleteExistingServers
- 指定是否要以所匯入 Proxy 設定檔中的伺服器,取代設定檔中的現有安全 Proxy 伺服器。指定 true,則會改寫現有的伺服器。(Boolean,選用)
回覆值
指令不傳回輸出。
批次模式用法範例
使用 Jython 字串:
AdminTask.importProxyProfile('-archive c:/myCell.car -deleteExistingServers true')
使用 Jython 字串:
AdminTask.importProxyProfile('-archive /myCell.car -deleteExistingServers true')
使用 Jython 清單:
AdminTask.importProxyProfile('-archive', 'c:/myCell.car', '-deleteExistingServers', 'true')
使用 Jython 清單:
AdminTask.importProxyProfile('-archive', '/myCell.car', '-deleteExistingServers', 'true')
互動模式用法範例
- 使用 Jython:
AdminTask.importProxyProfile('-interactive')
importProxyServer
使用 importProxyServer 指令,將位於配置保存檔中的安全 Proxy 伺服器匯入至系統。這個指令會將配置保存檔中所定義之伺服器範圍的所有配置,匯入至系統配置。
目標物件
無必要參數
- -archive
- 指定要匯入之配置保存檔的完整路徑。(字串,必要)
選用參數
- -nodeInArchive
- 指定配置保存檔中所定義之伺服器的節點名稱。如果配置保存檔中有多個節點,請為這個參數指定一值。(字串,選用)
- -serverInArchive
- 指定配置保存檔中所定義的安全 Proxy 伺服器名稱。如果保存檔中有多部安全 Proxy 伺服器,請為這個參數指定一值。(字串,選用)
- -deleteExistingServer
- 指定如果現有的伺服器與要匯入的伺服器同名,是否要刪除並取代它。將這個指令的值設為 true 時,會改寫同名的現有伺服器。(字串,選用)
- -nodeName
- 指定作為安全 Proxy 伺服器匯入目標的節點名稱。只有當安全 Proxy 伺服器名稱在整個 Cell 中不是唯一時,才需要這個參數。(字串,選用)
- -serverName
- 指定安全 Proxy 伺服器名稱。如果您指定的伺服器名稱符合節點下的現有伺服器名稱,則會產生異常狀況。(字串,選用)
- -coreGroup
- 指定安全 Proxy 伺服器所屬的核心群組名稱。(字串,選用)
回覆值
指令不傳回輸出。
範例
批次模式下的用法範例:
- 使用 Jython 字串:
AdminTask.importProxyServer('[-archive c:/myProxyServer.car -nodeName node1 -serverInArchive server1 -deleteExistingServer true]')
- 使用 Jython 清單:
AdminTask.importProxyServer(['-archive', 'c:/myProxyServer.car', '-nodeName', 'node1', '-serverInArchive', 'server1', '-deleteExistingServer', 'true'])
- 使用 Jython 字串:
AdminTask.importProxyServer('[-archive /myProxyServer.car -nodeName node1 -serverInArchive server1 -deleteExistingServer true]')
- 使用 Jython 清單:
AdminTask.importProxyServer(['-archive', '/myProxyServer.car', '-nodeName', 'node1', '-serverInArchive', 'server1', 'server1', '-deleteExistingServer', 'true'])
互動模式下的用法範例:
- 使用 Jython:
AdminTask.importProxyServer('-interactive')
importServer
使用 importServer 指令,將位於配置保存檔中的伺服器匯入至系統。這個指令會將配置保存檔中定義的所有伺服器範圍配置,匯入至系統配置。請使用 importProxyServer 指令,來匯入安全 Proxy 伺服器配置。
目標物件
無參數和回覆值
- -archive
- 指定配置保存檔的完整路徑。(字串,必要)
- -nodeInArchive
- 指定配置保存檔中所定義之伺服器的節點名稱。(字串,如果配置保存檔中只定義一個節點,則為選用的;如果配置保存檔中定義了多個節點,則是必要的)
- -serverInArchive
- 指定配置保存檔中所定義的伺服器名稱。(字串,如果指定的 nodeInConfiguration 保存檔中只定義一部伺服器,則為選用的;如果指定的 nodeInConfiguration 保存檔之下定義了多部伺服器,則是必要的)
- -nodeName
- 指定伺服器匯入所在的節點名稱。(字串,如果只有一個節點,則為選用的)
- -serverName
- 指定伺服器匯入所在的伺服器名稱。如果您指定的伺服器名稱符合節點下的現有伺服器名稱,則會產生異常狀況。(字串,選用,預設值:serverInArchive)
- -coreGroup
- 指定伺服器所屬的核心群組名稱。(字串,選用)
範例
批次模式下的用法範例:
- 使用 Jacl:
$AdminTask importServer {-archive c:/myServer.car -nodeInArchive node1 -serverInArchive server1}
- 使用 Jython 字串:
AdminTask.importServer('[-archive c:/myServer.car -nodeInArchive node1 -serverInArchive server1]')
- 使用 Jython 清單:
AdminTask.importServer(['-archive', 'c:/myServer.car', '-nodeInArchive', 'node1', '-serverInArchive', 'server1'])
互動模式下的用法範例:
- 使用 Jacl:
$AdminTask importServer {-interactive}
- 使用 Jython 字串:
AdminTask.importServer ('[-interactive]')
- 使用 Jython 清單:
AdminTask.importServer (['-interactive'])
importWasprofile
使用 importWasprofile 指令,將配置保存檔中的 Cell 配置匯入至系統。這個指令只支援具有單一節點的基本伺服器配置。請使用 importProxyProfile 指令,來匯入安全 Proxy 伺服器設定檔。
importWasprofile 指令在分散式與 z/OS 作業系統之間不會起作用。
目標物件
無參數和回覆值
- -archive
- 指定配置保存檔的完整檔案路徑。(字串,必要)
- -deleteExistingServers
- 設為 true 時,是指定將現有的伺服器從目標設定檔移除,並將配置保存檔匯入至目標設定檔。(Boolean,選用)
預設值為 false,指定不取代伺服器。
範例
- 使用 Jacl:
$AdminTask importWasprofile {-archive c:/myCell.car}
$AdminTask importWasprofile { -archive profile.car -deleteExistingServers true}
- 使用 Jython 字串:
AdminTask.importWasprofile('[-archive c:/myCell.car]')
AdminTask.importWasprofile('[-archive profile.car -deleteExistingServers true]')
- 使用 Jython 清單:
AdminTask.importWasprofile(['-archive', 'c:/myCell.car'])
AdminTask.importWasprofile(['-archive', 'profile.car', '-deleteExistingServers', true])
- 使用 Jacl:
$AdminTask importWasprofile {-interactive}
- 使用 Jython 字串:
AdminTask.importWasprofile ('[-interactive]')
- 使用 Jython 清單:
AdminTask.importWasprofile (['-interactive'])