1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Merge pull request #777 from slievrly/master_1

upgrade seata to 0.7.1 and update seata sample
This commit is contained in:
format 2019-07-23 21:23:44 +08:00 committed by GitHub
commit 5a1ab06497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 145 additions and 115 deletions

View File

@ -20,7 +20,7 @@
<properties> <properties>
<sentinel.version>1.6.2</sentinel.version> <sentinel.version>1.6.2</sentinel.version>
<oss.version>3.1.0</oss.version> <oss.version>3.1.0</oss.version>
<seata.version>0.5.2</seata.version> <seata.version>0.7.1</seata.version>
<nacos.client.version>1.1.1</nacos.client.version> <nacos.client.version>1.1.1</nacos.client.version>
<nacos.config.version>0.8.0</nacos.config.version> <nacos.config.version>0.8.0</nacos.config.version>
<acm.version>1.0.9</acm.version> <acm.version>1.0.9</acm.version>
@ -210,7 +210,7 @@
<dependency> <dependency>
<groupId>io.seata</groupId> <groupId>io.seata</groupId>
<artifactId>seata-spring</artifactId> <artifactId>seata-all</artifactId>
<version>${seata.version}</version> <version>${seata.version}</version>
</dependency> </dependency>

View File

@ -19,16 +19,12 @@ transport {
#auto default pin or 8 #auto default pin or 8
worker-thread-size = 8 worker-thread-size = 8
} }
shutdown {
# when destroy server, wait seconds
wait = 3
} }
store { serialization = "seata"
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions compressor = "none"
max-branch-session-size = 16384
# globe session size , if exceeded throws exceptions
max-global-session-size = 512
# file buffer size , if exceeded allocate new buffer
file-write-buffer-cache-size = 16384
# when recover batch read size
session.reload.read_size = 100
} }
service { service {
#vgroup->rgroup #vgroup->rgroup
@ -39,6 +35,9 @@ service {
enableDegrade = false enableDegrade = false
#disable #disable
disable = false disable = false
#unit ms,s,m,h,d represents milliseconds, seconds, minutes, hours, days, default permanent
max.commit.retry.timeout = "-1"
max.rollback.retry.timeout = "-1"
} }
client { client {
async.commit.buffer.limit = 10000 async.commit.buffer.limit = 10000
@ -46,4 +45,18 @@ client {
retry.internal = 10 retry.internal = 10
retry.times = 30 retry.times = 30
} }
report.retry.count = 5
}
transaction {
undo.data.validation = true
undo.log.serialization = "jackson"
}
## metrics settings
metrics {
enabled = false
registry-type = "compact"
# multi exporters use comma divided
exporter-list = "prometheus"
exporter-prometheus-port = 9898
} }

View File

