Skip to main content
版本:1.11.0

命令行工具

总览

除了 InLong Dashboard,你可以通过命令行工具来查看管理 InLong 的相关资源。

命令行工具可以在 InLong 的 bin 目录运行。

用法:

$ bin/inlongctl [options] [command] [command options]

命令:

  • list
  • describe
  • create
  • update
  • delete
  • log

同时也可以使用 --help 或者 -h 获取上述命令的帮助,例如:

$ bin/inlongctl list -h

配置

前往 inlong-manager 目录,修改 conf/application.properties 文件的以下配置即可。

server.host=127.0.0.1
server.port=8080
default.admin.user=admin
default.admin.password=inlong

List

list 用于展示相关资源的核心信息,并以表格的方式展示。

命令:

  • group
  • stream
  • source
  • sink
  • cluster
  • cluster-tag
  • cluster-node
  • user

group

$ bin/inlongctl list group

选项:

参数描述默认值
-g, --groupinlong group id,支持模糊查询
-s, --statusinlong group status ,可选值有:CREATEREJECTEDINITIALIZINGOPERATING
STARTEDFAILEDSTOPPEDFINISHEDDELETED
-n, --num最多显示条数10
group status 说明
group status描述
CREATE待提交、待审批状态
REJECTED审批被驳回
INITIALIZING配置中
OPERATING删除中、停止中以及重启中
STARTED配置成功以及重启成功
FAILED配置失败
STOPPED暂停
FINISHED停止
DELETED已删除

stream

$ bin/inlongctl list stream

选项:

参数描述默认值
-g, --group *inlong group id,该 inlong stream 所在的 inlong group

* 表示为必需参数

source

$ bin/inlongctl list source

选项:

参数描述默认值
-g, --group *inlong group id
-s, --stream *inlong stream id
-t, --typestream source type,可选值有:AUTO_PUSH, TUBEMQ, PULSAR, KAFKA, FILE, MYSQL_SQL,
MYSQL_BINLOG, POSTGRESQL, ORACLE, SQLSERVER, MONGODB, REDIS
stream source type 说明
stream source type描述
AUTO_PUSH自主推送
TUBEMQTubeMQ
PULSARPulsar
KAFKAKafka
FILE文件
MYSQL_SQLSQL
MYSQL_BINLOGBinlog
POSTGRESQLPostgreSQL
ORACLEOracle
SQLSERVERSQL server
MONGODBMongoDB
REDISRedis

sink

$ bin/inlongctl list sink

选项:

参数描述默认值
-g, --group *inlong group id
-s, --stream *inlong stream id,该 stream sink 所在的 inlong stream

cluster-tag

$ bin/inlongctl list cluster-tag

选项:

参数描述默认值
--tagcluster tag,集群标签,支持模糊查询

cluster

$ bin/inlongctl list cluster

选项:

参数描述默认值
--tagcluster tag
--typecluster type,可选值有:AGENT, TUBEMQ, PULSAR, DATAPROXY, KAFKA
cluster type 说明
cluster type描述
AGENTAgent
TUBEMQTubeMQ
PULSARPulsar
DATAPROXYDataProxy
KAFKAKafka

cluster-node

$ bin/inlongctl list cluster-node

选项:

参数描述默认值
--tag *cluster tag
--typecluster type,可选值有:AGENT, TUBEMQ, PULSAR, DATAPROXY, KAFKA

user

$ bin/inlongctl list user

选项:

参数描述默认值
-u, --usernameusername,支持模糊查询
--typeuser type,可选值有:ADMIN, OPERATOR
user type 说明
user type描述
ADMIN管理员
OPERATOR普通用户

Describe

describe 用于展示相关资源的详细信息,直接以 Json 格式展示。

命令:

  • group
  • stream
  • source
  • sink
  • cluster
  • cluster-tag
  • cluster-node
  • user

group

$ bin/inlongctl describe group

选项:

参数描述默认值
-g, --groupinlong group id,支持模糊查询
-s, --statusinlong group status ,可选值有:CREATEREJECTEDINITIALIZINGOPERATING
STARTEDFAILEDSTOPPEDFINISHEDDELETED
-n, --num最多显示条数10
group status 说明
group status描述
CREATE待提交、待审批状态
REJECTED审批被驳回
INITIALIZING配置中
OPERATING删除中、停止中以及重启中
STARTED配置成功以及重启成功
FAILED配置失败
STOPPED暂停
FINISHED停止
DELETED已删除

