Deploy TubeMQ Manager

All deploying files at inlong-tubemq-manager directory.

configuration

  • create tubemanager and account in MySQL.
  • Add mysql information in conf/application.properties:
  1. # mysql configuration for manager
  2. spring.datasource.url=jdbc:mysql://mysql_ip:mysql_port/tubemanager
  3. spring.datasource.username=mysql_username
  4. spring.datasource.password=mysql_password

start service

  1. $ bin/start-manager.sh

register TubeMQ cluster

  1. vim bin/init-tube-cluster.sh

replace the parameters below

  1. TUBE_MANAGER_IP=
  2. TUBE_MANAGER_PORT=
  3. TUBE_MASTER_IP=
  4. TUBE_MASTER_PORT=
  5. TUBE_MASTER_WEB_PORT=
  6. TUBE_MASTER_TOKEN=

then run:

  1. sh bin/init-tube-cluster.sh

this will create a cluster with id = 1, note that this operation should not be executed repeatedly.

Appendix: Other Operation interface

cluster

Query full data of clusterId and clusterName (get)

Example

【GET】 /v1/cluster

return value

  1. {
  2. "errMsg": "",
  3. "errCode": 0,
  4. "result": true,
  5. "data": "[{\"clusterId\":1,\"clusterName\":\"1124\", \"masterIp\":\"127.0.0.1\"}]"
  6. }

topic

add topicTask

parameter:

  1. type (required) request type, fill in the field: op_query
  2. clusterId (required) Request cluster id
  3. addTopicTasks (required) topicTasks, create task task json
  4. user (required) After the access authorization verification needs to verify the user, it is reserved here

addTopicTasks currently only includes one field as topicName After accessing the region design, a new region field will be added to represent brokers in different regions Currently an addTopicTask will create topics in all brokers in the cluster

AddTopicTasks is a list of the following objects, which can carry multiple create topic requests

  1. topicName (required) topic name

Example

【POST】 /v1/task?method=addTopicTask

  1. {
  2. "clusterId": "1",
  3. "addTopicTasks": [{"topicName": "1"}],
  4. "user": "test"
  5. }

return json

  1. {
  2. "errMsg": "There are topic tasks [a12322] already in adding status",
  3. "errCode": 200,
  4. "result": false,
  5. "data": ""
  6. }

If result is false, the writing task failed

Query whether a topic is successfully created (business can be written)
  1. clusterId (Required) Request cluster id
  2. topicName (Required) Query topic name
  3. user (Required) After the access authorization verification needs to verify the user, it is reserved here

example

【POST】 /v1/topic?method=queryCanWrite

  1. {
  2. "clusterId": "1",
  3. "topicName": "1",
  4. "user": "test"
  5. }

return json

  1. { "result":true, "errCode":0, "errMsg":"OK", }
  2. { "result":false, "errCode": 100, "errMsg":"topic test is not writable"}
  3. { "result":false, "errCode": 101, "errMsg":"no such topic in master"}

result is false as not writable