| 
          
         | 
         
          
          
             1、进入到 它位于JDK安装路径的bin目录里面 ,我的地址是:/usr/java/jdk1.8.0_111/bin 
 
  创建文件jstatd.all.policy  
 
  执行 
 
  vim jstatd.all.policy  
 grant codebase "file:${java.home}/../lib/tools.jar" { 
       permission java.security.AllPermission; 
};  在bin目录吓启动jstatd ./jstatd -J-Djava.security.policy=jstatd.all.policy -J-Djava.rmi.server.hostname=192.168.10.184 &  
   查看jstatd是否启动成功 [root@localhost ~]# jps -l     
4279 sun.tools.jstatd.Jstatd 
4431 sun.tools.jps.Jps 
[root@localhost ~]# netstat -anp|grep jstatd 
tcp6       0      0 :::1099                 :::*                    LISTEN      4279/./jstatd        
tcp6       0      0 :::52828                :::*                    LISTEN      4279/./jstatd        
unix  2      [ ]         STREAM     CONNECTED     37883    4279/./jstatd  
 
  本地电脑命令链接: 
 
 C:\Users\free>jps -l rmi://192.168.10.184 
RMI Registry not available at 192.168.10.184:1099 
Connection refused to host: 192.168.10.184; nested exception is: 
        java.net.ConnectException: Connection timed out: connect  
 
 解决:开放对应的端口 或者关闭防火墙 
 
     再次下执行: 
 
 C:\Users\free>jps -l rmi://192.168.10.184 
Error communicating with remote host: Connection refused to host: 127.0.0.1; nested exception is: 
        java.net.ConnectExce 
        ption: Connection refused: connect  
  
解决: 
 
     [root@localhost ~]# hostname -i 
::1 127.0.0.1 
[root@localhost ~]# hostname 192.168.10.184 
[root@localhost ~]# hostname -i 
192.168.10.184  
 
 再次执行: 
 
     C:\Users\free>jps -l rmi://192.168.10.184 
5630 sun.tools.jstatd.Jstatd 
4279 sun.tools.jstatd.Jstatd  
 
 执行成功 
					 
																	 
---------------------------- 
原文链接:https://blog.51cto.com/4925054/2411095 
 
程序猿的技术大观园:www.javathinker.net 
 
 
          
          
          
            
  
            [这个贴子最后由 admin 在 2021-02-04 21:32:11 重新编辑]
          
          
         | 
        
      
 
          |