stream

$ bin/inlongctl describe stream

选项:

参数描述默认值
-g, --group *inlong group id,该 inlong stream 所在的 inlong group

source

$ bin/inlongctl describe source

选项:

参数描述默认值
-g, --group *inlong group id
-s, --stream *inlong stream id
-t, --typestream source type,可选值有:AUTO_PUSH, TUBEMQ, PULSAR, KAFKA, FILE, MYSQL_SQL,
MYSQL_BINLOG, POSTGRESQL, ORACLE, SQLSERVER, MONGODB, REDIS
stream source type 说明
stream source type描述
AUTO_PUSH自主推送
TUBEMQTubeMQ
PULSARPulsar
KAFKAKafka
FILE文件
MYSQL_SQLSQL
MYSQL_BINLOGBinlog
POSTGRESQLPostgreSQL
ORACLEOracle
SQLSERVERSQL server
MONGODBMongoDB
REDISRedis

sink

$ bin/inlongctl describe sink

选项:

参数描述默认值
-g, --group *inlong group id
-s, --stream *inlong stream id,该 stream sink 所在的 inlong stream

cluster-tag

$ bin/inlongctl describe cluster-tag

选项:

参数描述默认值
-id, --id *cluster tag id

cluster

$ bin/inlongctl describe cluster

选项:

参数描述默认值
-id, --id *cluster id

cluster-node

$ bin/inlongctl describe cluster-node

选项:

参数描述默认值
-id, --id *cluster node id

user

$ bin/inlongctl describe user

选项:

参数描述默认值
-id, --id *user id

Create

create 用于创建相关资源,目前通过使用 json 文件的方式创建

命令:

  • group
  • cluster
  • cluster-tag
  • cluster-node
  • user

group

$ bin/inlongctl create group

选项:

参数描述默认值
-f, --filejson 文件名称

json:

{
"groupInfo": {
"inlongGroupId": "test_group_ctl",
"inlongClusterTag": "default_cluster",
"mqType": "PULSAR"
},
"streamInfo": {
"inlongStreamId": "test_stream_ctl",
"fieldList": [
{
"fieldName": "name",
"fieldType": "string"
}
],
"sourceList": [
{
"sourceType": "FILE",
"sourceName": "test_source_ctl",
"agentIp": "127.0.0.1",
"pattern": "/data/test.txt"
}
],
"sinkList": [
{
"sinkType": "CLICKHOUSE",
"sinkName": "test_sink_ctl",
"dataNodeName": "test_clickhouse",
"dbName": "db_test",
"tableName": "table_test",
"flushInterval": 1,
"flushRecord": 1000,
"retryTimes": 3,
"engine": "Log",
"isDistributed": 1,
"sinkFieldList": [
{
"sourceFieldName": "name",
"sourceFieldType": "string",
"fieldName": "name",
"fieldType": "string"
}
]
}
]
}
}
  • 这是一个 filepulsarclickhouse 流向的示例,如果需要其它流向,只需要替换相应 sourcesink 部分

Source:

{ 
"sourceType": "FILE",
"sourceName": "test_source_ctl",
"agentIp": "127.0.0.1",
"pattern": "/data/test.txt"
}

Sink:

{
"sinkType": "CLICKHOUSE",
"sinkName": "test_sink_ctl",
"dataNodeName": "test_clickhouse",
"dbName": "db_test",
"tableName": "table_test",
"flushInterval": 1,
"flushRecord": 1000,
"retryTimes": 3,
"engine": "Log",
"isDistributed": 1,
"enableCreateResource": 1,
"sinkFieldList": []
}

cluster

$ bin/inlongctl create cluster

选项:

参数描述默认值
-f, --filejson 文件名称

json 示例:

{
"name": "test_cluster",
"url": "127.0.0.1:8080",
"clusterTags": "test_cluster_tag",
"extTag": null,
"description": null,
"inCharges": "admin",
"type": "PULSAR",
"adminUrl": "http://127.0.0.1:8080",
"tenant": "public"
}

cluster-tag

$ bin/inlongctl create cluster-tag

选项:

参数描述默认值
-f, --filejson 文件名称

json 示例:

