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