Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs. This command is experimental and unsupported.

Synopsis

jstatd [ options ]

options

The command-line options. See Options.

Description

The jstatd 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.

The jstatd server requires an RMI registry on the local host. The jstatd server attempts to attach to the RMI registry on the default port, or on the port you specify with the -p port option. If an RMI registry is not found, then one is created within the jstatdapplication that is bound to the port that is indicated by the -p port option or to the default RMI registry port when the -p port option is omitted. You can stop the creation of an internal RMI registry by specifying the -nr option.

Options

-nr

Does not attempt to create an internal RMI registry within the jstatd process when an existing RMI registry is not found.

-p port

The port number where the RMI registry is expected to be found, or when not found, created if the -nr option is not specified.

-n rminame

Name to which the remote RMI object is bound in the RMI registry. The default name is JStatRemoteHost. If multiple jstatd 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 hostid and vmid strings.

-Joption

Passes option to the JVM, where option is one of the options described on the reference page for the Java application launcher. For example, -J-Xms48m sets the startup memory to 48 MB. See java(1).

Security

The jstatd server can only monitor JVMs for which it has the appropriate native access permissions. Therefore, the jstatd process must be running with the same user credentials as the target JVMs. Some user credentials, such as the root user in Solaris, Linux, and OS X operating systems, have permission to access the instrumentation exported by any JVM on the system. A jstatd process running with such credentials can monitor any JVM on the system, but introduces additional security concerns.

The jstatd server does not provide any authentication of remote clients. Therefore, running a jstatd server process exposes the instrumentation export by all JVMs for which the jstatd 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 jstatd process, particularly in production environments or on networks that are not secure.

The jstatd server installs an instance of RMISecurityPolicy 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

The following policy file allows the jstatd 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 jstatd server.

grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};

To use this policy setting, copy the text into a file called jstatd.all.policy and run the jstatd server as follows:

jstatd -J-Djava.security.policy=jstatd.all.policy

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 jstatd server and use the jstat and jps tools locally.

Remote Interface

The interface exported by the jstatd process is proprietary and guaranteed to change. Users and developers are discouraged from writing to this interface.

Examples

The following are examples of the jstatd command. The jstatd scripts automatically start the server in the background

Internal RMI Registry

This example shows how to start a jstatd session with an internal RMI registry. This example assumes that no other server is bound to the default RMI registry port (port 1099).

jstatd -J-Djava.security.policy=all.policy

External RMI Registry

This example starts a jstatd session with a external RMI registry.

rmiregistry&
jstatd -J-Djava.security.policy=all.policy

This example starts a jstatd session with an external RMI registry server on port 2020.

jrmiregistry 2020&
jstatd -J-Djava.security.policy=all.policy -p 2020

This example starts a jstatd session with an external RMI registry on port 2020 that is bound to AlternateJstatdServerName.

rmiregistry 2020&
jstatd -J-Djava.security.policy=all.policy -p 2020
-n AlternateJstatdServerName

Stop the Creation of an In-Process RMI Registry

This example starts a jstatd 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.

jstatd -J-Djava.security.policy=all.policy -nr

Enable RMI Logging

This example starts a jstatd session with RMI logging capabilities enabled. This technique is useful as a troubleshooting aid or for monitoring server activities.

jstatd -J-Djava.security.policy=all.policy
-J-Djava.rmi.server.logCalls=true

