Update Seata example configuration and documentation!

pull/2583/head
zhangqian 3 years ago
parent a3d0187540
commit e9b9826b72

@ -40,10 +40,7 @@ seata:
type: nacos
nacos:
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
serverAddr: 127.0.0.1:8848
group: SEATA_GROUP
dataId: "seata.properties"
username: "nacos"
password: "nacos"
@ -52,7 +49,5 @@ seata:
nacos:
application: seata-server
server-addr: 127.0.0.1:8848
group: SEATA_GROUP
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
username: "nacos"
password: "nacos"

@ -20,9 +20,7 @@ seata:
config:
type: nacos
nacos:
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
serverAddr: 127.0.0.1:8848
group: SEATA_GROUP
dataId: "seata.properties"
username: "nacos"
password: "nacos"
@ -31,8 +29,6 @@ seata:
nacos:
application: seata-server
server-addr: 127.0.0.1:8848
group: SEATA_GROUP
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
username: "nacos"
password: "nacos"

@ -38,9 +38,7 @@ seata:
config:
type: nacos
nacos:
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
serverAddr: 127.0.0.1:8848
group: SEATA_GROUP
dataId: "seata.properties"
username: "nacos"
password: "nacos"
@ -49,12 +47,5 @@ seata:
nacos:
application: seata-server
server-addr: 127.0.0.1:8848
group: SEATA_GROUP
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
username: "nacos"
password: "nacos"
dubbo:
registry:
address: spring-cloud://localhost
cloud:
subscribed-services:

@ -63,7 +63,8 @@ CREATE TABLE `undo_log` (
UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
```
### 创建 seata-server 所需要的数据库表
### 导入 seata-server db模式所需要的数据库表
在数据库中初始化[global_table、branch_table、lock_table、distributed_lock]
点击查看:https://github.com/seata/seata/blob/1.5.0/script/server/db/mysql.sql
```$sql
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
@ -173,7 +174,7 @@ CREATE TABLE `account_tbl` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```
### 启动 Seata Server
### 启动 Seata Server 这里介绍SpringBoot 和下载server两种方式
1.运行 seata-server 启动Seata server
示例中采用nacos 作为配置,注册中心 存储模式为db 采用mysql
@ -186,7 +187,7 @@ sh seata-server.sh -p $LISTEN_PORT -m $MODE(file or db) -h $HOST -e $ENV
```
-p seata-server 监听服务端口号
-m 存储模式可选值file、db。file 用于单点模式db用于ha模式当使用db存储模式需要修改配置中store配置节点的数据库配置同时在数据库中初始化[global_table、branch_table和
lock_table](https://github.com/seata/seata/blob/develop/server/src/main/resources/db_store.sql)
lock_table](https://github.com/seata/seata/blob/1.5.0/script/server/db/mysql.sql)
-h 用于解决seata-server和业务侧跨网络问题其配置的host值直接显示到注册中心的服务可用地址host当跨网络时这里需要配置为公网IP或NATIP若都在同一局域网则无需配置
-e 用于解决多环境配置中心隔离问题
采用如下命令来启动 Seata Server

@ -1,3 +1,12 @@
base:
config:
mdb:
hostname: 127.0.0.1
dbname: seata
port: 3306
username: root
password: 123456
server:
port: 7091
@ -27,8 +36,6 @@ seata:
type: nacos
nacos:
server-addr: 127.0.0.1:8848
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
group: SEATA_GROUP
username: nacos
password: nacos
##if use MSE Nacos with auth, mutex with username/password attribute
@ -42,8 +49,6 @@ seata:
nacos:
application: seata-server
server-addr: 127.0.0.1:8848
group: SEATA_GROUP
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
cluster: default
username: nacos
password: nacos
@ -65,9 +70,9 @@ seata:
datasource: druid
db-type: mysql
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true
user: root
password: 123456
url: jdbc:mysql://${base.config.mdb.hostname}:${base.config.mdb.port}/${base.config.mdb.dbname}?rewriteBatchedStatements=true
user: ${base.config.mdb.username}
password: ${base.config.mdb.password}
min-conn: 5
max-conn: 100
global-table: global_table
@ -82,4 +87,4 @@ seata:
secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017
tokenValidityInMilliseconds: 1800000
ignore:
urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login
urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login

@ -38,10 +38,7 @@ seata:
config:
type: nacos
nacos:
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
serverAddr: 127.0.0.1:8848
group: SEATA_GROUP
dataId: "seata.properties"
username: "nacos"
password: "nacos"
@ -50,8 +47,6 @@ seata:
nacos:
application: seata-server
server-addr: 127.0.0.1:8848
group: SEATA_GROUP
namespace: a3f588d3-7be9-43d3-af7c-1e7919cf8af6
username: "nacos"
password: "nacos"

Loading…
Cancel
Save