Configuration

1 TubeMQ configuration item description

The TubeMQ server includes two modules for the Master and the Broker. The Master also includes a Web front-end module for external page access (this part is stored in the resources). Considering the actual deployment, two modules are often deployed in the same machine, TubeMQ. The contents of the three parts of the two modules are packaged and delivered to the operation and maintenance; the client does not include the lib package of the server part and is delivered to the user separately.

Master and Broker use the ini configuration file format, and the relevant configuration files are placed in the master.ini and broker.ini files in the tubemq-server-3.9.0/conf/ directory: Configuration - 图1

Their configuration is defined by a set of configuration units. The Master configuration consists of four mandatory units: [master], [zookeeper], [bdbStore], and optional [tlsSetting]. The Broker configuration is mandatory. Broker], [zookeeper] and optional [tlsSetting] consist of a total of 3 configuration units; in actual use, you can also combine the contents of the two configuration files into one ini file.

In addition to the back-end system configuration file, the Master also stores the Web front-end page module in the resources. The root directory velocity.properties file of the resources is the Web front-end page configuration file of the Master. Configuration - 图2

2 Configuration item details:

2.1 master.ini file:

[master]

Master system runs the main configuration unit, required unit, the value is fixed to “[master]“

NameRequiredTypeDescription
hostNameyesstringThe host address of the master external service, required, must be configured on the NIC, is enabled, non-loopback and cannot be IP of 127.0.0.1
portnointMaster listening port, optional, default is 8715
webPortnointMaster web console access port, the default value is 8080
webResourcePathyesstringMaster Web Resource deploys an absolute path, which is required. If the value is set incorrectly, the web page will not display properly.
confModAuthTokennostringThe authorization Token provided by the operator when the change operation (including adding, deleting, changing configuration, and changing the master and managed Broker status) is performed by the Master’s Web or API. The value is optional. The default is “ASDFGHJKL”.
firstBalanceDelayAfterStartMsnolongMaster starts to the interval of the first time to start Rebalance, optional, default 30000 milliseconds
consumerBalancePeriodMsnolongThe master balances the rebalance period of the consumer group. The default is 60000 milliseconds. When the cluster size is large, increase the value.
consumerHeartbeatTimeoutMsnolongConsumer heartbeat timeout period, optional, default 30000 milliseconds, when the cluster size is large, please increase the value
producerHeartbeatTimeoutMsnolongProducer heartbeat timeout period, optional, default 30000 milliseconds, when the cluster size is large, please increase the value
brokerHeartbeatTimeoutMsnolongBroker heartbeat timeout period, optional, default 30000 milliseconds, when the cluster size is large, please increase the value
rebalanceParallelnointMaster rebalance parallelism, optional, default 4, the value range of this field is [1, 20], when the cluster size is large, please increase the value
socketRecvBuffernolongSocket receives the size of the Buffer buffer SO_RCVBUF, the unit byte, the negative number is set as the default value
socketSendBuffernolongSocket sends Buffer buffer SO_SNDBUF size, unit byte, negative number is set as the default value
maxAutoForbiddenCntnointWhen the broker has an IO failure, the maximum number of masters allowed to automatically go offline is the number of options. The default value is 5. It is recommended that the value does not exceed 10% of the total number of brokers in the cluster.
startOffsetResetChecknobooleanWhether to enable the check function of the client Offset reset function, optional, the default is false
needBrokerVisitAuthnobooleanWhether to enable Broker access authentication, the default is false. If true, the message reported by the broker must carry the correct username and signature information.
visitNamenostringThe username of the Broker access authentication. The default is an empty string. This value must exist when needBrokerVisitAuth is true. This value must be the same as the value of the visitName field in broker.ini.
visitPasswordnostringThe password for the Broker access authentication. The default is an empty string. This value must exist when needBrokerVisitAuth is true. This value must be the same as the value of the visitPassword field in broker.ini.
startVisitTokenChecknobooleanWhether to enable client visitToken check, the default is false
startProduceAuthenticatenobooleanWhether to enable production end user authentication, the default is false
startProduceAuthorizenobooleanWhether to enable production-side production authorization authentication, the default is false
startConsumeAuthenticatenobooleanWhether to enable consumer user authentication, the default is false
startConsumeAuthorizenobooleanWhether to enable consumer consumption authorization authentication, the default is false
maxGroupBrokerConsumeRatenointThe maximum ratio of the number of clustered brokers to the number of members in the consumer group. The default is 50. In a 50-kerrow cluster, one consumer group is allowed to start at least one client.
metaDataPathnostringMetadata storage path. Absolute, or relative to TubeMQ base directory ($BASE_DIR). Optional field, default is “var/meta_data”. Should be the same as “[bdbStore].bdbEnvHome” if upgrade from version prior 0.5.0.

[zookeeper]

The corresponding Tom MQ cluster of the Master stores the information about the ZooKeeper cluster of the Offset. The required unit has a fixed value of “[zookeeper]“.

