Router Status Command

Router Status Command

Many traffic governance capabilities in Dubbo are implemented based on the Router. In production environments, if traffic results do not meet expectations, you can use the router status command to check the router’s status to locate potential issues.

Router Status Collection

getRouterSnapshot Command

Retrieve the grouping status of each layer of the router. (Only supports StateRouter)

Command: getRouterSnapshot {serviceName}

serviceName is the name of the service to collect, supports matching.

  1. dubbo>getRouterSnapshot com.dubbo.dubbointegration.BackendService
  2. com.dubbo.dubbointegration.BackendService@2c2e824a
  3. [ All Invokers:2 ] [ Valid Invokers: 2 ]
  4. MockInvokersSelector Total: 2
  5. [ Mocked -> Empty (Total: 0) ]
  6. [ Normal -> 172.18.111.187:20880,172.18.111.183:20880 (Total: 2) ]
  7. StandardMeshRuleRouter not support
  8. TagStateRouter not support
  9. ServiceStateRouter not support
  10. AppStateRouter not support
  11. TailStateRouter End
  12. dubbo>

enableRouterSnapshot Command

Enable router result collection mode.

Command: enableRouterSnapshot {serviceName}

serviceName is the name of the service to collect, supports matching.

  1. dubbo>enableRouterSnapshot com.dubbo.*
  2. OK. Found service count: 1. This will cause performance degradation, please be careful!
  3. dubbo>

disableRouterSnapshot Command

Disable router result collection mode.

Command: disableRouterSnapshot {serviceName}

serviceName is the name of the service to collect, supports matching.

  1. dubbo>disableRouterSnapshot com.dubbo.*
  2. OK. Found service count: 1
  3. dubbo>

getEnabledRouterSnapshot Command

Get the services that have collection enabled.

  1. dubbo>getEnabledRouterSnapshot
  2. com.dubbo.dubbointegration.BackendService
  3. dubbo>

getRecentRouterSnapshot Command

Obtain historical router status through the qos command. (Stores up to 32 results)

  1. dubbo>getRecentRouterSnapshot
  2. 1658224330156 - Router snapshot service com.dubbo.dubbointegration.BackendService from registry 172.18.111.184 on the consumer 172.18.111.184 using the dubbo version 3.0.9 is below:
  3. [ Parent (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) ] Input: 172.18.111.187:20880,172.18.111.183:20880 -> Chain Node Output: 172.18.111.187:20880,172.18.111.183:20880
  4. [ MockInvokersSelector (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: invocation.need.mock not set. Return normal Invokers. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  5. [ StandardMeshRuleRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: MeshRuleCache has not been built. Skip route. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  6. [ TagStateRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: Disable Tag Router. Reason: tagRouterRule is invalid or disabled ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  7. [ ServiceStateRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: Directly return. Reason: Invokers from previous router is empty or conditionRouters is empty. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  8. [ AppStateRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: Directly return. Reason: Invokers from previous router is empty or conditionRouters is empty. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  9. 1658224330156 - Router snapshot service com.dubbo.dubbointegration.BackendService from registry 172.18.111.184 on the consumer 172.18.111.184 using the dubbo version 3.0.9 is below:
  10. [ Parent (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) ] Input: 172.18.111.187:20880,172.18.111.183:20880 -> Chain Node Output: 172.18.111.187:20880,172.18.111.183:20880
  11. [ MockInvokersSelector (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: invocation.need.mock not set. Return normal Invokers. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  12. [ StandardMeshRuleRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: MeshRuleCache has not been built. Skip route. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  13. [ TagStateRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: Disable Tag Router. Reason: tagRouterRule is invalid or disabled ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  14. [ ServiceStateRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: Directly return. Reason: Invokers from previous router is empty or conditionRouters is empty. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  15. [ AppStateRouter (Input: 2) (Current Node Output: 2) (Chain Node Output: 2) Router message: Directly return. Reason: Invokers from previous router is empty or conditionRouters is empty. ] Current Node Output: 172.18.111.187:20880,172.18.111.183:20880
  16. ···
  17. dubbo>

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)