Skip to main content
Version: Next Version

Seata parameter configuration version 0.9.0

Public sector​

keydescremark
transport.serializationclient and server communication codec methodseata, protobuf
transport.heartbeatthe heartbeat detection switch for client server communicationThe default value is true
registry.typeregistry typeDefault file, which supports file, nacos, redis, eureka, zk, consumer, etcd3, sofa, and custom; Version 1.6.0 Server supports simultaneous registration to multiple registries, separated by commas
config.typeconfiguration center typedefault file, supporting file, nacos, apollo, zk, consult, etcd3, springcloud, custom

Server side​

keydescremark
transaction.undo.log.save.daysundo retention days7 days by default, log_ Status=1 (Appendix 3) and undo not normally cleaned
transaction.undo.log.delete.periodundo Cleanup thread interval86400000 by default, in milliseconds
service.max.commit.retry.timeouttimeout duration of two-phase commit retryUnit: ms, s, m, h, d, corresponding to ms, s, min, h, d, and the default is ms. The default value of - 1 means unlimited retries. Formula: timeout>=now globalTransactionBeginTime, true means no retry if timeout occurs
service.max.rollback.retry.timeouttimeout duration of two-phase rollback retrySame as commit
recovery.committing-retry-periodPhase2 commit unfinished status Global transaction retry commit thread interval1000 by default, in milliseconds
recovery.async-committing-retry-periodPhase2 asynchronous submission status Retry submission thread interval1000 by default, in milliseconds
recovery.rollback-retry-periodPhase2 rollback status Retry rollback thread interval1000 by default, in milliseconds
recovery.timeout-retry-periodTimeout status detection Retry thread interval1000 by default, in milliseconds. If timeout is detected, put the global transaction into the rollback session manager
store.modeTransaction session information storage modefile Local file (HA is not supported), db database (HA is supported)
store.file.dirfile mode file storage folder namedefault sessionStore
store.file.maxBranchSessionSizefile mode file storage branch session maximum bytes16384 (16kb) by default, in bytes
store.file.maxGlobalSessionSizefile mode file stores the maximum number of global session bytes512b by default, in bytes
store.file.fileWriteBufferCacheSizefile mode file storage buffer maximum cache size16384 (16kb) by default, in bytes. When the amount of data such as session written is greater than this value, an exception will be thrown
store.file.flushDiskModefile mode file storage flushing policydefault async, optional sync
store.file.sessionReloadReadSizefile mode File storage The maximum number of session or lock keys recovered from the backup file after the server node restarts100 by default
store.db.datasourcedb mode data source typedefault dbcp
store.db.db typedb mode database typedefault mysql
store.db.driver class namedb mode database driverdefault com.mysql.jdbc Driver
store.db.urldb mode data source library urldefault jdbc: mysql://127.0.0.1:3306/seata
store.db.userdb mode database accountdefault MySQL
store.db.min-connthe number of initial connections to the database in db mode1 by default
store.db.max-connMaximum number of database connections in db mode3 by default
store.db.global.tabledb mode global transaction table namedefault global_ table
store.db.branch.tabledb mode branch transaction table namedefault branch_ table
store.db.lock tabledb mode global lock table namedefault lock_ table
store.db.query-limitthe maximum number of global transactions queried in db mode1000 by default
metrics.enabledwhether to enable MetricsFalse is off by default. In the false state, all Metrics related components will not be initialized to minimize the performance loss
metrics.registry-typeindicator registrar typeThe indicator registrar type used by Metrics is a built-in compact (simple) implementation by default. Meters in this implementation only use limited memory counts, and the performance is high enough to meet most scenarios; Currently, only one indicator registrar can be set
metrics.exporter listindicator result Measurement data outputter listdefault prometheus. Multiple outputters are separated by English commas, such as "prometheus, jmx". Currently, only the prometheus outputters are connected
metrics.exporter-prometheus-portprometheus exporter client port number9898 by default

Client side​