java监控工具jstatd-windows的更多相关文章

  1. Java监控工具介绍,VisualVm ,JProfiler,Perfino,Yourkit,Perf4J,JProbe,Java微基准测试

    本文是本人前一段时间做一个简单Java监控工具调研总结,主要包括VisualVm ,JProfiler,Perfino,Yourkit,Perf4J,JProbe,以及对Java微基准测试的简单介绍, ...

  2. java监控工具VisualVM

    java监控工具VisualVM https://visualvm.github.io/ https://visualvm.github.io/documentation.html https://h ...

  3. Java监控工具介绍,VisualVm ,JProfiler,Perfino,Yourkit,Perf4J,JProbe,Java微基准测试【转】

    Java监控工具介绍,VisualVm ,JProfiler,Perfino,Yourkit,Perf4J,JProbe,Java微基准测试[转] 本文是本人前一段时间做一个简单Java监控工具调研总 ...

  4. Java ssh 访问windows/Linux

     Java ssh 访问windows/Linux 工作中遇到的问题: Java code运行在一台机器上,需要远程到linux的机器同时执行多种命令.原来采用的方法是直接调用ssh命令或者调用pli ...

  5. 【JavaService】使用Java编写部署windows服务

    如果你玩windows系统,你对服务这个东西并不会陌生,服务可以帮我们做很多事情,在不影响用户正常工作的情况下,可以完成很多我们需要的需求. 众所周知,微软的visio studio内置的Servic ...

  6. 如何注册java程序为windows服务

    如何注册java 程序为windows 服务 最近想找个软件来控制电脑的关机时间,在网上找了几个,都是可视化界面的可以设置具体的关机时间的软件.由于我想编写的关机程序是运行在别人机器上,只能让该机器在 ...

  7. JVM 监控工具——jstatd

    1. 简介 jstatd是一个rmi的server应用,用于监控jvm的创建和结束,并且提供接口让监控工具(如visualvm)可以远程连接到本机的jvms . 注意是jvms,就是说运行jstatd ...

  8. java环境变量 windows centos 安装jdk

    windows: 1.安装jdk,注意不是jre 2. 计算机→属性→高级系统设置→高级→环境变量,选择下面的那个系统环境变量 3. 系统变量→新建 JAVA_HOME 变量 . 变量值填写jdk的安 ...

  9. 【JavaService】部署Java jar为Windows后台服务

    将Java jar文件部署为Windows后台服务有多种方法:Service Installer.Java service Wrapper.JavaService.exe等等.这里介绍下使用JavaS ...

  10. 在Java中兼容Windows和Linux的路径处理

    Linux中的路径使用'/',而Windows下正好相反'\',Java提供了以系统属性的方式获取路径分隔符: System.getProperty("file.separator" ...

随机推荐

  1. BZOJ-2618 [CQOI2006]凸多边形

    半平面交模版题.. #include <cstdlib> #include <cstdio> #include <cmath> #include <cstri ...

  2. [AGC004C] AND Grid [构造]

    题面: 传送门 思路: 一眼看上去是一道很迷的题目......直到我发现,红蓝色涂色的过程是互相独立的 而且最外围没有紫色 那么可以这样操作: 最左边一列全部红色,最右边一列全蓝 然后中间的一行红一行 ...

  3. Optimal Marks(optimal)

    Optimal Marks(optimal) 题目描述 定义无向图边的值为这条边连接的两个点的点权异或值. 定义无向图的值为无向图中所有边的值的和. 给定nn个点mm条边构成的图.其中有些点的权值是给 ...

  4. bzoj 2749 - 外星人

    Description 给定一个数的标准分解\(N= \prod_{i=1}^n p_i^{q_i}\) 其中\(p_i \le 10^5, q_i \le 10^9\) 求最小的\(x\)使得\(\ ...

  5. 洛谷 P1783 海滩防御

    题目描述 WLP同学最近迷上了一款网络联机对战游戏(终于知道为毛JOHNKRAM每天刷洛谷效率那么低了),但是他却为了这个游戏很苦恼,因为他在海边的造船厂和仓库总是被敌方派人偷袭.于是,WLP动用了他 ...

  6. 更改MVC3默认错误提示信息 模型验证 validation

    原文发布时间为:2011-07-20 -- 来源于本人的百度文章 [由搬家工具导入] Model Metadata and Validation Localization using Conventi ...

  7. SQL触发器的使用及语法

    原文发布时间为:2010-08-07 -- 来源于本人的百度文章 [由搬家工具导入] ===以下转qsfwy.javaeye.com/blog/424789定义: 何为触发器?在SQL Server里 ...

  8. SQL:某个字段重复的时候只查询出最后插入的那条

    原文发布时间为:2009-04-11 -- 来源于本人的百度文章 [由搬家工具导入] 数据库com中有下列数据 id,userid,tupian,time 1 3 3 2006.3.5 2 4 4 2 ...

  9. 编译程序加不加 -lpthread 的区别【转】

    转自:http://www.cnblogs.com/Swartz/articles/3939382.html 作者:Lokki 出处:http://www.cnblogs.com/Swartz/ 欢迎 ...

  10. shell特殊符号用法大全

      # 注释符号(Hashmark[Comments]) 1.在shell文件的行首,作为shebang标记,#!/bin/bash; 2. 其他地方作为注释使用,在一行中,#后面的内容并不会被执行, ...