설정 편집 명령어
본 절에서는 JEUS의 설정을 편집하는 명령어들에 대해 설명한다. 이 명령어들을 사용하면 콘솔을 통해 JEUS의 동적 설정 변경 기능을 이용할 수 있다.
동적 설정 변경 기능에 대한 기본적인 사항은 JEUS Domain 안내서의 도메인 설정변경을 참고한다. |
다음은 개별 명령어를 설명하기 전에 먼저 알아두어야 할 사항들에 대한 설명이다.
-
설정 편집 명령어로 편집하는 JEUS 설정에 대해
설정 편집 명령어를 사용해서 편집하는 대상은 JEUS 서버가 설정을 저장하기 위해 사용하는 java 객체로, 이 객체는 JEUS 설정을 표현하는 domain.xml을 정의한 XML schema를 JAXB를 사용하여 자바 객체 형태로 변환한 것이다. 그렇기 때문에 객체의 구조나 각 항목의 이름등이 domain.xml의 그것과 유사하나, 몇몇 부분들에 대해서는 다르게 표현될 수도 있다.
-
Simple Type
설정 항목 중 자식 항목을 갖지 않는 것을 말한다.
-
Complex Type
자식 항목을 갖는 설정 항목을 complex type이라고 한다. 자식으로는 simple type이나 complex type, simple type을 포함하는 목록이나 complex type을 포함하는 목록을 가질 수 있다.
-
목록(List)
simple type이나 complex type을 원소로 갖는 목록(List) 형태의 설정 항목도 존재한다.
-
경로(Path)
설정 편집 명령어에서는 JEUS 설정에서 각 항목의 위치를 경로로 표현한다. 경로는 설정 항목의 이름이나 complex type의 식별자, 목록에서 대상의 위치를 표시하기 위한 색인 번호(index)로 구성된다. 각 항목은 슬래시(/)로 구분한다.
-
최상위 경로(root)는 슬래시 하나로 표현한다.
-
현재 위치는 점(dot) 1개로 표현한다.
-
현재 위치의 부모 항목은 점(dot) 2개로 표현한다. 예를 들어 '/servers’항목의 부모에 대한 경로명은 '/servers/..'으로 표현한다.
-
대부분의 경우 설정 항목의 이름이 해당 항목의 경로명이 된다. 예를 들어 최상위 경로인 root 아래에 있는 servers라는 항목에 대한 경로는 '/servers’로 표현한다. servers 항목이 자식 항목들을 가지고 있고, 그 항목 중 하나의 이름이 server라고 하면, server 항목을 가리키는 경로는 '/servers/server’이다.
-
complex type을 원소로 갖는 목록의 경우 해당 complex type의 식별자의 값을 경로명으로 사용한다. 여기서 식별자란, 여러 개의 동일한 형식의 complex type이 존재할 때 특정 complex type을 식별할 수 있도록 해주는 각각 고유한 값을 갖는 자식 항목을 말한다. 예를 들어 '/servers/server’는 domain 설정에서 각 서버들의 설정을 담은 여러 개의 complex type으로 이루어진 목록이다. 서버 설정을 담는 complex type에서 식별자는 서버 이름을 사용하도록 지정되어 있다. 따라서 server1에 대한 설정 항목에 대한 경로명은 '/servers/server/server1’로 표현할 수 있다.
-
simple type을 원소로 갖는 목록의 경우 complex type과 달리 식별자가 존재할 수 없기 때문에 해당 목록에서 몇 번째 원소인지를 나타내는 색인 번호(index)를 경로명으로 사용한다. 색인 번호는 대괄호 사이에 0 이상의 정수가 들어간 형태로 지정한다. 예를 들어 '/a/b’라는 경로명이 있고, b가 simple type으로 이루어진 목록이라고 하면 해당 목록의 첫 번째 원소는 '/a/b/[0]'으로 표현한다.
simple type 목록에 대한 경로를 표기할 때 첫 번째 원소는 [1]이 아니라 [0]으로 표기하는 점을 유의하도록 한다.
-
각 설정 편집 명령어는 현재 경로를 지정하거나 수정하는 경우가 존재한다. 현재 경로는 서버에 저장되기 때문에 만약 jeusadmin을 여러 개 실행하여 동시에 여러 곳에서 편집을 수행할 경우 현재 경로가 의도하지 않게 변경되어 명령어가 오동작할 수 있다. 따라서 설정 편집 시에는 가급적이면 하나의 jeusadmin만 사용하는 것을 권장한다.
-
아래는 설정 편집을 위해 사용하는 명령어들을 목록으로 나열한 것이다. 모든 명령어는 서버에 접속한 상태에서만 사용할 수 있다.
명령어 | 설명 |
---|---|
수정한 설정을 서버에 반영하고 결과를 출력한다. |
|
동적 설정 변경에 대한 Lock을 해제하고, 서버에 저장되어 있는 수정 내역을 삭제한다. 이 명령어는 Lock을 갖고 있지 않은 상태에서도 사용할 수 있다. |
|
현재 경로를 변경하거나 확인한다. |
|
지정한 항목에 빈 complex type을 생성하거나, complex type를 원소로 갖는 목록에 새로운 항목을 추가한다. |
|
지정한 경로에 위치한 항목을 삭제한다. |
|
지정한 simple type에 값을 변경하거나, simple type을 원소로 갖는 목록에 새로운 항목을 추가한다. |
|
서버에 요청을 보내 동적 설정 변경에 대한 Lock을 요청한다. |
|
지정한 경로에 위치한 항목에 대한 정보를 출력한다. |
1. activate-configuration
수정한 내용을 서버에 반영시키고 결과를 출력한다.
-
alias
activate
-
사용법
activate-configuration
-
예제
[MASTER]domain1.adminServer>cd / [MASTER]domain1.adminServer>ls description Not specified (string ) productionMode true id 982883233 securityManager complex type passwordValidator Not specified (complex type) adminServerName adminServer domainLogHome Not specified (string ) systemClusteringFramework complex type domainBackup complex type enableWebadmin true enableJsonCommand false enableToResynchronizeApplications false servers complex type sessionCluster complex type clusters Not specified (complex type) serverTemplates Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] applicationRepositories Not specified (complex type) deployedApplications Not specified (complex type) deployedLibraries Not specified (complex type) resources Not specified (complex type) [MASTER]domain1.adminServer>set description "Hello, world" The value Hello, world is set at the specified location /description. [MASTER]domain1.adminServer>ls description Hello, world productionMode true id 982883233 securityManager complex type passwordValidator Not specified (complex type) adminServerName adminServer domainLogHome Not specified (string ) systemClusteringFramework complex type domainBackup complex type enableWebadmin true enableJsonCommand false enableToResynchronizeApplications false servers complex type sessionCluster complex type clusters Not specified (complex type) serverTemplates Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] applicationRepositories Not specified (complex type) deployedApplications Not specified (complex type) deployedLibraries Not specified (complex type) resources Not specified (complex type) [MASTER]domain1.adminServer>activate The activation completed successfully. [Details] domain.xml : ACTIVATED domain : ACTIVATED domain.description : ACTIVATED
2. cancel
수정한 내용을 삭제하고, 동적 설정 변경을 위한 Lock을 해제한다. 명령어를 수행하는 유저가 Lock을 갖고 있지 않아도 사용할 수 있다. 이에 동적 설정 변경을 위한 Lock을 강제로 해제하는 용도로도 사용할 수 있는 명령어이다.
-
사용법
cancel
-
예제
[MASTER]domain1.adminServer>edit Successfully acquired a configuration lock from Domain Administration Server. [MASTER]domain1.adminServer>ls description Hello, world productionMode true id 982883233 securityManager complex type passwordValidator Not specified (complex type) adminServerName adminServer domainLogHome Not specified (string ) systemClusteringFramework complex type domainBackup complex type enableWebadmin true enableJsonCommand false enableToResynchronizeApplications false servers complex type sessionCluster complex type clusters Not specified (complex type) serverTemplates Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] applicationRepositories Not specified (complex type) deployedApplications Not specified (complex type) deployedLibraries Not specified (complex type) resources Not specified (complex type) [MASTER]domain1.adminServer>cancel Current configuration editing status is cleared, and the configuration lock is released. [MASTER]domain1.adminServer>ls Current user does not have the configuration lock.
3. change-current-path
지정한 경로를 현재 경로로 변경한다. 변경할 경로를 지정하지 않은 경우 현재 경로를 표시한다.
-
alias
cd
-
사용법
change-current-path [<path>]
-
파라미터
파라미터 설명 [<path>]
변경하고자 하는 경로를 지정한다. 경로 지정은 상대 경로나 절대 경로 방식을 모두 사용할 수 있다.
-
예제
[MASTER]domain1.adminServer>change-current-path servers/server/adminServer Current path is changed to /servers/server/adminServer [MASTER]domain1.adminServer>change-current-path .. Current path is changed to /servers/server [MASTER]domain1.adminServer>change-current-path . Current path is changed to /servers/server [MASTER]domain1.adminServer>change-current-path / Current path is changed to / [MASTER]domain1.adminServer>change-current-path servers/server/server1/../.././server/adminServer Current path is changed to /servers/server/adminServer [MASTER]domain1.adminServer>cd /servers/server/adminServer
4. create-empty-element
지정한 위치에 새로운 complex type을 생성한다. 생성되는 complex type은 내용이 비어있는 상태로 생성되며, 추가적인 작업을 통해 원하는 값을 채워주어야 한다. complex type을 원소로 갖는 목록인 경우 식별자 값을 항목 이름으로 사용하면 지정한 값을 식별자의 값으로 하는 complex type을 생성하여 목록에 추가한다.
-
alias
create
-
사용법
create-empty-element <name> [<type>]
-
파라미터
파라미터 설명 <name>
생성할 항목의 이름을 지정한다. complex type을 원소로 갖는 목록에 새 complex type을 추가하고자 하는 경우 항목 이름으로 지정한 값을 식별자의 값으로 하는 complex type을 생성한다.
[<type>]
생성할 항목의 형식을 지정한다. 일반적인 경우는 지정하지 않아도 상관없으나, 여러 개의 형식을 원소로 갖는 목록인 경우 가능한 형식 중 생성할 형식을 지정해 주어야 할 필요가 있다.
-
예제
-
빈 complex type을 생성하는 예제이다.
[MASTER]domain1.adminServer>cd / [MASTER]domain1.adminServer>create-empty-element passwordValidator Created an empty complex type of passwordValidator at path /
-
complex type을 원소로 갖는 목록에 새로운 complex type을 추가하는 예제이다. 'server2’를 식별자인 서버 이름으로 사용하는 새로운 server 항목이 생성되어 목록에 추가되어 있는 것을 확인할 수 있다.
[MASTER]domain1.adminServer>cd /servers/server Current path is changed to /servers/server [MASTER]domain1.adminServer>ls adminServer server1 Current list can contain the following type of elements: [server] The name of the identifier element of [server] element is [name]. [MASTER]domain1.adminServer>create-empty-element server2 Added a new element of type server with id [name == server2] to the list at path /servers/server [MASTER]domain1.adminServer>ls adminServer server1 server2 Current list can contain the following type of elements: [server] The name of the identifier element of [server] element is [name].
-
type 옵션을 사용하여 생성할 complex type 형식을 지정해주는 예제이다. show-element 명령어 결과에 현재 목록이 원소로 여러 형식의 항목을 갖는 것을 확인할 수 있다. 형식을 지정하지 않은 경우 안내 메시지가 출력되는 것도 볼 수 있다.
[MASTER]domain1.adminServer>cd /servers/server/adminServer/systemLogging/jeus/handler/ fileHandlerOrSmtpHandlerOrSocketHandler [MASTER]domain1.adminServer>ls fileHandler Current list can contain the following type of elements: [fileHandler, userHandler, smtpHandler, socketHandler] The name of the identifier element of [fileHandler, userHandler, smtpHandler, socketHandler] element is [name]. [MASTER]domain1.adminServer>create-empty-element handler1 Must specify an element type to create a new element. Available types are fileHandler, userHandler, smtpHandler, socketHandler. [MASTER]domain1.adminServer>create-empty-element handler1 userHandler Added a new element of type userHandler with id [name == handler1] to the list at path /servers/server/adminServer/systemLogging/jeus/handler/fileHandlerOrSmtpHandlerOrSocketHandler [MASTER]domain1.adminServer>ls fileHandler handler1 Current list can contain the following type of elements: [fileHandler, userHandler, smtpHandler, socketHandler] The name of the identifier element of [fileHandler, userHandler, smtpHandler, socketHandler] element is [name].
-
5. delete-element
지정한 경로에 위치한 항목을 삭제한다.
-
alias
delete, rm
-
사용법
delete-element <path>
-
파라미터
파라미터 설명 <path>
값을 삭제할 항목의 경로를 지정한다.
-
예제
[MASTER]domain1.adminServer>cd / Current path is changed to / [MASTER]domain1.adminServer>ls description Hello,world productionMode true id 982883233 securityManager complex type passwordValidator Not specified (complex type) adminServerName adminServer domainLogHome Not specified (string ) systemClusteringFramework complex type domainBackup complex type enableWebadmin true enableJsonCommand false enableToResynchronizeApplications false servers complex type sessionCluster complex type clusters Not specified (complex type) serverTemplates Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] applicationRepositories Not specified (complex type) deployedApplications Not specified (complex type) deployedLibraries Not specified (complex type) resources Not specified (complex type) [MASTER]domain1.adminServer>delete-element description Successfully delete the target element at /description. [MASTER]domain1.adminServer>ls description Not specified (string ) productionMode true id 982883233 securityManager complex type passwordValidator Not specified (complex type) adminServerName adminServer domainLogHome Not specified (string ) systemClusteringFramework complex type domainBackup complex type enableWebadmin true enableJsonCommand false enableToResynchronizeApplications false servers complex type sessionCluster complex type clusters Not specified (complex type) serverTemplates Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] applicationRepositories Not specified (complex type) deployedApplications Not specified (complex type) deployedLibraries Not specified (complex type) resources Not specified (complex type)
6. start-configuration-editing
서버에 요청을 하여 동적 설정 변경 작업에 대한 Lock을 얻는다. Lock을 얻는데 성공한 경우 서버의 현재 경로를 초기화한다. Lock을 얻지 못한 경우 이후에 cancel을 제외한 명령어는 동작하지 않으므로, 설정 편집을 하고자 하는 경우 반드시 이 명령어를 먼저 수행하여 Lock을 얻어야 한다.
-
alias
lock-and-edit, edit
-
사용법
start-configuration-editing [-f]
-
파라미터
파라미터 설명 [-f]
다른 사용자가 동적 설정 변경에 대한 Lock을 갖고 있더라도 이를 무시하고 강제로 Lock을 얻으려고 시도한다.
-
예제
[MASTER]domain1.adminServer>start-configuration-editing Successfully acquired a configuration lock from Domain Administration Server.
7. set-element-value
지정한 simple type 항목의 값을 수정하거나, simpe type을 원소로 갖는 목록에 값을 추가할 때 사용한다. 이 명령어를 통해 값을 삭제할 수는 없다.
-
alias
set
-
사용법
set-element-value <path><value>
-
파라미터
파라미터 설명 <path>
수정할 항목의 경로를 지정한다.
<value>
수정할 값을 지정한다.
-
예제
-
set-element-value 명령어를 사용하여 description 항목에 "Hello, world!"라는 값을 설정하는 예제이다.
[MASTER]domain1.adminServer>cd / Current path is changed to / [MASTER]domain1.adminServer>ls description Not specified (string ) productionMode true id 982883233 securityManager complex type passwordValidator Not specified (complex type) adminServerName adminServer domainLogHome Not specified (string ) systemClusteringFramework complex type domainBackup complex type enableWebadmin true enableJsonCommand false enableToResynchronizeApplications false servers complex type sessionCluster complex type clusters Not specified (complex type) serverTemplates Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] applicationRepositories Not specified (complex type) deployedApplications Not specified (complex type) deployedLibraries Not specified (complex type) resources Not specified (complex type) [MASTER]domain1.adminServer>set-element-value description "Hello,world" The value Hello,world is set at the specified location /description. [MASTER]domain1.adminServer>ls description Hello,world productionMode true id 982883233 securityManager complex type passwordValidator Not specified (complex type) adminServerName adminServer domainLogHome Not specified (string ) systemClusteringFramework complex type domainBackup complex type enableWebadmin true enableJsonCommand false enableToResynchronizeApplications false servers complex type sessionCluster complex type clusters Not specified (complex type) serverTemplates Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] applicationRepositories Not specified (complex type) deployedApplications Not specified (complex type) deployedLibraries Not specified (complex type) resources Not specified (complex type)
-
simple type을 원소로 갖는 목록에 값을 추가하는 예제이다. 값을 추가할 목록에 대한 경로를 항목 이름으로 사용하는 것을 알 수 있다.
[MASTER]domain1.adminServer>start-configuration-editing Successfully acquired a configuration lock from Domain Administration Server. [MASTER]domain1.adminServer>cd lifecycleInvocation Current path is changed to /lifecycleInvocation [MASTER]domain1.adminServer>create-empty-element com.tmax.sample Added a new element of type lifecycleInvocation with id [className == com.tmax.sample] to the list at path /lifecycleInvocation [MASTER]domain1.adminServer>cd com.tmax.sample Current path is changed to /lifecycleInvocation/com.tmax.sample [MASTER]domain1.adminServer>cd invocation Current path is changed to /lifecycleInvocation/com.tmax.sample/invocation [MASTER]domain1.adminServer>create-empty-element invocation Added a new element of type invocation to the list at path /lifecycleInvocation/com.tmax.sample/invocation [MASTER]domain1.adminServer>cd [0] Current path is changed to /lifecycleInvocation/com.tmax.sample/invocation/[0] [MASTER]domain1.adminServer>ls invocationMethod Not specified (complex type) invocationArgument list of [string] invocationType Not specified (enum[BOOT, BEFORE_DEPLOY, AFTER_DEPLOY, READY, BEFORE_UNDEPLOY, AFTER_UNDEPLOY]) [MASTER]domain1.adminServer>set-element-value invocationArgument arg0 The value arg0 added to the list in the specified location: /lifecycleInvocation/com.tmax.sample/invocation/[0]/invocationArgument. [MASTER]domain1.adminServer>cd invocationArgument Current path is changed to /lifecycleInvocation/com.tmax.sample/invocation/[0]/invocationArgument [MASTER]domain1.adminServer>ls [0] arg0 Current list can contain the following type of elements: [string] [MASTER]domain1.adminServer>set-element-value . arg1 The value arg1 added to the list in the specified location: /lifecycleInvocation/com.tmax.sample/invocation/[0]/invocationArgument. [MASTER]domain1.adminServer>ls [0] arg0 [1] arg1 Current list can contain the following type of elements: [string]
-
8. show-element
지정한 경로에 위치한 항목에 대한 정보를 표시한다. 출력되는 정보는 항목의 이름, 값, 형식(type) 등이다. 경로를 지정하지 않은 경우 현재 위치에 대한 경로를 표시한다.
-
alias
ls
-
사용법
show-element [<path>]
-
파라미터
파라미터 설명 [<path>]
정보를 조회할 항목의 경로를 지정한다.
-
예제
-
complex type에 대한 정보를 출력한 예제이다. 항목의 이름, 값(존재하는 경우), 값의 형식을 출력하는 것을 알 수 있다.
[MASTER]domain1.adminServer>show-element name adminServer nodeName node1 listeners complex type logHome Not specified (string ) group Not specified (string ) jvmConfig complex type userInterceptor Not specified (complex type) userLogging Not specified (complex type) systemLogging list of [systemLogging] logStdoutToRawFormat true actionOnResourceLeak WARNING (enum[NO_ACTION, WARNING, AUTO_CLOSE]) tmConfig complex type externalResource list of [externalResource] managedExecutorService list of [string] managedScheduledExecutorService list of [string] contextService list of [string] managedThreadFactory list of [string] scheduler Not specified (complex type) namingServer complex type jmxManager Not specified (complex type) systemThreadPool complex type dataSourceRemoteLookup false engineInitOnStartup true useWebEngine true useEjbEngine true useJmsEngine true webEngine complex type ejbEngine complex type jmsEngine complex type useMEJB false classFtp true enableInterop Not specified (complex type) lifecycleInvocation list of [lifecycleInvocation] resRef complex type jmsResource complex type dataSources Not specified (complex type) customResourceRefs Not specified (complex type) externalResourceRefs Not specified (complex type) autoGenerated Not specified (boolean )
-
complex type를 원소로 갖는 목록 항목에 대한 정보를 출력하는 예제이다. 각 항목의 이름은 식별자의 값으로 표시되며, 해당 목록에 들어갈 수 있는 값의 형식과 식별자가 표시되는 것을 알 수 있다.
[MASTER]domain1.adminServer>show-element /servers/server adminServer server1 Current list can contain the following type of elements: [server] The name of the identifier element of [server] element is [name].
-