Since 2.0.5
dubbo starts supporting to use telnet command to govern services.
telnet localhost 20880
Or:
echo status | nc -i 1 localhost 20880
The built-in telnet commands are listed below. Furthermore, it is possible to extend telnet commands, pls. refer to extend telnet command for more details.
ls
ls
: list servicesls -l
: list services in more detailsls XxxService
: list methods for the particular servicels -l XxxService
: list methods for the particular service in more dtailsps
ps
: list service portsps -l
: list service addressesps 20880
: show connection info for the particular portps -l 20880
: show connection info for the particular port in more detailscd
cd XxxService
: switch default service. When default service is set, service parameter can be ignored in all commands when it’s neededcd /
: reset default servicepwd
pwd
: show what current default service is
trace
trace XxxService
: trace method invocation once for the given servicetrace XxxService 10
: trace method invocations 10 times for the given servicetrace XxxService xxxMethod
: trace particular method invocation once for the given servicetrace XxxService xxxMethod 10
: trace particular method invocations 10 times for the given servicecount
count XxxService
: count method invocation once for the given servicecount XxxService 10
: count method invocations 10 times for the given servicecount XxxService xxxMethod
: count particular method invocation once for the given servicecount XxxService xxxMethod 10
: count particular method invocation 10 times for the given serviceinvoke
invoke XxxService.xxxMethod(1234, "abcd", {"prop" : "value"})
: invoke particular method for the given serviceinvoke com.xxx.XxxService.XxxService.xxxMethod(1234, "abcd", {"prop" : "value"})
: invoke particular method for the given serviceinvoke xxxMethod(1234, "abcd", {"prop" : "value"})
: invoke particular method for the default serviceinvoke xxxMethod({"name":"zhangsan","age":12,"class":"org.apache.dubbo.qos.legacy.service.Person"})
:When there is parameter overload, or the type conversion fails, you can specify the class to be converted by adding the class attributeinvoke com.xxx.xxxApiService({"3":0.123, "class":"java.util.HashMap"})
select
1select 1
: used when the invoke command matches multiple methods, select the method to be called according to the prompt liststatus
status
: show summarized status. This status summarizes statuses from all resources, and it shows OK when all resources are OK, shows ERROR when any resource has ERROR, and WARN when any has WARN.status -l
: show status listlog
2log debug
: modify logger level to debuglog 100
: examine the last 100 characters from the file loggerhelp
help
: show help for telnet commandshelp xxx
: show help for particular telnet commandclear
clear
: clear screenclear 100
: only clear particular lines on the screenexit
exit
: exit current telnet session
shutdown
1shutdown
: shutdown dubbo applicationshutdown -t 1000
: delay 1000 ms to shutdown dubbo application