本地测试远程Linux服务器JVM 调优

 1.找到flink安装路径,bin目录下,编辑config.sh文件(flink在执行flink-cluster.sh时会调用这个config.sh文件,这个文件是flink的环境变量等配置)

-Djava.rmi.server.hostname=192.169.1.0 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false 

2.启动Flink

./start-cluster.sh
 

在启动命令中添加如下信息

-Djava.rmi.server.hostname=192.169.1.0 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false 
 

解释
-Djava.rmi.server.hostname为java程序运行所在的机器ip
-Dcom.sun.management.jmxremote.port为端口,自定义,保证是未使用的端口即可。jconsole通过这个端口来连接。
-Dcom.sun.management.jmxremote.authenticate=false表示在jconsole连接时可以不用输入账号和密码
示例

nohup java  -Xms128M -Xmx256M  -Djava.rmi.server.hostname=192.169.1.71 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar appgateway-1.0.0.9.jar --spring.config.location=/usr/local/csnsh/ums/appgateway/application-appgateway.properties >appgateway.txt &

2、使用jvisualvm通过启动命令中的ip和端口进行连接

点击远程——》添加远程主机

 输入远程主机名,点击确定

 右键添加JMX连接,输入连接的ip和端口(上面启动命令中的ip和端口)

 点击确定,成功连接 ,右边是监控视图

然后配置点住右击 添加jxm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

꧁꫞ND꫞꧂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值