java arthas的使用

java -jar arthas-boot.jar

 

## 找到 broker 進程號對應序號

 

tt -n 3 -t *AbstractHandler *

## 找到任意一個 index 號,如 1001

 

tt -i 1001 -w "target.clientChannelContextMap.keySet().toArray()"

## 列出所有 client 的連接,找到你要斷的連接序號在第幾個,如 1 (從0開始)

 

tt -i 1001 -w "target.clientChannelContextMap.keySet().toArray()[1]"

## 查看該連接

 

tt -i 1001 -w "target.clientChannelContextMap.keySet().toArray()[1].getChannel().close()"

## 執行斷連

 

tt -i 1007 -w "target.clientChannelContextMap.keySet().toArray()[0].getChannel().close()"

 

 

 

 

 

在容器裏 執行

 

java -jar arthas-boot.jar

 

## 找到 broker 進程號對應序號

 

tt -n 3 -t *BrokerServer *

## 找到任意一個 index 號,如 1001

 

tt -i 1001 -w "target.becomeSlave()"

## 直接調用becomeSlave

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章