2

我目前正在编写通过 CLI 在本地安装流集扩展的代码。我要编写的一项检查是确保扩展适用于本地安装的流集版本。

当我尝试从 CLI 查询版本时,这就是我遇到的问题。

:) streamsets --version

Invalid sub-command

streamsets <SUB_COMMAND> [<SUB_COMMAND_ARGUMENTS>]

  Sub-commands:

    dc: Starts the Data Collector

    create-dc: Creates new instance of Data Collector

    cli: Data Collector CLI

    jks-cs: Java Keystore Credential Store

    stagelibs: Data Collector Stage library installer

    show-vault-id: Shows the user-id to authorize in Vault

    setup-mapr: Enables the MapR stage library for the detected
                MapR installation.
:( streamsets cli --version
Found unexpected parameters: [--version]
) streamsets dc --version

Invalid option(s)

streamsets dc <OPTIONS>

  Options:
    -verbose          : prints out Data Collector detailed environment settings
    -exec             : starts Data Collector JVM within the same process of the script
    -skipenvsourcing  : skips the sourcing of the libexec/sdc-env.sh file

除了遍历文件系统并查找文件之外,我如何确定安装了哪个版本的流集VERSION

4

1 回答 1

3

ping您可以使用 CLI 的命令获取数据收集器的信息,包括版本:

$ streamsets cli -U http://localhost:18630 ping
{
  "info" : {
    "built.date" : "2018-06-13T23:02Z",
    "version" : "3.4.0-SNAPSHOT",
    "built.repo.sha" : "9f803ed0f5167bbb91af2493b20c9a20b566106f",
    "source.md5.checksum" : "1d59dbb2281a974f4b192a28efe7624c",
    "built.by" : "pat"
  },
  "version" : "3.4.0-SNAPSHOT",
  "builtDate" : "2018-06-13T23:02Z",
  "builtBy" : "pat",
  "builtRepoSha" : "9f803ed0f5167bbb91af2493b20c9a20b566106f",
  "sourceMd5Checksum" : "1d59dbb2281a974f4b192a28efe7624c"
}

system info是同义词ping

这(尚未)记录在案。我会打开一个 doc Jira 来这样做。

于 2018-06-14T23:47:32.943 回答