The Seata Parameter Configuration
Change record
20201216(1.6.0):
The change records of configuration items from 1.4.0 to 1.6.0 are no longer maintained in a centralized manner. Please check the changes of relevant versions separately according to the configuration items
20200716(1.3.0):
1. Added the relevant configuration of store.redis
2. The nacos registry configuration group item has been added, and the values of the Server and Client must be consistent
3. Add the client.rm.sagaBranchRegisterEnable configuration item, which is false by default
20200421(1.2.0):
1. Add the registry.nacos.application attribute. The default value is seata server. The values on the server and client sides must be consistent
20200220(1.1.0):
1. The formats in the file.conf and registry.conf configuration files are uniformly converted to the hump format
2. Unify the default values of all configuration files (file.conf, registry.conf, seata spring boot starter)
3. Optimize the configuration of transaction grouping and TC cluster in seata spring boot starter
4. Remove client.support.spring.datasource.autoproxy and add @ EnableAutoDataSourceProxy
5. Add server.rollbackRetryTimeoutUnlockEnable configuration item, which is false by default
6. Add the transport.shutdown.wait configuration item. The default is 3 seconds
The annotation is used to enable the automatic proxy of the data source, and the proxy implementation method can be selected (see Appendix 5 for details)
20191221:
1. Add seata.enabled, client.report.success.enable
transport.enable-client-batch-send-request、client.log.exceptionRate
Attention attribute (see all attributes for detailed description)
Server side | client side |
---|---|
registry.type | registry.type |
config.type | config.type |
#store.mode=db requires the following configuration | service.vgroupMapping.my* test* tx_ group |
store.db.driverClassName | service.default. grouplist |
store.db.url | service. disableGlobalTransaction |
store.db.user | |
store.db.password | |
#store.mode=Redis requires the following configurations | |
store.redis.host | |
store.redis.port | |
store.redis.database | |
store.redis.password | |
#The following configurations are required for "store.mode=raft" | |
server.raft.group | |
server.raft.server-addr | |
server.raft.snapshot-interval |
All attributes
Public sector
key | desc | remark | change record |
---|---|---|---|
transport.type | Socket communication mode | TCP, UNIX* DOMAIN* SOCKET, default TCP | |
transport.server | socket channel type | NIO, NATIVE (select KQueue or Epoll according to the operating system type and socket communication mode. Note that Windows only supports NIO, and NATIVE mode will throw an exception) | |
transport.enableTmClientBatchSendRequest | TM Batch Send Request Message Switch | Default false | new in 1.5.1 version |
transport.enableRmClientBatchSendRequest | RM Batch Send Request Message Switch | Default true | new in 1.5.1 version |
transport.enableTcServerBatchSendResponse | TC Batch Send Reply Message Switch | Default false | new in 1.5.1 version |
transport.rpcRmRequestTimeout | RM sending request timeout | 30 seconds by default | new in 1.5.1 version |
transport.rpcTmRequestTimeout | TM sending request timeout | 30 seconds by default | new in 1.5.1 version |
transport.rpcTcRequestTimeout | TC sending request timeout | 30 seconds by default | new in 1.5.1 version |
transport.threadFactory. bossThreadSize | Netty communication model Boss group threads | Default 1 | |
transport.threadFactory. workerThreadSize | Netty communication model Worker group threads | The number of threads can be configured or the number of threads in a specific thread working mode can be selected. There are four default working modes of threads: Auto (2 _ CPU cores+1), Pin (CPU cores, applicable to computing intensive tasks), BusyPin (CPU cores+1, applicable to computing intensive and memory limited scenarios) Default (2 _ CPU cores, applicable to IO intensive tasks), the default value is Default mode | |
transport.shutdown. wait | Time to wait for service offline before the Netty thread pool on the server is closed | 3 seconds by default | |
transport.serialization | Client and server communication codec method | seata (ByteBuf), protobuf, kryo, hessian, default seata | |
transport.compressor | Compression method of communication data between client and server | none, gzip, zip, sevenz, bzip2, lz4, deflater, zstd, default none | Before 1.2.0: gzip 1.2.0: zip, sevenz, bzip2 1.3.0: lz4 1.4.1: deflater 1.5.1: zstd |
transport.heartbeat | The heartbeat detection switch for client server communication | The default value is true | |
Registry.type | Registry type | Default file, supports file, nacos, redis, eureka, zk, consumer, etcd3, sofa, and custom | 1.6.0 Server supports simultaneous registration to multiple registries, separating registry names with commas |
Config.type | Configuration center type | default file, supporting file, nacos, apollo, zk, consult, etcd3, springcloud, custom |
Server side
key | desc | remark | change record |
---|---|---|---|
server.undo.logSaveDays | undo retention days | 7 days by default, log_ Status=1 (Appendix 3) and undo not normally cleaned | |
server.undo.logDeletePeriod | undo Cleanup Thread Interval | 86,400,000 by default, in milliseconds | |
server.maxCommitRetryTimeout | Timeout duration of two-phase commit retry | Unit: ms, s, m, h, d, corresponding to ms, s, min, h, day, default ms. The default value of - 1 means unlimited retries. Formula: timeout>=now globalTransactionBeginTime, true means no more retries after timeout (Note: no retries will be made after the timeout is reached, and there is a risk of data inconsistency, unless the business can calibrate the data itself, otherwise use with caution) | |
server.maxRollbackRetryTimeout | Phase2 rollback retry timeout duration | Same as commit | |
server.recovery.committingRetryPeriod | Phase2 commit unfinished status Global transaction retry commit thread interval | 1000 by default, in milliseconds | |
server.recovery.asyncCommittingRetryPeriod | Phase2 asynchronous submission status Retry submission thread interval | 1000 by default, in milliseconds | |
server.recovery.rollbackRetryPeriod | Phase2 rollback status Retry rollback thread interval | 1000 by default, in milliseconds | |
server.recovery.timeoutRetryPeriod | Timeout status detection retry thread interval | 1000 by default, in milliseconds. If timeout is detected, put the global transaction into the rollback session manager | |
server.rollbackRetryTimeoutUnlockEnable | Whether to release the lock after the two-phase rollback timeout | False by default | |
server.distributedLockExpireTime | Server side transaction management global lock timeout | 10000 by default, in milliseconds | new in 1.5.1 version |
server.server.xaerNotaRetryTimeout | Retry timeout to prevent XA branch transactions from hanging | 60000 by default, in milliseconds | new in 1.5.1 version |
server.session.branchAsyncQueueSize | Branch transaction session asynchronously deletes the thread pool queue size | 5000 by default | new in 1.5.1 version |
server.session.enableBranchAsyncRemove | Asynchronous deletion switch of branch transaction session | Default false | new in 1.5.1 version |
server.enableParallelRequestHandle | Parallel processing switch for batch request messages | Default false | new in 1.5.2 version |
server.enableParallelHandleBranch | Two-phase Parallel Deployment Switch | false | new in 2.0.0 version |
server.raft.group | In the Raft storage mode, the transaction group corresponding to the group and client should be matched with the value. For example, service.vgroup-mapping.default_tx_group=default. | New in 2.0.0 version | |
server.raft.server-addr | The Raft cluster list is as follows: 192.168.0.111:9091, 192.168.0.112:9091, 192.168.0.113:9091 | New in 2.0.0 version | |
server.raft.snapshot-interval | How often to take a memory snapshot? The state machine is paused every time a snapshot is taken, but this can improve recovery speed when stopping | 默认 600 秒 | New in 2.0.0 version |
server.raft.apply-batch | Accumulate batches of tasks and submit them to the leader. | 32 | New in 2.0.0 version |
server.raft.max-append-bufferSize | Maximum size of the Raft log storage buffer | 262144 | New in 2.0.0 version |
server.raft.max-replicator-inflight-msgs | The maximum number of in-flight requests when pipeline requests are enabled | 256 | New in 2.0.0 version |
server.raft.disruptor-buffer-size | The size of the internal disruptor buffer may need to be increased appropriately in scenarios with high write throughput | 16384 | New in 2.0.0 version |
server.raft.election-timeout-ms | How long does it take to start a new election when there is no leader heartbeat for a long time | 1000 | New in 2.0.0 version |
server.raft.reporter-enabled | Raft monitor enable | false | New in 2.0.0 version |
server.raft.reporter-initial-delay | Monitor output interval | 60 | New in 2.0.0 version |
server.raft.serialization | raft log serialization type | jackson | New in 2.0.0 version |
server.raft.compressor | The compression methods supported for Raft log and snapshot are gzip, zstd, and lz4 | none | New in 2.0.0 version |
server.raft.sync | Synchronous flushing of Raft log to disk | true | New in 2.0.0 version |
server.applicationDataLimitCheck | enable checking of received client data | Default false | |
server.applicationDataLimit | limit of receiving client application data | Default 64000 | |
store.mode | Transaction session information storage mode | file Local file (HA is not supported), db database, redis, raft (HA is supported) | The 1.5.1 version uses lock and session for separate storage |
store.lock.mode | Transaction lock information storage method | file Local file (HA is not supported), db database, Redis (HA is supported); When the configuration is empty, take the store Mode configuration item value. It is not allowed to specify separately in Raft mode | New in 1.5.1 version, and session and lock can be stored separately |
store.session.mode | Transaction echo information storage method | file Local file (HA is not supported), db database, Redis (HA is supported); When the configuration is empty, take the store Mode configuration item value. It is not allowed to specify separately in Raft mode | New in 1.5.1 version, and session and lock can be stored separately |
store.publicKey | Public key for storing and decrypting passwords in db or Redis | supported in version 1.4.2 | |
store.file.dir | file mode file storage folder name | default sessionStore | |
store.file.maxBranchSessionSize | File mode file storage branch session maximum bytes | 16384 (16kb) by default, in bytes | |
store.file.maxGlobalSessionSize | File mode file stores the maximum number of global session bytes | 512b by default, in bytes | |
store.file.fileWriteBufferCacheSize | File mode file storage buffer maximum cache size | 16384 (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.flushDiskMode | file mode file storage flushing policy | default async, optional sync | |
store.file.sessionReloadReadSize | File mode File storage The maximum number of session or lock keys recovered from the backup file after the server node restarts | 100 by default | |
store.db.datasource | db mode data source type | dbcp, druid, hikari; No default value, store Must be specified when mode=db | |
store.db.dbType | db mode database type | mysql, oracle, db2, sqlserver, sybaee, h2, sqlite, access, postgresql, oceanbase; No default value, store Mode=db must be specified | |
store.db.driverClassName | db mode database driver | store Must be specified when mode=db | |
store.db.url | db mode database url | store When mode=db, it must be specified. When using MySQL as the data source, it is recommended to add 'rewriteBatchedStatements=true' to the connection parameters (see Appendix 7 for detailed reasons) | |
store.db.user | db mode database account | store Must be specified when mode=db | |
store.db.password | db mode database account password | store Must be specified when mode=db | |
store.db.minConn | initial connections of db mode database | 1 by default | |
store.db.maxConn | maximum number of connections to database in db mode | 20 by default | |
store.db.maxWait | the maximum waiting time for db mode to obtain a connection | 5000 by default, in milliseconds | |
store.db.globalTable | db mode global transaction table name | default global_ table | |
store.db.branchTable | db mode branch transaction table name | default branch_ table | |
store.db.LockTable | db mode global lock table name | default lock_ table | |
store.db.queryLimit | the maximum number of global transactions queried in db mode at one time | 100 by default | |
store.db.distributedLockTable | db mode Sever side transaction management global lock storage table name | default distributed_ Lock. Under multiple server clusters, only one server is guaranteed to handle the submission or rollback at the same time | New in 1.5.1 |
store.redis.mode | redis mode | default single, optional sentinel | New sentinel mode in 1.4.2 |
store.redis.single.host | The Redis host in stand-alone mode is compatible with versions earlier than 1.4.2. If this configuration is empty, select store.redis Host as a configuration item | New in 1.4.2 | |
store.redis.single.port | The port of Redis in stand-alone mode is compatible with versions earlier than 1.4.2. If this configuration is empty, select store.redis Port as a configuration item | New in 1.4.2 | |
store.redis.sentinel.masterName | Redis master database name in sentinel mode | New in 1.4.2 | |
store.redis.sentinel.sentinelHosts | sentinel hosts in sentinel mode | Multiple hosts are separated by commas | New in 1.4.2 |
store.redis.host | redis mode IP | Default 127.0.0.1 | Version 1.4.2 deprecated |
store.redis.port | redis mode port | 6379 by default | Version 1.4.2 is deprecated |
store.redis.maxConn | maximum connections in Redis mode | 10 by default | |
store.redis.minConn | minimum connections in Redis mode | 1 by default | |
store.redis.database | redis mode default library | default 0 | |
store.redis.password | redis mode password (optional) | null by default | |
store.redis.queryLimit | The maximum number of Redis queries at a time | 100 by default | |
store.redis.type | Redis operation type: lua, pippline | pippline | |
metrics.enabled | Whether to enable Metrics | False is off by default. In the false state, all Metrics related components will not be initialized to minimize the performance loss | |
metrics.registryType | Indicator registrar type | The indicator registrar type used by Metrics is a built-in compact (simple) implementation by default. Meters in this implementation only use a limited memory count, and the performance is high enough to meet most scenarios; Currently, only one indicator registrar can be set | |
metrics.exporterList | Index result Measurement data outputter list | default prometheus. Multiple outputters are separated by English commas, such as "prometheus, jmx". Currently, only the prometheus outputters are connected | |
metrics.exporterPrometheusPort | prometheus exporter client port number | 9898 by default |