NameRequiredTypeDescription
zkServerAddrnostringZk server address, optional configuration, defaults to “localhost:2181”
zkNodeRootnostringThe root path of the node on zk, optional configuration. The default is “/tube”.
zkSessionTimeoutMsnolongZk heartbeat timeout, in milliseconds, default 30 seconds
zkConnectionTimeoutMsnolongZk connection timeout, in milliseconds, default 30 seconds
zkSyncTimeMsnolongZk data synchronization time, in milliseconds, default 5 seconds
zkCommitPeriodMsnolongThe interval at which the Master cache data is flushed to zk, in milliseconds, default 5 seconds.

[replication]

Replication configuration for metadata storage replication and multi-node hot standby between Masters. The required unit has a fixed value of “[replication]“.

NameRequiredTypeDescription
repGroupNamenostringCluster name, the primary and backup master node values must be the same. Optional field, default is “tubemqMasterGroup”.
repNodeNameyesstringThe name of the master node in the cluster. The value of each node MUST BE DIFFERENT. Required field.
repNodePortnointNode communication port, optional field, default is 9001.
repHelperHostnostringPrimary node when the master cluster starts, optional field, default is “127.0.0.1:9001”.
metaLocalSyncPolicynointReplication data node local storage mode, the value range of this field is [1, 2, 3]. The default is 1: 1 is data saved to disk, 2 is data only saved to memory, and 3 is only data is written to file system buffer without flush.
metaReplicaSyncPolicynointReplication data node synchronization save mode, the value range of this field is [1, 2, 3]. The default is 1: 1 is data saved to disk, 2 is data only saved to memory, and 3 is only data is written to file system buffer without flush.
repReplicaAckPolicynointThe response policy of the replication node data synchronization, the value range of this field is [1, 2, 3], the default is 1: 1 is more than 1/2 majority is valid, 2 is valid for all nodes, 3 is not Need node response.
repStatusCheckTimeoutMsnolongReplication status check interval, optional field, in milliseconds, defaults to 10 seconds.

Notice:

  • Based on the need of Docker containerization, the [replication] above 3 parameters in the master.ini file are all the default settings used, and the actual information of the Master node needs to be configured when used in actual networking.
  • The IP information of all master nodes should be mapped to the hostName in the hosts configuration file, such as “10.10.11.205 10-10-11-205”
  • It is necessary to ensure the clock synchronization between all master nodes

[bdbStore]

Deprecated, config in “[replication]“ instead.

Master configuration of the BDB cluster to which the master belongs. The master uses BDB for metadata storage and multi-node hot standby. The required unit has a fixed value of “[bdbStore]“.

NameRequiredTypeDescription
bdbRepGroupNameyesstringBDB cluster name, the primary and backup master node values must be the same, required field
bdbNodeNameyesstringThe name of the node of the master in the BDB cluster. The value of each BDB node must not be repeated. Required field.
bdbNodePortnointBDB node communication port, optional field, default is 9001
bdbEnvHomeyesstringBDB data storage path, required field
bdbHelperHostyesstringPrimary node when the BDB cluster starts, required field
bdbLocalSyncnointBDB data node local storage mode, the value range of this field is [1, 2, 3]. The default is 1: 1 is data saved to disk, 2 is data only saved to memory, and 3 is only data is written to file system buffer. But not brush
bdbReplicaSyncnointBDB data node synchronization save mode, the value range of this field is [1, 2, 3]. The default is 1: 1 is data saved to disk, 2 is data only saved to memory, and 3 is only data is written to file system buffer. But not brush
bdbReplicaAcknointThe response policy of the BDB node data synchronization, the value range of this field is [1, 2, 3], the default is 1: 1 is more than 1/2 majority is valid, 2 is valid for all nodes, 3 is not Need node response
bdbStatusCheckTimeoutMsnolongBDB status check interval, optional field, in milliseconds, defaults to 10 seconds

[tlsSetting]

The Master uses TLS to encrypt the transport layer data. When TLS is enabled, the configuration unit provides related settings. The optional unit has a fixed value of “[tlsSetting]“.

NameRequiredTypeDescription
tlsEnablenobooleanWhether to enable TLS function, optional configuration, default is false
tlsPortnointMaster TLS port number, optional configuration, default is 8716
tlsKeyStorePathnostringThe absolute storage path of the TLS keyStore file + the name of the keyStore file. This field is required and cannot be empty when the TLS function is enabled.
tlsKeyStorePasswordnostringThe absolute storage path of the TLS keyStorePassword file + the name of the keyStorePassword file. This field is required and cannot be empty when the TLS function is enabled.
tlsTwoWayAuthEnablenobooleanWhether to enable TLS mutual authentication, optional configuration, the default is false
tlsTrustStorePathnostringThe absolute storage path of the TLS TrustStore file + the TrustStore file name. This field is required and cannot be empty when the TLS function is enabled and mutual authentication is enabled.
tlsTrustStorePasswordnostringThe absolute storage path of the TLS TrustStorePassword file + the TrustStorePassword file name. This field is required and cannot be empty when the TLS function is enabled and mutual authentication is enabled.

2.2 velocity.properties file:

