Home  >  Article  >  Java  >  How to use SpringBoot integrated java diagnostic tool Arthas

How to use SpringBoot integrated java diagnostic tool Arthas

PHPz
PHPzforward
2023-05-11 23:58:122021browse

    springBoot integration method

    1. Pom file introduction

    
        com.taobao.arthas
        arthas-spring-boot-starter
        3.6.7
    

    2. Yaml file introduction

    arthas:
      # telnetPort、httpPort为 -1 ,则不listen telnet端口,为 0 ,则随机telnet端口
      # 如果是防止一个机器上启动多个 arthas端口冲突。可以配置为随机端口,或者配置为 -1,并且通过tunnel server来使用arthas。
      # ~/logs/arthas/arthas.log (用户目录下面)里可以找到具体端口日志
      telnetPort: -1
      httpPort: -1
      # 127.0.0.1只能本地访问,0.0.0.0则可网络访问,但是存在安全问题
      ip: 127.0.0.1
      appName: arthas_test
      # 默认情况下,会生成随机ID,如果 arthas agent配置了 appName,则生成的agentId会带上appName的前缀。
      agent-id: hsehdfsfghhwertyfad
      # tunnel-server地址
      tunnel-server: ws://127.0.0.1:7777/ws

    Here are suggestions The agent_id is configured in advance. Arthas are required for subsequent console connections.

    3. Download arthas-tunnel-server

    Remotely manage/connect multiple Agents through Arthas Tunnel Server/Client

    1. 下载arthas-tunnel-server-3.6.7-fatjar.jar
    https://github.com/alibaba/arthas/releases
    2. 运行
    windows
    java -jar arthas-tunnel-server-3.6.7-fatjar.jar
    linux
    nohup java -jar arthas-tunnel-server-3.6.7-fatjar.jar > /dev/null 2>&1 &
    3.登录查看注册上来的应用
    http://127.0.0.1:8080/actuator/arthas 登陆用户名是arthas
    密码在arthas tunnel server的日志里可以找到,比如:
    Using generated security password: 6e00d3bd-e2b3-4147-b959-63854347cdc1

    4. Start Arthas Tunnel Server and spring project

    How to use SpringBoot integrated java diagnostic tool Arthas

    5. Log in to Arthas Tunnel Server

    Enter the address: http://127.0.0.1:8080/ and enter agent_id. The interface is as shown below.

    How to use SpringBoot integrated java diagnostic tool Arthas

    6. Enter the command to test

    dashboard, the real-time data panel of the current system

    How to use SpringBoot integrated java diagnostic tool Arthas

    The above is the detailed content of How to use SpringBoot integrated java diagnostic tool Arthas. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete