# Copyright 1999-2019 Seata.io Group. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # 端口 server: port:7091 # 应用名称 spring: application: name:seata-server # 日志目录 logging: config:classpath:logback-spring.xml file: path:${user.home}/logs/seata extend: logstash-appender: destination:127.0.0.1:4560 kafka-appender: bootstrap-servers:127.0.0.1:9092 topic:logback_to_logstash # 控制台账号密码 console: user: username:seata password:seata # 核心配置 seata: # 配置中心 config: # support: nacos, consul, apollo, zk, etcd3 type:file # 注册中心 registry: # support: nacos, eureka, redis, zk, consul, etcd3, sofa type:file # 存储方式 store: # support: file 、 db 、 redis mode:file # server: # service-port: 8091 #If not configured, the default is '${server.port} + 1000' # 控制台配置[不能少,少了报错] security: secretKey:SeataSecretKey0c382ef121d778043159209298fd40bf3850a017 tokenValidityInMilliseconds:1800000 ignore: urls:/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login
# Copyright 1999-2019 Seata.io Group. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # 端口 server: port:7091 # 应用名称 spring: application: name:seata-server # 日志目录 logging: config:classpath:logback-spring.xml file: path:${user.home}/logs/seata extend: logstash-appender: destination:127.0.0.1:4560 kafka-appender: bootstrap-servers:127.0.0.1:9092 topic:logback_to_logstash # 控制台账号密码 console: user: username:seata password:seata # 核心配置 seata: config: # support: nacos, consul, apollo, zk, etcd3 type:nacos nacos: server-addr:172.148.2.18:8848# nacos的访问地址 namespace:6a5305df-a5cf-4ebd-8250-2446506dbfcd group:SEATA_GROUP# nacos的分组 username:nacos# nacos的用户名 password:nacos# nacos的密码 context-path: ##if use MSE Nacos with auth, mutex with username/password attribute #access-key: #secret-key: data-id:seata.properties# nacos中的配置文件名称 registry: # support: nacos, eureka, redis, zk, consul, etcd3, sofa type:nacos nacos: application:seata-server# seata启动后在nacos的服务名 server-addr:172.148.2.18:8848# nacos的访问地址 group:SEATA_GROUP# nacos的分组 namespace:6a5305df-a5cf-4ebd-8250-2446506dbfcd cluster:default# 这个参数在每个微服务seata时会用到 username:nacos# nacos的用户名 password:nacos# nacos的密码 context-path: store: # support: file 、 db 、 redis mode:db db: datasource:druid db-type:mysql driver-class-name:com.mysql.jdbc.Driver url:jdbc:mysql://172.148.2.18:3306/seata?characterEncoding=utf8&connectTimeout=10000&socketTimeout=30000&autoReconnect=true&useUnicode=true&useSSL=false user:root password:123456 min-conn:10# db 模式数据库初始连接数 max-conn:100# db 模式数据库最大连接数 global-table:global_table# db 模式全局事务表名 branch-table:branch_table# db 模式分支事务表名 lock-table:lock_table# db 模式全局锁表名 distributed-lock-table:distributed_lock# db 模式 Sever 端事务管理全局锁存储表名 query-limit:1000# db 模式查询全局事务一次的最大条数,默认100 max-wait:5000# db 模式获取连接时最大等待时间,默认5000 # server: # service-port: 8091 #If not configured, the default is '${server.port} + 1000' security: secretKey:SeataSecretKey0c382ef121d778043159209298fd40bf3850a017 tokenValidityInMilliseconds:1800000 ignore: urls:/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login
08:40:46.722 INFO --- [ main] io.seata.server.ServerApplication : Starting ServerApplication v1.6.1 using Java 1.8.0_312 on centos8 with PID 73594 (/opt/seata/seata-1.6.1/target/seata-server.jar started by root in /opt/seata/seata-1.6.1/bin) 08:40:46.724 INFO --- [ main] io.seata.server.ServerApplication : No active profile set, falling back to 1default profile: "default" 08:40:47.449 INFO --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 7091 (http) 08:40:47.455 INFO --- [ main] o.a.coyote.http11.Http11NioProtocol : Initializing ProtocolHandler ["http-nio-0.0.0.0-7091"] 08:40:47.456 INFO --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 08:40:47.456 INFO --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.62] 08:40:47.495 INFO --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 08:40:47.495 INFO --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 750 ms 08:40:47.788 INFO --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: classpath resource [static/index.html] 08:40:47.889 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.889 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/'] with [] 08:40:47.889 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.css']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.889 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.css'] with [] 08:40:47.889 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.js']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.js'] with [] 08:40:47.890 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.html']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.html'] with [] 08:40:47.890 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.map']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.map'] with [] 08:40:47.890 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.svg']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.svg'] with [] 08:40:47.890 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.png']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.png'] with [] 08:40:47.890 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/**/*.ico']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/**/*.ico'] with [] 08:40:47.890 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/console-fe/public/**']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/console-fe/public/**'] with [] 08:40:47.890 WARN --- [ main] o.s.s.c.a.web.builders.WebSecurity : You are asking Spring Security to ignore Ant [pattern='/api/v1/auth/login']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead. 08:40:47.890 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure Ant [pattern='/api/v1/auth/login'] with [] 08:40:47.904 INFO --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will not secure any request 08:40:47.922 INFO --- [ main] o.a.coyote.http11.Http11NioProtocol : Starting ProtocolHandler ["http-nio-0.0.0.0-7091"] 08:40:47.942 INFO --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 7091 (http) with context path '' 08:40:47.948 INFO --- [ main] io.seata.server.ServerApplication : Started ServerApplication in 2.067 seconds (JVM running for2.482) 08:40:48.518 INFO --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 08:40:48.556 INFO --- [ main] c.a.n.client.config.impl.ClientWorker : [fixed-192.168.2.234_8848-6a5305df-a5cf-4ebd-8250-2446506dbfcd] [subscribe] store.db.distributedLockTable+SEATA_GROUP+6a5305df-a5cf-4ebd-8250-2446506dbfcd 08:40:48.557 INFO --- [ main] c.a.nacos.client.config.impl.CacheData : [fixed-192.168.2.234_8848-6a5305df-a5cf-4ebd-8250-2446506dbfcd] [add-listener] ok, tenant=6a5305df-a5cf-4ebd-8250-2446506dbfcd, dataId=store.db.distributedLockTable, group=SEATA_GROUP, cnt=1 08:40:48.557 INFO --- [ main] c.a.nacos.client.config.impl.CacheData : [fixed-192.168.2.234_8848-6a5305df-a5cf-4ebd-8250-2446506dbfcd] [add-listener] ok, tenant=6a5305df-a5cf-4ebd-8250-2446506dbfcd, dataId=store.db.distributedLockTable, group=SEATA_GROUP, cnt=2 08:40:48.557 ERROR --- [ main] i.s.s.s.d.l.DataBaseDistributedLocker : The distribute lock table is not config, please create the target table and config it 08:40:48.661 INFO --- [ main] i.s.core.rpc.netty.NettyServerBootstrap : Server started, service listen port: 8091 08:40:48.679 INFO --- [ main] com.alibaba.nacos.client.naming : initializer namespace from System Property :null 08:40:48.744 INFO --- [ main] com.alibaba.nacos.client.naming : [BEAT] adding beat: BeatInfo{port=8091, ip='192.168.2.234', weight=1.0, serviceName='SEATA_GROUP@@seata-server', cluster='default', metadata={}, scheduled=false, period=5000, stopped=false} to beat map. 08:40:48.744 INFO --- [ main] com.alibaba.nacos.client.naming : [REGISTER-SERVICE] 6a5305df-a5cf-4ebd-8250-2446506dbfcd registering service SEATA_GROUP@@seata-server with instance: Instance{instanceId='null', ip='192.168.2.234', port=8091, weight=1.0, healthy=true, enabled=true, ephemeral=true, clusterName='default', serviceName='null', metadata={}} 08:40:48.752 INFO --- [ main] io.seata.server.ServerRunner : seata server started in 803 millSeconds 08:46:18.163 INFO --- [p-nio-0.0.0.0-7091-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 08:46:18.164 INFO --- [p-nio-0.0.0.0-7091-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 08:46:18.169 INFO --- [p-nio-0.0.0.0-7091-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 5 ms
注意:seata-server默认启动占用的内存为2G,如果配置低,需要修改 bin 目录中 seata-server.sh文件,将JVM_XMX、JVM_XMS、JVM_XMN几个参数值修改为512M、256M、256M。