{
"clusterTag": "test_cluster_tag",
"inCharges": "ctl",
"extParams": null,
"description": null
}

cluster-node

$ bin/inlongctl create cluster-node

选项:

参数描述默认值
-f, --filejson 文件名称

json 示例:

{
"parentId": 1,
"type": "AGENT",
"ip": "127.0.0.1",
"port": 8008,
"extParams": null,
"description": "null"
}

parentId 为该节点对应 cluster 的 id,可通过 list clusterdescribe cluster 查看

user

$ bin/inlongctl create user

选项:

参数描述默认值
-u, --username用户名称
-p, --password用户密码
-t, --type用户类型
-d, --day有效期

Update

update 用于修改相关资源,目前通过使用 json 文件的方式修改

命令:

  • cluster
  • cluster-tag
  • cluster-node
  • user

update 所需的 json 文件可以在 describe 得到的 json 上进行需要的修改即可。

cluster

$ bin/inlongctl update cluster

选项:

参数描述默认值
-f, --filejson 文件名称

cluster-tag

$ bin/inlongctl update cluster-tag

选项:

参数描述默认值
-f, --filejson 文件名称

cluster-node

$ bin/inlongctl update cluster-node

选项:

参数描述默认值
-f, --filejson 文件名称

user

$ bin/inlongctl update user

选项:

参数描述默认值
-u, --username用户名称
-p, --password新密码
-d, --day新有效期

Suspend

suspend 用于暂停 inlong 任务

命令:

  • group

group

$ bin/inlongctl suspend group

选项:

参数描述默认值
-g, --groupinlong group id

Restart

restart 用于重启 inlong 任务

命令:

  • group

group

$ bin/inlongctl restart group

选项:

参数描述默认值
-g, --groupinlong group id

Delete

delete 用于删除相关资源。

命令:

  • group
  • stream
  • source
  • sink
  • cluster
  • cluster-tag
  • cluster-node
  • user

group

$ bin/inlongctl delete group

选项:

参数描述默认值
-g, --groupinlong group id,支持模糊查询
-s, --statusinlong group status ,可选值有:CREATEREJECTEDINITIALIZINGOPERATING
STARTEDFAILEDSTOPPEDFINISHEDDELETED
-n, --num最多显示条数10
group status 说明
group status描述
CREATE待提交、待审批状态
REJECTED审批被驳回
INITIALIZING配置中
OPERATING删除中、停止中以及重启中
STARTED配置成功以及重启成功
FAILED配置失败
STOPPED暂停
FINISHED停止
DELETED已删除

stream

$ bin/inlongctl delete stream

选项:

参数描述默认值
-g, --group *inlong group id,该 inlong stream 所在的 inlong group

source

$ bin/inlongctl delete source

选项:

参数描述默认值
-g, --group *inlong group id
-s, --stream *inlong stream id
-t, --typestream source type,可选值有:AUTO_PUSH, TUBEMQ, PULSAR, KAFKA, FILE, MYSQL_SQL,
MYSQL_BINLOG, POSTGRESQL, ORACLE, SQLSERVER, MONGODB, REDIS
stream source type 说明
stream source type描述
AUTO_PUSH自主推送
TUBEMQTubeMQ
PULSARPulsar
KAFKAKafka
FILE文件
MYSQL_SQLSQL
MYSQL_BINLOGBinlog
POSTGRESQLPostgreSQL
ORACLEOracle
SQLSERVERSQL server
MONGODBMongoDB
REDISRedis

sink

$ bin/inlongctl delete sink

选项:

参数描述默认值
-g, --group *inlong group id
-s, --stream *inlong stream id,该 stream sink 所在的 inlong stream

cluster-tag

$ bin/inlongctl delete cluster-tag

选项:

参数描述默认值
-id, --id *cluster tag id

cluster

$ bin/inlongctl delete cluster

选项:

参数描述默认值
-id, --id *cluster id

cluster-node

$ bin/inlongctl delete cluster-node

选项:

参数描述默认值
-id, --id *cluster node id

user

$ bin/inlongctl delete user

选项:

参数描述默认值
-id, --id *user id

Log

创建任务流程之后,可以使用 log 命令查看任务各阶段的执行日志

命令:

  • group

group

$ bin/inlongctl log group

选项:

参数描述默认值
-g, --groupinlong group id,不支持模糊查询