zoukankan      html  css  js  c++  java
  • 使用 JvisualVM 监控 spark executor

    使用 JvisualVM,需要先配置 java 的启动参数 jmx 

    正常情况下,如下配置

    -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false
    -Djava.rmi.server.hostname=<ip>
    -Dcom.sun.management.jmxremote.port=<port>
    

      然后如下连接即可

    但在 spark 中,不能指定具体的 ip 和 port,于是需要如下配置(相关参数 spark.executor.extraJavaOptions)

    -Dcom.sun.management.jmxremote
    -Dcom.sun.management.jmxremote.ssl=false
    -Dcom.sun.management.jmxremote.authenticate=false
    -Dcom.sun.management.jmxremote.port=0
    

      然后找到具体的 container,使用如下命令找到运行的线程,和 pid

    ps axu  | grep container_1549968021090_0088_01_000010
    

      然后通过 pid 找到对应的端口,

    sudo netstat -antp | grep 9697
    tcp        0      0 ::ffff:10.6.32.218:35735    :::*                        LISTEN      9697/java
    tcp        0      0 :::39045                    :::*                        LISTEN      9697/java
    tcp        0      0 :::44425                    :::*                        LISTEN      9697/java
    tcp        0      0 ::ffff:10.6.32.218:43998    ::ffff:10.6.37.16:16020     ESTABLISHED 9697/java
    tcp        0      0 ::ffff:10.6.32.218:48620    ::ffff:10.6.45.22:2181      ESTABLISHED 9697/java
    tcp        0      0 ::ffff:10.6.32.218:40082    ::ffff:10.6.33.75:2181      ESTABLISHED 9697/java
    tcp        0      0 ::ffff:10.6.32.218:54078    ::ffff:10.6.33.106:16020    ESTABLISHED 9697/java
    tcp        0      0 ::ffff:10.6.32.218:54342    ::ffff:10.6.40.161:45389    ESTABLISHED 9697/java
    tcp        0      0 ::ffff:10.6.32.218:34058    ::ffff:10.6.40.161:32967    ESTABLISHED 9697/java
    

      结果中看,疑似为39045或44425,稍微尝试一下即可连上对应的 spark executor

  • 相关阅读:
    html标签笔记
    C语言中的函数基础
    数组
    循环控制结构程序(goto、while、dowhile、 for)
    if语句+switch
    分支程序设计
    字符数据的输入与输出
    各类数值型数据之间的混合运算
    c语言概述及如何上机运行c程序
    [记录] Ubuntu 配置Apache虚拟站点
  • 原文地址:https://www.cnblogs.com/keepthinking/p/10380786.html
Copyright © 2011-2022 走看看