Contained Within
Find More Documentation
Featured Support Resources
| PDF로 이 문서 다운로드 (2394 KB)
set(1)
NAME
| Synopsis
| Description
| Options
| Operands
| Examples
| Exit Status
| See Also
NAME
set – sets the values of attributes
Synopsis
set
[--terse={true|false}][ --echo={true|false} ]
[ --interactive={true|false} ] [ --host host]
[--port port] [--secure| -s ] [ --user admin_user]
[--passwordfile filename] [--help]
attributename=value
Description
Sets the values of one or more configurable attribute.
An application server dotted name uses the “.”
(period) as a delimiter to separate the parts of a complete name. This is
similar to how the “/” character is used to
delimit the levels in the absolute path name of a file in the UNIX file system.
The following rules apply while forming the dotted names accepted by the get, set and list commands.
Note that a specific command has some additional semantics applied.
-
A . (period) always separates two sequential
parts of the name.
-
A part of the name usually identifies an application server
subsystem and/or its specific instance. For example: web-container, log-service,
thread-pool-1 etc.
-
If any part of the name itself contains a . (period),
then it must be escaped with a leading \ (backslash) so
that the “.” does not act like a delimiter.
-
The top level switch for any dotted name is -monitor or -m that is separately specified on a given command line. The presence
or lack of this switch implies the selection of one of the two hierarchies
for appserver management: monitoring and configuration.
If you
happen to know the exact complete dotted name without any wildcard character,
then list and get/set have
a little difference in their semantics:
-
The list command treats this complete dotted
name as the complete name of a parent node in the abstract hierarchy. Upon
providing this name to list command, it simply returns
the names of the immediate children at that level. For example, list
server.applications.web-module will list all the web modules deployed
to the domain or the default server.
-
The get and set commands
treat this complete dotted name as the fully qualified name of the attribute
of a node (whose dotted name itself is the name that you get when you remove
the last part of this dotted name) and it gets/sets the value of that attribute.
This is true if such an attribute exists. You will never start with this case
because in order to find out the names of attributes of a particular node
in the hierarchy, you must use the wildcard character *.
For example, server.applications.web-module.JSPWiki.context-root will
return the context-root of the web-application deployed to the domain or default
server.
-
server(usually the first
part of the complete dotted name) can be replaced with the name of a particular
server instance of interest (e.g., server1) and you'll
get the information of that server instance, remaining part of the dotted
name remaining the same. Note that the dotted names that are available in
such other server instances are those from the monitoring hierarchy because
these server instances don't have a way to expose the configuration hierarchy.
The list command is the progenitor of navigational
capabilities of these three commands. If you want to set or get attributes of a particular application server subsystem, you
must know its dotted name. The list command is the one
which can guide you to find the dotted name of that subsystem. For example,
to find out the modified date (attribute) of a particular file in a large
file system that starts with /. First you must find out
the location of that file in the file system, and then look at its attributes.
Therefore two of the first commands to understand the hierarchies in appserver
are: * list * and * list "*" -monitor. The sorted output of these commands is typically of the following
form:
|
Command
|
Output
|
|
list *
|
-
default-config
-
default-config.admin-service
-
default-config.admin-service.das-config
-
default-config.admin-service.jmx-connector.system
-
default-config.admin-service.jmx-connector.system.ssl
-
default-config.availability-service
-
default-config.availability-service.jms-availability
-
default-config.diagnostic-service
-
default-config.ejb-container
-
. . .
-
default-config.http-service.http-listener.http-listener-1
-
default-config.http-service.http-listener.http-listener-2
-
. . .
-
default-config.iiop-service
-
. . .
-
default-config.java-config
-
. . .
-
domain
-
domain.clusters
-
domain.configs
-
domain.resources
-
domain.resources.jdbc-connection-pool.DerbyPool
-
domain.resources.jdbc-connection-pool._CallFlowPool
-
domain.resources.jdbc-connection-pool._TimerPool
-
. . .
-
server
-
server-config
-
cerver-config.admin-service
-
server-config.admin-service.das-config
-
server-config.admin-service.jmx-connector.system
-
server-config.admin-service.jmx-connector.system.ssl
-
server-config-availability-servicce
-
server-config.availability-service.jms-availability
-
server-config.diagnostic-service
-
server-config.ejb-container
-
. . .
-
server.log-service
-
server.log-service.module-log-levels
-
. . .
-
server.session-config
-
server.session-config.session-manager
-
server.session-config.session-manager.manager-properties
-
server.session-config.session-manager.store-properties
-
server.session-config.session-properties
-
server.thread-pools
-
server.thread-pools.thread-pool.thread-pool-1
-
server.transaction-service
-
server.web-container
-
server.web-container-availability
|
|
list -monitor *
|
-
server
-
server.applications
-
server.applications._JWSappclients
-
server.applications._JWSappclients.sys\.war
-
server.applications.adminapp
-
server.applications.admingui
-
server.connector-service
-
server.http-service
-
server.http-service.server
-
server.jms-service
-
server.jvm
-
server.orb
-
server.orb.connection-managers
-
server.resources
-
server.thread-pools
|
Consequently, the list command is the entry point
into the navigation of the application server's s management hierarchies.
Take note of the output of the list command:
-
The output lists one element per line.
-
Every element on a line is a complete-dotted-name of a management
component that is capable of having attributes. Note that none of these lines
show any kind of attributes at all.
The output of thelist command is a list of dotted
names representing individual application server components and subsystems.
Every component or subsystem is capable of having zero or more attributes
that can be read and modified.
With thelist command you can drill down through the
hierarchy in a particular branch of interest. For example, if you want to
find the configuration of the http-listener of the domain
(the default server, whose ID is "server"). Here is
how you could proceed on a UNIX terminal:
|
ID
|
Command
|
Output/Comment
|
|
1
|
list "*" | grep http | grep listener
|
-
default-config.http-service.http-listener.http-listener-1
-
default-config.http-service.http-listener.http-listener-2
-
server-config.http-service.http-listener.admin-listener
-
server-config.http-service.http-listener.http-listener-1
-
server-config.http-service.http-listener.http-listener-2
-
server-http-service.http-listener.admin-listener
-
server.http-service.http-listener.http-listener-1
-
server.http-service.http-listener.http-listener-2
|
|
2
|
To find the listener that corresponds to the default http-listener where the web applications in the domain/server are
deployed:
-
Examine the dotted name starting with item number 7 in above
output.
-
Use the get command as shown in its usage.
For example, get server.http-service.http-listener.http-listener-1.* will return all the attributes of the http-listener in
context.
|
server.http-service.http-listener.http-listener-1.acceptor-threads =
1server.http-service.http-listener.http-listener-1.address
= 0.0.0.0server.http-service.http-listener.http-listener-1.blocking-enabled
= falseserver.http-service.http-listener.http-listener-1.default-virtual-server
= serverserver.http-service.http-listener.http-listener-1.enabled
= trueserver.http-service.http-listener.http-listener-1.external-port
=server.http-service.http-listener.http-listener-1.family =
inetserver.http-service.http-listener.http-listener-1.id =
http-listener-1server.http-service.http-listener.http-listener-1.port
= 8080server.http-service.http-listener.http-listener-1.redirect-port
=server.http-service.http-listener.http-listener-1.security-enabled
= falseserver.http-service.http-listener.http-listener-1.server-name
=server.http-service.http-listener.http-listener-1.xpowered-by
= true
|
Making use of both list and get commands,
it is straightforward to reach a particular component of interest.
To get the monitoring information of a particular subsystem you must:
-
Use the set command to set an appropriate
monitoring level for the component of interest.
-
Obtain the various information about the JVM that the application
server domain is running.
|
ID
|
Command
|
Output/Comment
|
|
1
|
list server* | grep monitoring
|
server-config.monitoring-serviceserver-config.monitoring-service.module-monitoring-levelsserver.monitoring-serviceserver.monitoring-service.module-monitoring-levels
Note that this is the list command. It only shows
the hierarchy, nothing else. Using the '|' and "grep" narrows down the search
effectively. Now, you can choose server.monitoring-service to
set the attributes of various attributes that can be monitored.
This is the configuration data because this setting will be persisted
to the server's configuration store.
|
|
2
|
get server.monitoring-service.*
|
You can try the number of attributes that are presently available with
monitoring service. Here is the output:
No matches resulted from the wildcard expression. This is because this
fully dotted name does not have any attributes at all. Logically, you try
the next one and that is: server.monitoring-service.module-monitoring-levels. Again, use the wildcard character to get ALL the attributes of
a particular component.
|
|
3
|
get server.monitoring-service.module-monitoring-levels.*
|
server.monitoring-service.module-monitoring-levels.connector-connection-pool
= OFF server.monitoring-service.module-monitoring-levels.connector-service = OFF server.monitoring-service.module-monitoring-levels.ejb-container = OFF server.monitoring-service.module-monitoring-levels.http-service = OFF server.monitoring-service.module-monitoring-levels.jdbc-connection-pool = OFF server.monitoring-service.module-monitoring-levels.jms-service = OFF server.monitoring-service.module-monitoring-levels.jvm = OFF server.monitoring-service.module-monitoring-levels.orb = OFF server.monitoring-service.module-monitoring-levels.thread-pool = OFF server.monitoring-service.module-monitoring-levels.transaction-service = OFF server.monitoring-service.module-monitoring-levels.web-container = OFF
The JVM monitoring is at a level OFF. It must be changed in order to
make the JVM monitoring information available. The other valid values for
all the monitoring level are: LOW and HIGH. use the set command
to set the value appropriately.
|
|
4
|
set server.monitoring-service.module-monitoring-levels.jvm=HIGH
There is no space before or after the = sign.
|
server.monitoring-service.module-monitoring-levels.jvm = HIGH
Now, the JVM information can be obtained using the get command
and monitoring switch. But remember , when you switch to the monitoring hierarchy,
start with the list command again.
|
|
5
|
list --monitor * | grep jvm
|
server.jvm server.jvm.class-loading-system server.jvm.compilation-system server.jvm.garbage-collectors server.jvm.garbage-collectors.Copy server.jvm.garbage-collectors.MarkSweepCompact server.jvm.memory
server.jvm.operating-system server.jvm.runtime server.jvm.thread-system server.jvm.thread-system.thread-1 . . . server.jvm.thread-system.thread-793823 server.jvm.thread-system.thread-793824 server.jvm.thread-system.thread-793825 server.jvm.thread-system.thread-793826 server.jvm.thread-system.thread-793827 server.jvm.thread-system.thread-9
The JRE 1.5.0 monitorable components are exposed in an elegant manner.
This is what you see when connected by the JConsole. Now, to know more about
the class-loading system in the JVM, this is how you'll proceed.
Note that now you are interested in the attributes of a particular leaf
node. Thus the command is get not list.
|
|
6
|
get -monitor server.jvm.class-loading-system.*
|
server.jvm.class-loading-system.dotted-name = server.jvm.class-loading-system server.jvm.class-loading-system.loadedclasscount-count = 7328 server.jvm.class-loading-system.loadedclasscount-description
= No Description was available server.jvm.class-loading-system.loadedclasscount-lastsampletime
= 1133819508973 server.jvm.class-loading-system.loadedclasscount-name
= LoadedClassCount? server.jvm.class-loading-system.loadedclasscount-starttime
= 1133819131268 server.jvm.class-loading-system.loadedclasscount-unit
= count server.jvm.class-loading-system.totalloadedclasscount-count
= 10285 server.jvm.class-loading-system.totalloadedclasscount-description
= No Description was available server.jvm.class-loading-system.totalloadedclasscount-lastsampletime
= 1133819508972 server.jvm.class-loading-system.totalloadedclasscount-name
= TotalLoadedClassCount? server.jvm.class-loading-system.totalloadedclasscount-starttime
= 1133819131268 server.jvm.class-loading-system.totalloadedclasscount-unit
= count server.jvm.class-loading-system.unloadedclasscount-count
= 2957 server.jvm.class-loading-system.unloadedclasscount-description
= No Description was available server.jvm.class-loading-system.unloadedclasscount-lastsampletime
= 1133819508973 server.jvm.class-loading-system.unloadedclasscount-name
= UnloadedClassCount? server.jvm.class-loading-system.unloadedclasscount-starttime
= 1133819131268 server.jvm.class-loading-system.unloadedclasscount-unit
= count
You cansee that 10285 is the total number of classes loaded by the Virtual
Machine. Whereas, 2957 is number of classes unloaded, since it was started.
,Similarly, you can explore attributes of the other subsystems as well.
|
Options
-
-t --terse
-
Indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well-formatted data for consumption by a script. Default is false.
-
-e --echo
-
Setting to true will echo the command line statement on the standard output. Default is false.
-
-I --interactive
-
If set to true (default), only the required password options are prompted.
-
-H --host
-
The machine name where the domain administration server is running. The default value is localhost.
-
-p --port
-
The HTTP/S port for administration. This is the port to which you should point your browser in order to manage the domain. For example, http://localhost:4848.
The default port number is 4848.
-
-s --secure
-
If set to true, uses SSL/TLS to communicate with the domain administration server.
-
-u --user
-
The authorized domain administration server administrative username.
If you have authenticated to a domain using the asadmin login command, then you need not specify the --user option on subsequent operations to this particular domain.
-
--passwordfile
-
The --passwordfile option specifies the name, including the full path, of a file containing the password entries in a specific format. The entry for the password must have the AS_ADMIN_ prefix followed by the password
name in uppercase letters.
For example, to specify the domain administration server password, use an entry with the following format: AS_ADMIN_PASSWORD=password, where password is the actual administrator password. Other passwords that can be
specified include AS_ADMIN_MAPPEDPASSWORD, AS_ADMIN_USERPASSWORD, and AS_ADMIN_ALIASPASSWORD.
All remote commands must specify the admin password to authenticate to the domain administration server, either through --passwordfile or asadmin login, or interactively on the command prompt. The asadmin login command
can be used only to specify the admin password. For other passwords, that must be specified for remote commands, use the --passwordfile or enter them at the command prompt.
If you have authenticated to a domain using the asadmin login command, then you need not specify the admin password through the --passwordfile option on subsequent operations to this particular domain. However, this is applicable only
to AS_ADMIN_PASSWORD option. You will still need to provide the other passwords, for example, AS_ADMIN_USERPASSWORD, as and when required by individual commands, such as update-file-user.
For security reasons, passwords specified as an environment variable will not be read by asadmin.
The default value for AS_ADMIN_MASTERPASSWORD is changeit.
-
--help
-
Displays the help text for the command.
Operands
-
attributename=value
-
identifies the attribute name and its value. See the Reference for a listing of the available attribute names.
Examples
Example 1 Using set
asadmin> set --user admin --passwordfile password.txt --host localhost
--port 4848 server.transaction-service.automatic-recovery=true
|
Exit Status
- 0
-
command executed successfully
- 1
-
error in executing the command
See Also
Java EE 5 Last Revised 22 Dec 2004
NAME
| Synopsis
| Description
| Options
| Operands
| Examples
| Exit Status
| See Also
|