@ -1,5 +1,5 @@
registry { registry {
# file 、nacos 、eureka、redis、zk、consul # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
type = "file" type = "file"
nacos { nacos {
@ -8,7 +8,7 @@ registry {
cluster = "default" cluster = "default"
} }
eureka { eureka {
serviceUrl = "http://localhost:1001/eureka" serviceUrl = "http://localhost:8761/eureka"
application = "default" application = "default"
weight = "1" weight = "1"
} }
@ -26,13 +26,26 @@ registry {
cluster = "default" cluster = "default"
serverAddr = "127.0.0.1:8500" serverAddr = "127.0.0.1:8500"
} }
etcd3 {
cluster = "default"
serverAddr = "http://localhost:2379"
}
sofa {
serverAddr = "127.0.0.1:9603"
application = "default"
region = "DEFAULT_ZONE"
datacenter = "DefaultDataCenter"
cluster = "default"
group = "SEATA_GROUP"
addressWaitTime = "3000"
}
file { file {
name = "file.conf" name = "file.conf"
} }
} }
config { config {
# file、nacos 、apollo、zk # file、nacos 、apollo、zk、consul、etcd3
type = "file" type = "file"
nacos { nacos {
@ -40,8 +53,11 @@ config {
namespace = "public" namespace = "public"
cluster = "default" cluster = "default"
} }
consul {
serverAddr = "127.0.0.1:8500"
}
apollo { apollo {
app.id = "fescar-server" app.id = "seata-server"
apollo.meta = "http://192.168.1.204:8801" apollo.meta = "http://192.168.1.204:8801"
} }
zk { zk {
@ -49,6 +65,9 @@ config {
session.timeout = 6000 session.timeout = 6000
connect.timeout = 2000 connect.timeout = 2000
} }
etcd3 {
serverAddr = "http://localhost:2379"
}
file { file {
name = "file.conf" name = "file.conf"
} }

View File

@ -19,36 +19,12 @@ transport {
#auto default pin or 8 #auto default pin or 8
worker-thread-size = 8 worker-thread-size = 8
} }
shutdown {
# when destroy server, wait seconds
wait = 3
} }
## transaction log store serialization = "seata"
store { compressor = "none"
## store mode: file、db
mode = "file"
## file store
file {
dir = "sessionStore"
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
max-branch-session-size = 16384
# globe session size , if exceeded throws exceptions
max-global-session-size = 512
# file buffer size , if exceeded allocate new buffer
file-write-buffer-cache-size = 16384
# when recover batch read size
session.reload.read_size = 100
# async, sync
flush-disk-mode = async
}
## database store
db {
driver_class = ""
url = ""
user = ""
password = ""
}
} }
service { service {
#vgroup->rgroup #vgroup->rgroup
@ -59,6 +35,9 @@ service {
enableDegrade = false enableDegrade = false
#disable #disable
disable = false disable = false
#unit ms,s,m,h,d represents milliseconds, seconds, minutes, hours, days, default permanent
max.commit.retry.timeout = "-1"
max.rollback.retry.timeout = "-1"
} }
client { client {
async.commit.buffer.limit = 10000 async.commit.buffer.limit = 10000
@ -66,4 +45,18 @@ client {
retry.internal = 10 retry.internal = 10
retry.times = 30 retry.times = 30
} }
report.retry.count = 5
}
transaction {
undo.data.validation = true
undo.log.serialization = "jackson"
}
## metrics settings
metrics {
enabled = false
registry-type = "compact"
# multi exporters use comma divided
exporter-list = "prometheus"
exporter-prometheus-port = 9898
} }

View File

@ -8,7 +8,7 @@ registry {
cluster = "default" cluster = "default"
} }
eureka { eureka {
serviceUrl = "http://localhost:1001/eureka" serviceUrl = "http://localhost:8761/eureka"
application = "default" application = "default"
weight = "1" weight = "1"
} }
@ -45,7 +45,7 @@ registry {
} }
config { config {
# file、nacos 、apollo、zk # file、nacos 、apollo、zk、consul、etcd3
type = "file" type = "file"
nacos { nacos {
@ -53,6 +53,9 @@ config {
namespace = "public" namespace = "public"
cluster = "default" cluster = "default"
} }
consul {
serverAddr = "127.0.0.1:8500"
}
apollo { apollo {
app.id = "seata-server" app.id = "seata-server"
apollo.meta = "http://192.168.1.204:8801" apollo.meta = "http://192.168.1.204:8801"
@ -62,6 +65,9 @@ config {
session.timeout = 6000 session.timeout = 6000
connect.timeout = 2000 connect.timeout = 2000
} }
etcd3 {
serverAddr = "http://localhost:2379"
}
file { file {
name = "file.conf" name = "file.conf"
} }

View File

@ -19,36 +19,12 @@ transport {
#auto default pin or 8 #auto default pin or 8
worker-thread-size = 8 worker-thread-size = 8
} }
shutdown {
# when destroy server, wait seconds
wait = 3
} }
## transaction log store serialization = "seata"
store { compressor = "none"
## store mode: file、db
mode = "file"
## file store
file {
dir = "sessionStore"
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
max-branch-session-size = 16384
# globe session size , if exceeded throws exceptions
max-global-session-size = 512
# file buffer size , if exceeded allocate new buffer
file-write-buffer-cache-size = 16384
# when recover batch read size
session.reload.read_size = 100
# async, sync
flush-disk-mode = async
}
## database store
db {
driver_class = ""
url = ""
user = ""
password = ""
}
} }
service { service {
#vgroup->rgroup #vgroup->rgroup
@ -59,6 +35,9 @@ service {
enableDegrade = false enableDegrade = false
#disable #disable
disable = false disable = false
#unit ms,s,m,h,d represents milliseconds, seconds, minutes, hours, days, default permanent
max.commit.retry.timeout = "-1"
max.rollback.retry.timeout = "-1"
} }
client { client {
async.commit.buffer.limit = 10000 async.commit.buffer.limit = 10000
@ -66,4 +45,18 @@ client {
retry.internal = 10 retry.internal = 10
retry.times = 30 retry.times = 30
} }
report.retry.count = 5
}
transaction {
undo.data.validation = true
undo.log.serialization = "jackson"
}
## metrics settings
metrics {
enabled = false
registry-type = "compact"
# multi exporters use comma divided
exporter-list = "prometheus"
exporter-prometheus-port = 9898
} }

View File

@ -8,7 +8,7 @@ registry {
cluster = "default" cluster = "default"
} }
eureka { eureka {
serviceUrl = "http://localhost:1001/eureka" serviceUrl = "http://localhost:8761/eureka"
application = "default" application = "default"
weight = "1" weight = "1"
} }
@ -45,7 +45,7 @@ registry {
} }
config { config {
# file、nacos 、apollo、zk # file、nacos 、apollo、zk、consul、etcd3
type = "file" type = "file"
nacos { nacos {
@ -53,6 +53,9 @@ config {
namespace = "public" namespace = "public"
cluster = "default" cluster = "default"
} }
consul {
serverAddr = "127.0.0.1:8500"
}
apollo { apollo {
app.id = "seata-server" app.id = "seata-server"
apollo.meta = "http://192.168.1.204:8801" apollo.meta = "http://192.168.1.204:8801"
@ -62,6 +65,9 @@ config {
session.timeout = 6000 session.timeout = 6000
connect.timeout = 2000 connect.timeout = 2000
} }
etcd3 {
serverAddr = "http://localhost:2379"
}
file { file {
name = "file.conf" name = "file.conf"
} }

View File

@ -50,6 +50,7 @@ CREATE TABLE `undo_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`branch_id` bigint(20) NOT NULL, `branch_id` bigint(20) NOT NULL,
`xid` varchar(100) NOT NULL, `xid` varchar(100) NOT NULL,
`context` varchar(128) NOT NULL,
`rollback_info` longblob NOT NULL, `rollback_info` longblob NOT NULL,
`log_status` int(11) NOT NULL, `log_status` int(11) NOT NULL,
`log_created` datetime NOT NULL, `log_created` datetime NOT NULL,
@ -101,13 +102,13 @@ CREATE TABLE `account_tbl` (
进入解压之后的 bin 目录,执行如下命令来启动 进入解压之后的 bin 目录,执行如下命令来启动
```$shell ```$shell
sh seata-server.sh $LISTEN_PORT $MODE(file or db) sh seata-server.sh -p $LISTEN_PORT -m $MODE(file or db)
``` ```
在这个示例中,采用如下命令来启动 Seata Server 在这个示例中,采用如下命令来启动 Seata Server
```$shell ```$shell
sh seata-server.sh 8091 file sh seata-server.sh -p 8091 -m file
``` ```
**注意** 如果你修改了endpoint且注册中心使用默认file类型那么记得需要在各个示例工程中的 `file.conf` 文件中,修改 grouplist 的值(当registry.conf 中registry.type 或 config.type 为file 时会读取内部的file节点中的文件名若type不为file将直接从配置类型的对应元数据的注册配置中心读取数据),推荐大家使用 nacos 作为配置注册中心。 **注意** 如果你修改了endpoint且注册中心使用默认file类型那么记得需要在各个示例工程中的 `file.conf` 文件中,修改 grouplist 的值(当registry.conf 中registry.type 或 config.type 为file 时会读取内部的file节点中的文件名若type不为file将直接从配置类型的对应元数据的注册配置中心读取数据),推荐大家使用 nacos 作为配置注册中心。

View File

@ -19,36 +19,12 @@ transport {
#auto default pin or 8 #auto default pin or 8
worker-thread-size = 8 worker-thread-size = 8
} }
shutdown {
# when destroy server, wait seconds
wait = 3
} }
## transaction log store serialization = "seata"
store { compressor = "none"
## store mode: file、db
mode = "file"
## file store
file {
dir = "sessionStore"
# branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions
max-branch-session-size = 16384
# globe session size , if exceeded throws exceptions
max-global-session-size = 512
# file buffer size , if exceeded allocate new buffer
file-write-buffer-cache-size = 16384
# when recover batch read size
session.reload.read_size = 100
# async, sync
flush-disk-mode = async
}
## database store
db {
driver_class = ""
url = ""
user = ""
password = ""
}
} }
service { service {
#vgroup->rgroup #vgroup->rgroup
@ -59,6 +35,9 @@ service {
enableDegrade = false enableDegrade = false
#disable #disable
disable = false disable = false
#unit ms,s,m,h,d represents milliseconds, seconds, minutes, hours, days, default permanent
max.commit.retry.timeout = "-1"
max.rollback.retry.timeout = "-1"
} }
client { client {
async.commit.buffer.limit = 10000 async.commit.buffer.limit = 10000
@ -66,4 +45,18 @@ client {
retry.internal = 10 retry.internal = 10
retry.times = 30 retry.times = 30
} }
report.retry.count = 5
}
transaction {
undo.data.validation = true
undo.log.serialization = "jackson"
}
## metrics settings
metrics {
enabled = false
registry-type = "compact"
# multi exporters use comma divided
exporter-list = "prometheus"
exporter-prometheus-port = 9898
} }

View File

@ -8,7 +8,7 @@ registry {
cluster = "default" cluster = "default"
} }
eureka { eureka {
serviceUrl = "http://localhost:1001/eureka" serviceUrl = "http://localhost:8761/eureka"
application = "default" application = "default"
weight = "1" weight = "1"
} }
@ -45,7 +45,7 @@ registry {
} }
config { config {
# file、nacos 、apollo、zk # file、nacos 、apollo、zk、consul、etcd3
type = "file" type = "file"
nacos { nacos {
@ -53,6 +53,9 @@ config {
namespace = "public" namespace = "public"
cluster = "default" cluster = "default"
} }
consul {
serverAddr = "127.0.0.1:8500"
}
apollo { apollo {
app.id = "seata-server" app.id = "seata-server"
apollo.meta = "http://192.168.1.204:8801" apollo.meta = "http://192.168.1.204:8801"
@ -62,6 +65,9 @@ config {
session.timeout = 6000 session.timeout = 6000
connect.timeout = 2000 connect.timeout = 2000
} }
etcd3 {
serverAddr = "http://localhost:2379"
}
file { file {
name = "file.conf" name = "file.conf"
} }

View File

@ -16,7 +16,7 @@
<dependency> <dependency>
<groupId>io.seata</groupId> <groupId>io.seata</groupId>
<artifactId>seata-spring</artifactId> <artifactId>seata-all</artifactId>
</dependency> </dependency>
<dependency> <dependency>