< prev index next >

src/jdk.jstatd/share/man/jstatd.1

Print this page


   1 .\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.

   2 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   3 .\"
   4 .\" This code is free software; you can redistribute it and/or modify it
   5 .\" under the terms of the GNU General Public License version 2 only, as
   6 .\" published by the Free Software Foundation.
   7 .\"
   8 .\" This code is distributed in the hope that it will be useful, but WITHOUT
   9 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11 .\" version 2 for more details (a copy is included in the LICENSE file that
  12 .\" accompanied this code).
  13 .\"
  14 .\" You should have received a copy of the GNU General Public License version
  15 .\" 2 along with this work; if not, write to the Free Software Foundation,
  16 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17 .\"
  18 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19 .\" or visit www.oracle.com if you need additional information or have any
  20 .\" questions.
  21 .\"
  22 .\" Automatically generated by Pandoc 2.3.1
  23 .\"
  24 .TH "JSTATD" "1" "2018" "JDK 13" "JDK Commands"
  25 .hy
  26 .SH NAME
  27 .PP
  28 jstatd \- monitor the creation and termination of instrumented Java
  29 HotSpot VMs
  30 .SH SYNOPSIS

































  31 .PP
  32 \f[B]Note:\f[R] This command is experimental\ and unsupported.
  33 .PP
  34 \f[CB]jstatd\f[R] [\f[I]options\f[R]]
  35 .TP
  36 .B \f[I]options\f[R]
  37 This represents the \f[CB]jstatd\f[R] command\-line options.
  38 See \f[B]Options for the jstatd Command\f[R].
  39 .RS
  40 .RE
  41 .SH DESCRIPTION
  42 .PP
  43 The \f[CB]jstatd\f[R] command is an RMI server application that monitors
  44 for the creation and termination of instrumented Java HotSpot VMs and
  45 provides an interface to enable remote monitoring tools, \f[CB]jstat\f[R]
  46 and \f[CB]jps\f[R], to attach to JVMs that are running on the local host
  47 and collect information about the JVM process.
  48 .PP
  49 The \f[CB]jstatd\f[R] server requires an RMI registry on the local host.
  50 The \f[CB]jstatd\f[R] server attempts to attach to the RMI registry on the
  51 default port, or on the port you specify with the \f[CB]\-p\f[R]
  52 \f[CB]port\f[R] option.
  53 If an RMI registry is not found, then one is created within the
  54 \f[CB]jstatd\f[R] application that\[aq]s bound to the port that\[aq]s
  55 indicated by the \f[CB]\-p\f[R] \f[CB]port\f[R] option or to the default RMI
  56 registry port when the \f[CB]\-p\f[R] \f[CB]port\f[R] option is omitted.
  57 You can stop the creation of an internal RMI registry by specifying the
  58 \f[CB]\-nr\f[R] option.
  59 .SH OPTIONS FOR THE JSTATD COMMAND
  60 .TP
  61 .B \f[CB]\-nr\f[R]
  62 This option does not attempt to create an internal RMI registry within
  63 the \f[CB]jstatd\f[R] process when an existing RMI registry isn\[aq]t
  64 found.
  65 .RS
  66 .RE
  67 .TP
  68 .B \f[CB]\-p\f[R] \f[I]port\f[R]
  69 This option sets the port number where the RMI registry is expected to
  70 be found, or when not found, created if the \f[CB]\-nr\f[R] option
  71 isn\[aq]t specified.
  72 .RS
  73 .RE
  74 .TP
  75 .B \f[CB]\-n\f[R] \f[I]rminame\f[R]
  76 This option sets the name to which the remote RMI object is bound in the
  77 RMI registry.
  78 The default name is \f[CB]JStatRemoteHost\f[R].
  79 If multiple \f[CB]jstatd\f[R] servers are started on the same host, then
  80 the name of the exported RMI object for each server can be made unique
  81 by specifying this option.
  82 However, doing so requires that the unique server name be included in
  83 the monitoring client\[aq]s \f[CB]hostid\f[R] and \f[CB]vmid\f[R] strings.
  84 .RS
  85 .RE
  86 .TP
  87 .B \f[CB]\-J\f[R]\f[I]option\f[R]
  88 This option passes a Java \f[CB]option\f[R] to the JVM, where the option
  89 is one of those described on the reference page for the Java application
  90 launcher.
  91 For example, \f[CB]\-J\-Xms48m\f[R] sets the startup memory to 48 MB.
  92 See \f[B]java\f[R].
  93 .RS
  94 .RE
  95 .SH SECURITY
  96 .PP
  97 The \f[CB]jstatd\f[R] server can monitor only JVMs for which it has the
  98 appropriate native access permissions.
  99 Therefore, the \f[CB]jstatd\f[R] process must be running with the same
 100 user credentials as the target JVMs.
 101 Some user credentials, such as the root user in Oracle Solaris, Linux,
 102 and OS X operating systems, have permission to access the
 103 instrumentation exported by any JVM on the system.
 104 A \f[CB]jstatd\f[R] process running with such credentials can monitor any
 105 JVM on the system, but introduces additional security concerns.
 106 .PP
 107 The \f[CB]jstatd\f[R] server doesn\[aq]t provide any authentication of
 108 remote clients.
 109 Therefore, running a \f[CB]jstatd\f[R] server process exposes the
 110 instrumentation export by all JVMs for which the \f[CB]jstatd\f[R] process
 111 has access permissions to any user on the network.
 112 This exposure might be undesirable in your environment, and therefore,
 113 local security policies should be considered before you start the
 114 \f[CB]jstatd\f[R] process, particularly in production environments or on
 115 networks that aren\[aq]t secure.
 116 .PP
 117 The \f[CB]jstatd\f[R] server installs an instance of
 118 \f[CB]RMISecurityPolicy\f[R] when no other security manager is installed,
 119 and therefore, requires a security policy file to be specified.
 120 The policy file must conform to Default Policy Implementation and Policy
 121 File Syntax.
 122 .PP
 123 If your security concerns can\[aq]t be addressed with a customized
 124 policy file, then the safest action is to not run the \f[CB]jstatd\f[R]
 125 server and use the \f[CB]jstat\f[R] and \f[CB]jps\f[R] tools locally.
 126 However, when using \f[CB]jps\f[R] to get a list of instrumented JVMs, the
 127 list will not include any JVMs running in docker containers.
 128 .SH REMOTE INTERFACE
 129 .PP
 130 The interface exported by the \f[CB]jstatd\f[R] process is proprietary and
 131 guaranteed to change.
 132 Users and developers are discouraged from writing to this interface.
 133 .SH EXAMPLES
 134 .PP
 135 The following are examples of the \f[CB]jstatd\f[R] command.
 136 The \f[CB]jstatd\f[R] scripts automatically start the server in the
 137 background.
 138 .SH INTERNAL RMI REGISTRY
 139 .PP
 140 This example shows how to start a \f[CB]jstatd\f[R] session with an
 141 internal RMI registry.
 142 This example assumes that no other server is bound to the default RMI
 143 registry port (port \f[CB]1099\f[R]).
 144 .RS
 145 .PP
 146 \f[CB]jstatd\ \-J\-Djava.security.policy=all.policy\f[R]
 147 .RE
 148 .SH EXTERNAL RMI REGISTRY
 149 .PP
 150 This example starts a \f[CB]jstatd\f[R] session with an external RMI
 151 registry.
 152 .IP
 153 .nf
 154 \f[CB]
 155 rmiregistry&
 156 jstatd\ \-J\-Djava.security.policy=all.policy
 157 \f[R]
 158 .fi
 159 .PP
 160 This example starts a \f[CB]jstatd\f[R] session with an external RMI
 161 registry server on port \f[CB]2020\f[R].
 162 .IP
 163 .nf
 164 \f[CB]
 165 jrmiregistry\ 2020&
 166 jstatd\ \-J\-Djava.security.policy=all.policy\ \-p\ 2020
 167 \f[R]
 168 .fi
 169 .PP
 170 This example starts a \f[CB]jstatd\f[R] session with an external RMI
 171 registry on port 2020 that\[aq]s bound to
 172 \f[CB]AlternateJstatdServerName\f[R].
 173 .IP
 174 .nf
 175 \f[CB]
 176 rmiregistry\ 2020&
 177 jstatd\ \-J\-Djava.security.policy=all.policy\ \-p\ 2020\ \-n\ AlternateJstatdServerName
 178 \f[R]
 179 .fi
 180 .SH STOP THE CREATION OF AN IN\-PROCESS RMI REGISTRY
 181 .PP
 182 This example starts a \f[CB]jstatd\f[R] session that doesn\[aq]t create an
 183 RMI registry when one isn\[aq]t found.
 184 This example assumes an RMI registry is already running.
 185 If an RMI registry isn\[aq]t running, then an error message is
 186 displayed.
 187 .RS
 188 .PP
 189 \f[CB]jstatd\ \-J\-Djava.security.policy=all.policy\ \-nr\f[R]
 190 .RE
 191 .SH ENABLE RMI LOGGING
 192 .PP
 193 This example starts a \f[CB]jstatd\f[R] session with RMI logging
 194 capabilities enabled.
 195 This technique is useful as a troubleshooting aid or for monitoring
 196 server activities.
 197 .RS
 198 .PP
 199 \f[CB]jstatd\ \-J\-Djava.security.policy=all.policy\ \-J\-Djava.rmi.server.logCalls=true\f[R]
 200 .RE



   1 '\" t
   2 .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
   3 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 .\"
   5 .\" This code is free software; you can redistribute it and/or modify it
   6 .\" under the terms of the GNU General Public License version 2 only, as
   7 .\" published by the Free Software Foundation.
   8 .\"
   9 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 .\" version 2 for more details (a copy is included in the LICENSE file that
  13 .\" accompanied this code).
  14 .\"
  15 .\" You should have received a copy of the GNU General Public License version
  16 .\" 2 along with this work; if not, write to the Free Software Foundation,
  17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 .\"
  19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 .\" or visit www.oracle.com if you need additional information or have any
  21 .\" questions.
  22 .\"
  23 .\"     Arch: generic
  24 .\"     Software: JDK 8
  25 .\"     Date: 21 November 2013
  26 .\"     SectDesc: Monitoring Tools
  27 .\"     Title: jstatd.1
  28 .\"
  29 .if n .pl 99999
  30 .TH jstatd 1 "21 November 2013" "JDK 8" "Monitoring Tools"
  31 .\" -----------------------------------------------------------------
  32 .\" * Define some portability stuff
  33 .\" -----------------------------------------------------------------
  34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35 .\" http://bugs.debian.org/507673
  36 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  37 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38 .ie \n(.g .ds Aq \(aq
  39 .el       .ds Aq '
  40 .\" -----------------------------------------------------------------
  41 .\" * set default formatting
  42 .\" -----------------------------------------------------------------
  43 .\" disable hyphenation
  44 .nh
  45 .\" disable justification (adjust text to left margin only)
  46 .ad l
  47 .\" -----------------------------------------------------------------
  48 .\" * MAIN CONTENT STARTS HERE *
  49 .\" -----------------------------------------------------------------
  50 
  51 .SH NAME    
  52 jstatd \- Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs\&. This command is experimental and unsupported\&.
  53 .SH SYNOPSIS    
  54 .sp     
  55 .nf     
  56 
  57 \fBjstatd\fR [ \fIoptions\fR ]
  58 .fi     
  59 .sp     
  60 .TP     
  61 \fIoptions\fR
  62 The command-line options\&. See Options\&.
  63 .SH DESCRIPTION    
  64 The \f3jstatd\fR command is an RMI server application that monitors for the creation and termination of instrumented Java HotSpot VMs and provides an interface to enable remote monitoring tools to attach to JVMs that are running on the local host\&.
  65 .PP
  66 The \f3jstatd\fR server requires an RMI registry on the local host\&. The \f3jstatd\fR server attempts to attach to the RMI registry on the default port, or on the port you specify with the \f3-p\fR\f3port\fR option\&. If an RMI registry is not found, then one is created within the \f3jstatd\fR application that is bound to the port that is indicated by the \f3-p\fR\f3port\fR option or to the default RMI registry port when the \f3-p\fR\f3port\fR option is omitted\&. You can stop the creation of an internal RMI registry by specifying the \f3-nr\fR option\&.
  67 .SH OPTIONS    

  68 .TP
  69 -nr
  70 .br
  71 Does not attempt to create an internal RMI registry within the \f3jstatd\fR process when an existing RMI registry is not found\&.





















  72 .TP
  73 -p \fIport\fR
  74 .br
  75 The port number where the RMI registry is expected to be found, or when not found, created if the \f3-nr\fR option is not specified\&.



  76 .TP
  77 -n \fIrminame\fR
  78 .br
  79 Name to which the remote RMI object is bound in the RMI registry\&. The default name is \f3JStatRemoteHost\fR\&. If multiple \f3jstatd\fR servers are started on the same host, then the name of the exported RMI object for each server can be made unique by specifying this option\&. However, doing so requires that the unique server name be included in the monitoring client\&'s \f3hostid\fR and \f3vmid\fR strings\&.



  80 .TP
  81 -J\fIoption\fR
  82 .br
  83 Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
  84 .SH SECURITY    
  85 The \f3jstatd\fR server can only monitor JVMs for which it has the appropriate native access permissions\&. Therefore, the \f3jstatd\fR process must be running with the same user credentials as the target JVMs\&. Some user credentials, such as the root user in UNIX-based systems, have permission to access the instrumentation exported by any JVM on the system\&. A \f3jstatd\fR process running with such credentials can monitor any JVM on the system, but introduces additional security concerns\&.
  86 .PP
  87 The \f3jstatd\fR server does not provide any authentication of remote clients\&. Therefore, running a \f3jstatd\fR server process exposes the instrumentation export by all JVMs for which the \f3jstatd\fR process has access permissions to any user on the network\&. This exposure might be undesirable in your environment, and therefore, local security policies should be considered before you start the \f3jstatd\fR process, particularly in production environments or on networks that are not secure\&.
  88 .PP
  89 The \f3jstatd\fR server installs an instance of \f3RMISecurityPolicy\fR when no other security manager is installed, and therefore, requires a security policy file to be specified\&. The policy file must conform to Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
  90 .PP
  91 The following policy file allows the \f3jstatd\fR server to run without any security exceptions\&. This policy is less liberal than granting all permissions to all code bases, but is more liberal than a policy that grants the minimal permissions to run the \f3jstatd\fR server\&.
  92 .sp     
  93 .nf     
  94 \f3grant codebase "file:${java\&.home}/\&.\&./lib/tools\&.jar" {   \fP
  95 .fi     
  96 .nf     
  97 \f3    permission java\&.security\&.AllPermission;\fP
  98 .fi     
  99 .nf     
 100 \f3};\fP
 101 .fi     
 102 .nf     
 103 \f3\fP
 104 .fi     
 105 .sp     
 106 To use this policy setting, copy the text into a file called \f3jstatd\&.all\&.policy\fR and run the \f3jstatd\fR server as follows:
 107 .sp     
 108 .nf     
 109 \f3jstatd \-J\-Djava\&.security\&.policy=jstatd\&.all\&.policy\fP
 110 .fi     
 111 .nf     
 112 \f3\fP
 113 .fi     
 114 .sp     
 115 For sites with more restrictive security practices, it is possible to use a custom policy file to limit access to specific trusted hosts or networks, though such techniques are subject to IP address spoofing attacks\&. If your security concerns cannot be addressed with a customized policy file, then the safest action is to not run the \f3jstatd\fR server and use the \f3jstat\fR and \f3jps\fR tools locally\&.
 116 .SH REMOTE\ INTERFACE    
 117 The interface exported by the \f3jstatd\fR process is proprietary and guaranteed to change\&. Users and developers are discouraged from writing to this interface\&.
 118 .SH EXAMPLES    
 119 The following are examples of the \f3jstatd\fR command\&. The \f3jstatd\fR scripts automatically start the server in the background
 120 .SS INTERNAL\ RMI\ REGISTRY    
 121 This example shows hos to start a \f3jstatd\fR session with an internal RMI registry\&. This example assumes that no other server is bound to the default RMI registry port (port 1099)\&.
 122 .sp     
 123 .nf     
 124 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
 125 .fi     
 126 .nf     
 127 \f3\fP
 128 .fi     
 129 .sp     
 130 .SS EXTERNAL\ RMI\ REGISTRY    
 131 This example starts a \f3jstatd\fR session with a external RMI registry\&.
 132 .sp     
 133 .nf     
 134 \f3rmiregistry&\fP
 135 .fi     
 136 .nf     
 137 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
 138 .fi     
 139 .nf     
 140 \f3\fP
 141 .fi     
 142 .sp     
 143 This example starts a \f3jstatd\fR session with an external RMI registry server on port 2020\&.
 144 .sp     
 145 .nf     
 146 \f3jrmiregistry 2020&\fP
 147 .fi     
 148 .nf     
 149 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
 150 .fi     
 151 .nf     
 152 \f3\fP
 153 .fi     
 154 .sp     
 155 This example starts a \f3jstatd\fR session with an external RMI registry on port 2020 that is bound to \f3AlternateJstatdServerName\fR\&.
 156 .sp     
 157 .nf     
 158 \f3rmiregistry 2020&\fP
 159 .fi     
 160 .nf     
 161 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-p 2020\fP
 162 .fi     
 163 .nf     
 164 \f3    \-n AlternateJstatdServerName\fP
 165 .fi     
 166 .nf     
 167 \f3\fP
 168 .fi     
 169 .sp     
 170 .SS STOP\ THE\ CREATION\ OF\ AN\ IN-PROCESS\ RMI\ REGISTRY    
 171 This example starts a \f3jstatd\fR session that does not create an RMI registry when one is not found\&. This example assumes an RMI registry is already running\&. If an RMI registry is not running, then an error message is displayed\&.
 172 .sp     
 173 .nf     
 174 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy \-nr\fP
 175 .fi     
 176 .nf     
 177 \f3\fP
 178 .fi     
 179 .sp     
 180 .SS ENABLE\ RMI\ LOGGING    
 181 This example starts a \f3jstatd\fR session with RMI logging capabilities enabled\&. This technique is useful as a troubleshooting aid or for monitoring server activities\&.
 182 .sp     
 183 .nf     
 184 \f3jstatd \-J\-Djava\&.security\&.policy=all\&.policy\fP
 185 .fi     
 186 .nf     
 187 \f3    \-J\-Djava\&.rmi\&.server\&.logCalls=true\fP
 188 .fi     
 189 .nf     
 190 \f3\fP
 191 .fi     
 192 .sp     
 193 .SH SEE\ ALSO    
 194 .TP 0.2i    
 195 \(bu
 196 java(1)
 197 .TP 0.2i    
 198 \(bu
 199 jps(1)
 200 .TP 0.2i    
 201 \(bu
 202 jstat(1)
 203 .TP 0.2i    
 204 \(bu
 205 rmiregistry(1)
 206 .RE
 207 .br
 208 'pl 8.5i
 209 'bp
< prev index next >