一、环境准备
- 新建配置字典
详细配置,具体解释请参考官网说明
spring:
application:
name: seata-server
server:
port: 7091
console:
user:
username: seata
password: seata
logging:
config: classpath:logback-spring.xml
file:
path: ${log.home:${user.home}/logs/seata}
seata:
security:
tokenValidityInMilliseconds: 3600000
secretKey: 36718159868
config:
# support: nacos 、 consul 、 apollo 、 zk 、 etcd3
type: nacos
nacos:
server-addr: 192.168.31.111:30568
namespace: 980e91eb-c942-4fc9-b8b4-d96f3e4e6eb7
group: DEFAULT_GROUP
username: nacos
password: 123456
context-path:
data-id: seata-server.yaml
registry:
# support: nacos 、 eureka 、 redis 、 zk 、 consul 、 etcd3 、 sofa
type: nacos
nacos:
application: seata-server
server-addr: 192.168.31.111:30568
group: SEATA_GROUP
namespace: 980e91eb-c942-4fc9-b8b4-d96f3e4e6eb7
username: nacos
password: 123456
context-path:
server:
raft:
group: default
cluster:
snapshot-interval: 600
apply-batch: 32
max-append-bufferSize: 262144
max-replicator-inflight-msgs: 256
disruptor-buffer-size: 16384
election-timeout-ms: 1000
reporter-enabled: false
reporter-initial-delay: 60
serialization: jackson
compressor: none
sync: true # sync log&snapshot to disk
service-port: 8091 #If not configured, the default is '${server.port} + 1000'
max-commit-retry-timeout: -1
max-rollback-retry-timeout: -1
rollback-retry-timeout-unlock-enable: false
enable-check-auth: true
enable-parallel-request-handle: true
enable-parallel-handle-branch: false
retry-dead-threshold: 130000
xaer-nota-retry-timeout: 60000
enableParallelRequestHandle: true
recovery:
committing-retry-period: 1000
async-committing-retry-period: 1000
rollbacking-retry-period: 1000
timeout-retry-period: 1000
undo:
log-save-days: 7
log-delete-period: 86400000
session:
branch-async-queue-size: 5000 #branch async remove queue size
enable-branch-async-remove: false #enable to asynchronous remove branchSession
metrics:
enabled: false
registry-type: compact
exporter-list: prometheus
exporter-prometheus-port: 9898
transport:
rpc-tc-request-timeout: 15000
enable-tc-server-batch-send-response: false
shutdown:
wait: 3
thread-factory:
boss-thread-prefix: NettyBoss
worker-thread-prefix: NettyServerNIOWorker
boss-thread-size: 1
数据库初始化脚本请参考官网脚本直接下载执行,数据库替换为你新建的数据库
创建服务工作负载
挂在存储卷 详细路径: /seata-server/conf/application.yml