欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

SpringBoot整合java診斷工具Arthas解讀

 更新時(shí)間:2023年03月11日 10:27:17   作者:LoveDR_1995  
這篇文章主要介紹了SpringBoot整合java診斷工具Arthas,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

一、Arthas官方文檔

https://arthas.aliyun.com/doc/

二、springBoot整合方式

1、pom文件引入

<dependency>
    <groupId>com.taobao.arthas</groupId>
    <artifactId>arthas-spring-boot-starter</artifactId>
    <version>3.6.7</version>
</dependency>

2、yaml文件引入

arthas:
  # telnetPort、httpPort為 -1 ,則不listen telnet端口,為 0 ,則隨機(jī)telnet端口
  # 如果是防止一個(gè)機(jī)器上啟動(dòng)多個(gè) arthas端口沖突。可以配置為隨機(jī)端口,或者配置為 -1,并且通過tunnel server來使用arthas。
  # ~/logs/arthas/arthas.log (用戶目錄下面)里可以找到具體端口日志
  telnetPort: -1
  httpPort: -1
  # 127.0.0.1只能本地訪問,0.0.0.0則可網(wǎng)絡(luò)訪問,但是存在安全問題
  ip: 127.0.0.1
  appName: arthas_test
  # 默認(rèn)情況下,會(huì)生成隨機(jī)ID,如果 arthas agent配置了 appName,則生成的agentId會(huì)帶上appName的前綴。
  agent-id: hsehdfsfghhwertyfad
  # tunnel-server地址
  tunnel-server: ws://127.0.0.1:7777/ws

這里建議agent_id提前配置好。后續(xù)的控制臺(tái)連接arthas需要使用。

3、下載arthas-tunnel-server

通過Arthas Tunnel Server/Client 來遠(yuǎn)程管理/連接多個(gè)Agent

1. 下載arthas-tunnel-server-3.6.7-fatjar.jar
https://github.com/alibaba/arthas/releases
2. 運(yùn)行
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.登錄查看注冊(cè)上來的應(yīng)用
http://127.0.0.1:8080/actuator/arthas 登陸用戶名是arthas
密碼在arthas tunnel server的日志里可以找到,比如:
Using generated security password: 6e00d3bd-e2b3-4147-b959-63854347cdc1

4、啟動(dòng)Arthas Tunnel Server及spring項(xiàng)目

5、登錄Arthas Tunnel Server

輸入地址:http://127.0.0.1:8080/并輸入agent_id,界面如下圖。

6、輸入命令進(jìn)行測試

dashboard,當(dāng)前系統(tǒng)的實(shí)時(shí)數(shù)據(jù)面板

其他命令列表查看https://arthas.aliyun.com/doc/commands.html

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論