keyroledescremark
service.vgroup_mapping.my_test_tx_groupTM, RMTransaction group (Appendix 1)my_ test_ tx_ Group refers to grouping, and the configuration item value is TC cluster name
service.default.grouplistTM, RMTC service list (Appendix 2)Only used when the registry is file
service.disableGlobalTransactionTM, RMGlobal Transaction SwitchFalse by default. false is on, true is off
service.enableDegradationTMDegradation switch (to be implemented)False by default. The business side automatically downgrades according to the number of consecutive errors and does not go through the seata transaction
client.async.commit.buffer.limitRMAsynchronous commit cache queue length10000 by default. Phase II commit succeeded. RM asynchronously cleans the undo queue
client.lock.retry.internalRMCheck or occupy the global lock retry interval10 by default, in milliseconds
client.lock.retry.timesRMNumber of retries to verify or occupy the global lock30 by default
client.lock.retry.policy.branch-rollback-on-conflictRMThe lock policy when a branch transaction conflicts with other global rollback transactionsThe default is true. The local lock is released first to allow rollback to succeed
client.report.retry.countTM, RMNumber of TC retries for reporting the results of the first phase5 by default
client.tm.commit.retry.countTMThe number of TC retries for reporting the results of the first phase global submission1 by default, it is recommended to be greater than 1
client.tm.rollback.retry.countTMThe number of TC retries reported in the first phase global rollback results1 by default, and it is recommended to be greater than 1
client.table.meta.check.enableRMAutomatically refresh the table structure in the cacheDefault true
transaction.undo.data.validationRMPhase II rollback image verificationTrue is enabled by default, false is disabled
transaction.undo.log.serializationRMundo serialization methoddefault jackson
transaction.undo.log.tableRMUser defined undo table nameDefault undo_ log
support.spring.datasource.autoproxyRMData source auto proxy switchFalse is off by default

Not in used​

keydescremark
lock.modelock store modelocal、remote
lock.local
lock.remote

Appendix 1:​

Description of transaction grouping.

  1. What is a transaction group?

Transaction grouping is the resource logic of seata, similar to service instance. My in file.conf_ test_ tx_ A group is a transaction group.

  1. How to find the back-end cluster through transaction grouping?

First, the program configures transaction grouping (txServiceGroup parameter of GlobalTransactionScanner construction method), and the program will search for service.vgroup through the user configured configuration center_ mapping. Transaction grouping configuration item.

The value of the configuration item obtained is the name of the TC cluster. The program that obtains the cluster name constructs the service name through a certain prefix+cluster name. The service name of each configuration center is different. Get the service name, go to the corresponding registry, pull the service list of the corresponding service name, and get the real TC service list of the back-end.

  1. Why is the design so that the service name is not directly taken?

There is an additional layer to obtain the configuration of transaction groups to the mapping cluster. After this design, the transaction group can be used as the logical isolation unit of resources, which can quickly fail over when a failure occurs.

Appendix 2:​

About the grouplist question.

  1. When will the default.grouplist in file.conf be used?

It is used when registry.type=file. It is not read in other times.

  1. Can multiple value lists be configured for default.grouplist?

Multiple can be configured, which means cluster, but when store When mode=file, an error will be reported. The reason is that the file storage mode does not provide synchronization of local files, so you need to use store.mode=db to share data between TC clusters through db

  1. Is default.grouplist recommended?

Not recommended. For example, question 1, when registering It is used when type=file, which means that the real registry is not used here, and the health check mechanism without specific services cannot automatically remove the list when the tc is unavailable. It is recommended to use nacos, eureka, redis, zk, consumer, etcd3, and sofa. Registry. type=file or config The original purpose of type=file design is to enable users to quickly verify the seata service through direct connection without relying on a third-party registry or configuration center.

Appendix 3:​

log_ Status=1 is defensive. It means that a global rollback request is received, but it is uncertain whether the local transaction of a transaction branch has been executed. At this time, a piece of data with the same branch ID is inserted in advance, and the inserted false data is successful. If the local transaction continues to execute, the master key conflict will be automatically rolled back.

If the insertion is unsuccessful, it indicates that the local transaction has been completed, and the undo data is taken out for reverse rollback.