NameRequiredTypeDescription
file.resource.loader.pathyesstringThe absolute path of the master web template. This part is the absolute path plus /resources/templates of the project when the master is deployed. The configuration is consistent with the actual deployment. If the configuration fails, the master front page access fails.

2.3 broker.ini file:

[broker]

The broker system runs the main configuration unit, required unit, and the value is fixed to “[broker]“

NameRequiredTypeDescription
brokerIdyesintServer unique flag, required field, can be set to 0; when set to 0, the system will default to take the local IP to int value
hostNameyesstringThe host address of the broker external service, required, must be configured in the NIC, is enabled, non-loopback and cannot be IP of 127.0.0.1
portnointBroker listening port, optional, default is 8123
webPortnointBroker’s http management access port, optional, default is 8081
masterAddressListyesstringMaster address list of the cluster to which the broker belongs. Required fields. The format must be ip1:port1, ip2:port2, ip3:port3.
primaryPathyesstringBroker stores the absolute path of the message, mandatory field
maxSegmentSizenointBroker stores the file size of the message data content, optional field, default 512M, maximum 1G
maxIndexSegmentSizenointBroker stores the file size of the message Index content, optional field, default 18M, about 70W messages per file
transferSizenointBroker allows the maximum message content size to be transmitted to the client each time, optional field, default is 512K
consumerRegTimeoutMsnolongConsumer heartbeat timeout, optional, in milliseconds, default 30 seconds
socketRecvBuffernolongSocket receives the size of the Buffer buffer SO_RCVBUF, the unit byte, the negative number is not set, the default value is
socketSendBuffernolongSocket sends Buffer buffer SO_SNDBUF size, unit byte, negative number is not set, the default value is
tcpWriteServiceThreadnointBroker supports the number of socket worker threads for TCP production services, optional fields, and defaults to 2 times the number of CPUs of the machine.
tcpReadServiceThreadnointBroker supports the number of socket worker threads for TCP consumer services, optional fields, defaults to 2 times the number of CPUs of the machine
logClearupDurationMsnolongThe aging cleanup period of the message file, in milliseconds. The default is 3 minutes for a log cleanup operation. The minimum is 1 minutes.
logFlushDiskDurMsnolongBatch check message persistence to file check cycle, in milliseconds, default is 20 seconds for a full check and brush
visitTokenCheckInValidTimeMsnolongThe length of the delay check for the visitToken check since the Broker is registered, in ms, the default is 120000, the value range [60000, 300000].
visitMasterAuthnobooleanWhether the authentication of the master is enabled, the default is false. If true, the user name and signature information are added to the signaling reported to the master.
visitNamenostringUser name of the access master. The default is an empty string. This value must exist when visitMasterAuth is true. The value must be the same as the value of the visitName field in master.ini.
visitPasswordnostringThe password for accessing the master. The default is an empty string. This value must exist when visitMasterAuth is true. The value must be the same as the value of the visitPassword field in master.ini.
logFlushMemDurMsnolongBatch check message memory persistence to file check cycle, in milliseconds, default is 10 seconds for a full check and brush

[zookeeper]

The Tube MQ cluster corresponding to the Broker stores the information about the ZooKeeper cluster of the Offset. The required unit has a fixed value of “[zookeeper]“.

NameRequiredTypeDescription
zkServerAddrnostringZk server address, optional configuration, defaults to “localhost:2181”
zkNodeRootnostringThe root path of the node on zk, optional configuration. The default is “/tube”.
zkSessionTimeoutMsnolongZk heartbeat timeout, in milliseconds, default 30 seconds
zkConnectionTimeoutMsnolongZk connection timeout, in milliseconds, default 30 seconds
zkSyncTimeMsnolongZk data synchronization time, in milliseconds, default 5 seconds
zkCommitPeriodMsnolongThe interval at which the broker cache data is flushed to zk, in milliseconds, default 5 seconds
zkCommitFailRetriesnointThe maximum number of re-brushings after Broker fails to flush cached data to Zk

[tlsSetting]

The Master uses TLS to encrypt the transport layer data. When TLS is enabled, the configuration unit provides related settings. The optional unit has a fixed value of “[tlsSetting]“.

NameRequiredTypeDescription
tlsEnablenobooleanWhether to enable TLS function, optional configuration, default is false
tlsPortnointBroker TLS port number, optional configuration, default is 8124
tlsKeyStorePathnostringThe absolute storage path of the TLS keyStore file + the name of the keyStore file. This field is required and cannot be empty when the TLS function is enabled.
tlsKeyStorePasswordnostringThe absolute storage path of the TLS keyStorePassword file + the name of the keyStorePassword file. This field is required and cannot be empty when the TLS function is enabled.
tlsTwoWayAuthEnablenobooleanWhether to enable TLS mutual authentication, optional configuration, the default is false
tlsTrustStorePathnostringThe absolute storage path of the TLS TrustStore file + the TrustStore file name. This field is required and cannot be empty when the TLS function is enabled and mutual authentication is enabled.
tlsTrustStorePasswordnostringThe absolute storage path of the TLS TrustStorePassword file + the TrustStorePassword file name. This field is required and cannot be empty when the TLS function is enabled and mutual authentication is enabled.

Back to top