Add Seata example english documentation!

pull/2583/head
zhangqian 3 years ago
parent 72bb05bbf2
commit 49e4e8adb1

@ -1,11 +1,11 @@
base:
config:
mdb:
hostname: 127.0.0.1
dbname: seata
port: 3306
username: root
password: 123456
hostname: your mysql server ip address
dbname: your database name for test
port: your mysql server listening port
username: your mysql server username
password: your mysql server password
server:
port: 18084

@ -1,12 +1,11 @@
base:
config:
mdb:
hostname: 127.0.0.1
dbname: seata
port: 3306
username: root
password: 123456
hostname: your mysql server ip address
dbname: your database name for test
port: your mysql server listening port
username: your mysql server username
password: your mysql server password
server:
port: 18083

@ -19,12 +19,17 @@
1. 创建 示例中 业务所需要的数据库表
1. 导入 Nacos 配置
[https://github.com/seata/seata/blob/1.5.0/script/config-center/config.txt]
1. 创建示例中Nacos data-id: seata.properties , Group:SEATA_GROUP(seata 1.5.1 默认分组) ,导入 [Nacos 配置](https://github.com/seata/seata/blob/1.5.0/script/config-center/config.txt)
在seata.properties中增加示例中需要的如下[事务群组配置](https://seata.io/zh-cn/docs/user/configurations.html)
```
service.vgroupMapping.order-service-tx-group=default
service.vgroupMapping.account-service-tx-group=default
service.vgroupMapping.business-service-tx-group=default
service.vgroupMapping.storage-service-tx-group=default
```
1. 启动 Seata Server
Seata 1.5.1 支持seata控制台 本地访问控制台地址http://127.0.0.1:7091
通过seata控制台可以观察正在执行的事务信息和全局锁信息,事务执行结束即删除相关信息。
### 配置数据库
首先,你需要有一个支持 InnoDB 引擎的 MySQL 数据库。
@ -34,18 +39,19 @@
`account-server`、`order-service`、`storage-service` 这三个应用中的 resources 目录下的 `application.yml` 文件中的如下配置修改成你运行环境中的实际配置。
```
mysql.server.ip=your mysql server ip address
mysql.server.port=your mysql server listening port
mysql.db.name=your database name for test
mysql.user.name=your mysql server username
mysql.user.password=your mysql server password
base:
config:
mdb:
hostname: your mysql server ip address
dbname: your database name for test
port: your mysql server listening port
username: your mysql server username
password: your mysql server password
```
### 创建 undo_log 表
[Seata AT 模式]() 需要使用到 undo_log 表。
Seata AT 模式 需要使用到 undo_log 表。
``` $sql
-- 注意此处0.3.0+ 增加唯一索引 ux_undo_log
@ -65,7 +71,7 @@ CREATE TABLE `undo_log` (
```
### 导入 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
(https://github.com/seata/seata/blob/1.5.0/script/server/db/mysql.sql)
```$sql
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
-- the table to store GlobalSession data
@ -179,7 +185,7 @@ CREATE TABLE `account_tbl` (
1.运行 seata-server 启动Seata server
示例中采用nacos 作为配置,注册中心 存储模式为db 采用mysql
2.或点击这个页面 [https://github.com/seata/seata/releases](https://github.com/seata/seata/releases),下载最新版本的 Seata Server 端.
2.或点击这个页面 [Seata 官网Github](https://github.com/seata/seata/releases),下载最新版本的 Seata Server 端.
进入解压之后的 bin 目录,执行如下命令来启动, 所有启动参数为可选项。
```$shell

@ -19,11 +19,12 @@ Before running this example, you need to complete the following steps:
1. Create the database tables needed by the business in the example
1. Import Nacos Configuration
[https://github.com/seata/seata/blob/1.5.0/script/config-center/config.txt]
1.Create the Nacos configuration in the example, data id: seata properties , Group:SEATA_ Group (Seata 1.5.1 default group) configuration import [nacos configuration] https://github.com/seata/seata/blob/1.5.0/script/config-center/config.txt )
At seata Add the following [transaction group configuration] required in the example to properties https://seata.io/zh-cn/docs/user/configurations.html )
1. Start Seata Server
Seata 1.5.1 supports Seata console local access console address: http://127.0.0.1:7091
Through the Seata console, you can observe the executing transaction information and global lock information, and delete the relevant information when the transaction is completed.
###Configuration database
@ -34,18 +35,20 @@ First, you need a MySQL database that supports the InnoDB engine.
Will `application'in the resources directory of the `account-server', `order-service', `storage-service` three applications. The following configuration in the yml`file is modified to the actual configuration in your running environment.
```
mysql.server.ip=your mysql server ip address
mysql.server.port=your mysql server listening port
mysql.db.name=your database name for test
mysql.user.name=your mysql server username
mysql.user.password=your mysql server password
base:
config:
mdb:
hostname: your mysql server ip address
dbname: your database name for test
port: your mysql server listening port
username: your mysql server username
password: your mysql server password
```
###Create undo_ Log table
[Seata AT Mode]() Need to use undo_ Log table.
Seata AT Mode Need to use undo_ Log table.
``` $sql
-- Notice here that 0.3.0+ increases the unique index ux_ Undo_ Log
@ -65,7 +68,7 @@ CREATE TABLE `undo_log` (
```
### Database tables needed to import seata-server DB schema
Initialize in database[global_table、branch_table、lock_table、distributed_lock]
Click to view :https://github.com/seata/seata/blob/1.5.0/script/server/db/mysql.sql
(https://github.com/seata/seata/blob/1.5.0/script/server/db/mysql.sql)
```$sql
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
-- the table to store GlobalSession data
@ -179,7 +182,7 @@ CREATE TABLE `account_tbl` (
1.Run seata-server to start Seata server
The example uses Nacos as the configuration and the registry storage mode is: DB uses MySQL
2. Or click on this page [ https://github.com/seata/seata/releases ] ( https://github.com/seata/seata/releases ), download the latest version of Sata Server.
2. Or click on this page [ GitHub, the official website of Seata ] ( https://github.com/seata/seata/releases ), download the latest version of Sata Server.
Enter the bin directory after unzipping and execute the following command to start with all the startup parameters optional.
```$shell

@ -1,11 +1,11 @@
base:
config:
mdb:
hostname: 127.0.0.1
dbname: seata
port: 3306
username: root
password: 123456
hostname: your mysql server ip address
dbname: your database name for test
port: your mysql server listening port
username: your mysql server username
password: your mysql server password
server:
port: 7091

@ -1,11 +1,11 @@
base:
config:
mdb:
hostname: 127.0.0.1
dbname: seata
port: 3306
username: root
password: 123456
hostname: your mysql server ip address
dbname: your database name for test
port: your mysql server listening port
username: your mysql server username
password: your mysql server password
server:
port: 18082

Loading…
Cancel
Save