全部产品
云市场

Telnet 指令

更新时间:2020-02-04 15:49:45

SOFAArk 容器提供了一个简单的 telnet 服务端小工具,用于运行时查看容器状态,目前支持查看 Plugin 和 Biz 相关信息。

使用方式

使用 telnet 连接服务端,端口号为 1234, 例如:

  1. telnet localhost 1234

进入交互界面:

  1. telnet localhost 1234
  2. Trying 127.0.0.1...
  3. Connected to localhost.
  4. Escape character is '^]'.
  5. sofa-ark>
  6. sofa-ark>
  7. sofa-ark>

目前支持查看 Plugin 和 Biz 相关信息,相关命令可参考提示信息:

  1. sofa-ark>h
  2. Plugin Command Tips:
  3. USAGE: plugin [option...] [pluginName...]
  4. SAMPLE: plugin -m plugin-A plugin-B
  5. -h Shows the help message.
  6. -a Shows all plugin name.
  7. -m Shows the meta info of specified pluginName.
  8. -s Shows the service info of specified pluginName.
  9. -d Shows the detail info of specified pluginName.
  10. Biz Command Tips:
  11. USAGE: biz [option...] [arguments...]
  12. SAMPLE: biz -m bizIdentityA bizIdentityB.
  13. -h Shows the help message.
  14. -a Shows all biz.
  15. -m Shows the meta info of specified bizIdentity.
  16. -s Shows the service info of specified bizIdentity.
  17. -d Shows the detail info of specified bizIdentity.
  18. -i Install biz of specified bizIdentity or bizUrl.
  19. -u Uninstall biz of specified bizIdentity.
  20. -o Switch biz of specified bizIdentity.
  21. sofa-ark>

Plugin 命令

如提示信息所说,plugin 支持查看插件相关信息,包括类(资源)导入导出配置、插件打包配置等。例如:

  1. sofa-ark>plugin -md runtime-sofa-boot-plugin
  2. PluginName: runtime-sofa-boot-plugin
  3. Version: 3.1.3
  4. Priority: 1500
  5. Activator: com.alipay.sofa.runtime.integration.activator.SofaRuntimeActivator
  6. Export Packages: com.alipay.sofa.runtime.api.*,com.alipay.sofa.runtime.client.*,com.alipay.sofa.runtime.component.*,com.alipay.sofa.runtime.constants.*,com.alipay.sofa.runtime.integration.*,com.alipay.sofa.runtime.model.*,com.alipay.sofa.runtime.service.component,com.alipay.sofa.runtime.service.helper,com.alipay.sofa.runtime.spi.client,com.alipay.sofa.runtime.spi.component,com.alipay.sofa.runtime.spi.health,com.alipay.sofa.runtime.spi.log,com.alipay.sofa.runtime.spi.binding,com.alipay.sofa.runtime.spi.util,org.aopalliance.aop,org.aopalliance.intercept
  7. Import Packages: \
  8. Export Classes: com.alipay.sofa.runtime.service.binding.JvmBinding,com.alipay.sofa.runtime.SofaFramework,com.alipay.sofa.runtime.SofaRuntimeProperties,com.alipay.sofa.runtime.service.binding.JvmBindingParam,com.alipay.sofa.runtime.spi.service.ServiceProxy
  9. Import Classes: \
  10. Export Resources: \
  11. Import Resources: \
  12. GroupId: com.alipay.sofa
  13. ArtifactId: runtime-sofa-boot-plugin
  14. Version: 3.1.3
  15. URL: jar:file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/
  16. ClassLoader: com.alipay.sofa.ark.container.service.classloader.PluginClassLoader@420a63fb
  17. ClassPath: file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/log4j-api-2.11.1.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/aopalliance-1.0.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/log4j-to-slf4j-2.11.1.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/sofa-common-tools-1.0.18.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/log-sofa-boot-starter-1.0.18.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/runtime-sofa-boot-plugin-3.1.3.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/runtime-sofa-boot-starter-3.1.3.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/slf4j-api-1.7.25.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/hessian-3.3.6.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/javax.annotation-api-1.3.2.jar!/,file:/Users/qilong.zql/.m2/repository/com/alipay/sofa/runtime-sofa-boot-plugin/3.1.3/runtime-sofa-boot-plugin-3.1.3.jar!/lib/infra-sofa-boot-starter-3.1.3.jar!/
  18. sofa-ark>

其他命令可以查看提示信息,暂时不支持 -s 选项查看服务。

Biz 命令

biz 命令支持查看 biz 相关信息,也支持安装、卸载、激活等 biz 操作指令。例如:

  1. sofa-ark>biz -m mvc-two:0.0.1-SNAPSHOT
  2. BizName: mvc-two
  3. Version: 0.0.1-SNAPSHOT
  4. Priority: 100
  5. MainClass: com.example.mvctwo.MvcTwoApplication
  6. WebContextPath: another
  7. Deny Import Packages: \
  8. Deny Import Classes: \
  9. Deny Import Resources: \
  10. sofa-ark>

其他命令可以查看提示信息,暂时不支持 -s 选项查看服务。需要注意的是,Telnet 服务端只是 SOFAArk 提供的方便运行时查看信息工具,不推荐直接通过 telnet 指令在线上执行 Biz 操作指令,推荐使用 API 或者动态配置方式。