You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by il...@apache.org on 2020/12/16 07:46:30 UTC

[dubbo-website] branch master updated: Update the content related to Seata (#665)

This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 7cda132  Update the content related to Seata (#665)
7cda132 is described below

commit 7cda13225c53667fb8a455df2137b8f90a47af8f
Author: BoCai <xi...@163.com>
AuthorDate: Wed Dec 16 15:46:21 2020 +0800

    Update the content related to Seata (#665)
    
    Refer to [Seata Quick Start](http://seata.io/en-us/docs/user/quickstart.html)
    
    Fix [分布式事务 #654](https://github.com/apache/dubbo-website/issues/654)
    
    Co-authored-by: xiehaibo <xi...@shiqiao.com>
---
 content/en/blog/news/dubbo-fescar.md               | 50 +++++++++++--------
 .../v2.7/user/examples/distributed-transaction.md  |  3 ++
 content/zh/blog/news/dubbo-fescar.md               | 57 +++++++++++++---------
 .../v2.7/user/examples/distributed-transaction.md  |  2 +-
 4 files changed, 69 insertions(+), 43 deletions(-)

diff --git a/content/en/blog/news/dubbo-fescar.md b/content/en/blog/news/dubbo-fescar.md
index 68095d0..702b92d 100644
--- a/content/en/blog/news/dubbo-fescar.md
+++ b/content/en/blog/news/dubbo-fescar.md
@@ -1,9 +1,9 @@
 ---
-title: "How to use Fescar to ensure consistency between Dubbo Microservices"
-linkTitle: "Use Fescar in Dubbo"
+title: "How to use Seata to ensure consistency between Dubbo Microservices"
+linkTitle: "Use Seata in Dubbo"
 date: 2019-01-17
 description: >
-    This article will introduce you how to use Fescar to ensure consistency between Dubbo Microservices.
+    This article will introduce you how to use Seata to ensure consistency between Dubbo Microservices.
 ---
 
 ## Use case
@@ -115,7 +115,7 @@ public class OrderServiceImpl implements OrderService {
 }
 ```
 
-## Distributed Transaction Solution with Fescar
+## Distributed Transaction Solution with Seata
 
 ![undefined](/imgs/blog/fescar/fescar-2.png) 
 
@@ -128,7 +128,7 @@ We just need an annotation `@GlobalTransactional` on business method:
     }
 ```
 
-## Example powered by Dubbo + Fescar
+## Example powered by Dubbo + Seata
 
 ### Step 1: Setup database
 
@@ -147,16 +147,17 @@ dubbo-storage-service.xml
     <property name="username" value="xxx" />
     <property name="password" value="xxx" />
 ```
-### Step 2: Create undo_log table for Fescar
+### Step 2: Create undo_log table for Seata
 
-`UNDO_LOG` table is required by Fescar AT mode.
+`UNDO_LOG` table is required by Seata AT mode.
 
 ```sql
--- Note that when Fescar version is upgraded to 0.3.0+, it is changed from the previous normal index to the unique index.
+-- Note that when Seata version is upgraded to 0.3.0+, it is changed from the previous normal index to the unique index.
 CREATE TABLE `undo_log` (
   `id` bigint(20) NOT NULL AUTO_INCREMENT,
   `branch_id` bigint(20) NOT NULL,
   `xid` varchar(100) NOT NULL,
+  `context` varchar(128) NOT NULL,
   `rollback_info` longblob NOT NULL,
   `log_status` int(11) NOT NULL,
   `log_created` datetime NOT NULL,
@@ -200,26 +201,37 @@ CREATE TABLE `account_tbl` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 ```
-### Step 4: Start Fescar-Server
+### Step 4: Start Seata-Server
 
-- Download server [package](https://github.com/alibaba/fescar/releases), unzip it.
-- Start Fescar-Server
+- Download server [package](https://github.com/seata/seata/releases), unzip it.
+- Start Seata-Server
 
 ```shell
-sh fescar-server.sh $LISTEN_PORT $PATH_FOR_PERSISTENT_DATA
+Usage: sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows) [options]
+  Options:
+    --host, -h
+      The host to bind.
+      Default: 0.0.0.0
+    --port, -p
+      The port to listen.
+      Default: 8091
+    --storeMode, -m
+      log store mode : file、db
+      Default: file
+    --help
 
 e.g.
 
-sh fescar-server.sh 8091 /home/admin/fescar/data/
+sh seata-server.sh -p 8091 -h 127.0.0.1 -m file
 ```
 
 ### Step 5: Run example
 
-- Start AccountService ([DubboAccountServiceStarter](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboAccountServiceStarter.java)).
-- Start StorageService ([DubboStorageServiceStarter](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboStorageServiceStarter.java)).
-- Start OrderService ([DubboOrderServiceStarter](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboOrderServiceStarter.java)).
-- Run BusinessService for test ([DubboBusinessTester](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboBusinessTester.java)).
+- Start AccountService ([DubboAccountServiceStarter](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboAccountServiceStarter.java)).
+- Start StorageService ([DubboStorageServiceStarter](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboStorageServiceStarter.java)).
+- Start OrderService  ([DubboOrderServiceStarter](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboOrderServiceStarter.java)).
+- Run BusinessService for test ([DubboBusinessTester](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboBusinessTester.java)).
 
 ### Related projects
-* fescar:          https://github.com/alibaba/fescar/
-* fescar-samples : https://github.com/fescar-group/fescar-samples  
+* Seata:          https://github.com/alibaba/seata/
+* Seata Samples : https://github.com/seata/seata-samples 
diff --git a/content/en/docs/v2.7/user/examples/distributed-transaction.md b/content/en/docs/v2.7/user/examples/distributed-transaction.md
index 96d08f8..ffc4d07 100644
--- a/content/en/docs/v2.7/user/examples/distributed-transaction.md
+++ b/content/en/docs/v2.7/user/examples/distributed-transaction.md
@@ -11,3 +11,6 @@ Distributed transactions are based on the JTA / XA specification(this feature ha
 Two-phase commit:
 
 ![/user-guide/images/jta-xa.jpg](/imgs/user/jta-xa.jpg)
+
+
+In Dubbo, [Seate](/blog/2019/01/17/how-to-use-seata-to-ensure-consistency-between-dubbo-microservices/) can be used to support distributed transactions.
\ No newline at end of file
diff --git a/content/zh/blog/news/dubbo-fescar.md b/content/zh/blog/news/dubbo-fescar.md
index da0b6f7..4651561 100644
--- a/content/zh/blog/news/dubbo-fescar.md
+++ b/content/zh/blog/news/dubbo-fescar.md
@@ -1,9 +1,9 @@
 ---
-title: "如何使用Fescar保证Dubbo微服务间的一致性"
-linkTitle: "如何使用Fescar保证Dubbo微服务间的一致性"
+title: "如何使用Seata保证Dubbo微服务间的一致性"
+linkTitle: "如何使用Seata保证Dubbo微服务间的一致性"
 date: 2019-01-17
 description: >
-    本文主要介绍如何使用Fescar保证Dubbo微服务间的一致性
+    本文主要介绍如何使用Seata保证Dubbo微服务间的一致性
 ---
 
 ## 案例
@@ -25,7 +25,7 @@ description: >
 public interface StorageService {
 
     /**
-     * deduct storage count
+     * 扣除存储数量
      */
     void deduct(String commodityCode, int count);
 }
@@ -37,7 +37,7 @@ public interface StorageService {
 public interface OrderService {
 
     /**
-     * create order
+     * 创建订单
      */
     Order create(String userId, String commodityCode, int orderCount);
 }
@@ -49,7 +49,7 @@ public interface OrderService {
 public interface AccountService {
 
     /**
-     * debit balance of user's account
+     * 从用户账户中借出
      */
     void debit(String userId, int money);
 }
@@ -65,7 +65,7 @@ public class BusinessServiceImpl implements BusinessService {
     private OrderService orderService;
 
     /**
-     * purchase
+     * 采购
      */
     public void purchase(String userId, String commodityCode, int orderCount) {
 
@@ -115,7 +115,7 @@ public class OrderServiceImpl implements OrderService {
 }
 ```
 
-## Fescar 分布式事务解决方案
+## Seata 分布式事务解决方案
 
 ![undefined](/imgs/blog/fescar/fescar-2.png) 
 
@@ -129,7 +129,7 @@ public class OrderServiceImpl implements OrderService {
     }
 ```
 
-##  Dubbo 与 Fescar 结合的例子
+##  Dubbo 与 Seata 结合的例子
 
 ### Step 1: 安装数据库
 
@@ -148,16 +148,17 @@ dubbo-storage-service.xml
     <property name="username" value="xxx" />
     <property name="password" value="xxx" />
 ```
-### Step 2: 为 Fescar 创建 undo_log 表
+### Step 2: 为 Seata 创建 undo_log 表
 
-`UNDO_LOG` 此表用于 Fescar 的AT模式。
+`UNDO_LOG` 此表用于 Seata 的AT模式。
 
 ```sql
--- 注意当 Fescar 版本升级至 0.3.0+ 将由之前的普通索引变更为唯一索引。
+-- 注意当 Seata 版本升级至 0.3.0+ 将由之前的普通索引变更为唯一索引。
 CREATE TABLE `undo_log` (
   `id` bigint(20) NOT NULL AUTO_INCREMENT,
   `branch_id` bigint(20) NOT NULL,
   `xid` varchar(100) NOT NULL,
+  `context` varchar(128) NOT NULL,
   `rollback_info` longblob NOT NULL,
   `log_status` int(11) NOT NULL,
   `log_created` datetime NOT NULL,
@@ -201,26 +202,36 @@ CREATE TABLE `account_tbl` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 ```
-### Step 4: 启动 Fescar-Server 服务
+### Step 4: 启动 Seata-Server 服务
 
-- 下载Server [package](https://github.com/alibaba/fescar/releases), 并解压。
-- 运行bin目录下的启动脚本。
+- 下载[服务器软件包](https://github.com/seata/seata/releases),将其解压缩。
 
 ```shell
-sh fescar-server.sh $LISTEN_PORT $PATH_FOR_PERSISTENT_DATA
+Usage: sh seata-server.sh(for linux and mac) or cmd seata-server.bat(for windows) [options]
+  Options:
+    --host, -h
+      The host to bind.
+      Default: 0.0.0.0
+    --port, -p
+      The port to listen.
+      Default: 8091
+    --storeMode, -m
+      log store mode : file、db
+      Default: file
+    --help
 
 e.g.
 
-sh fescar-server.sh 8091 /home/admin/fescar/data/
+sh seata-server.sh -p 8091 -h 127.0.0.1 -m file
 ```
 
 ### Step 5: 运行例子
 
-- 启动账户服务 ([DubboAccountServiceStarter](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboAccountServiceStarter.java))。
-- 启动库存服务 ([DubboStorageServiceStarter](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboStorageServiceStarter.java))。
-- 启动订单服务 ([DubboOrderServiceStarter](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboOrderServiceStarter.java))。
-- 运行BusinessService入口 ([DubboBusinessTester](https://github.com/fescar-group/fescar-samples/blob/master/dubbo/src/main/java/com/alibaba/fescar/samples/dubbo/starter/DubboBusinessTester.java))。
+- 启动账户服务 ([DubboAccountServiceStarter](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboAccountServiceStarter.java))。
+- 启动库存服务 ([DubboStorageServiceStarter](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboStorageServiceStarter.java))。
+- 启动订单服务 ([DubboOrderServiceStarter](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboOrderServiceStarter.java))。
+- 运行BusinessService入口 ([DubboBusinessTester](https://github.com/seata/seata-samples/blob/master/dubbo/src/main/java/io/seata/samples/dubbo/starter/DubboBusinessTester.java))。
 
 ### 相关项目
-* fescar:          https://github.com/alibaba/fescar/
-* fescar-samples : https://github.com/fescar-group/fescar-samples  
+* Seata:          https://github.com/alibaba/seata/
+* Seata Samples : https://github.com/seata/seata-samples
diff --git a/content/zh/docs/v2.7/user/examples/distributed-transaction.md b/content/zh/docs/v2.7/user/examples/distributed-transaction.md
index 9b25369..8992516 100644
--- a/content/zh/docs/v2.7/user/examples/distributed-transaction.md
+++ b/content/zh/docs/v2.7/user/examples/distributed-transaction.md
@@ -12,4 +12,4 @@ description: "Dubbo 中分布式事务的支持"
 
 ![/user-guide/images/jta-xa.jpg](/imgs/user/jta-xa.jpg)
 
-在 Dubbo 中,可以采用 [seata](/zh/blog/2019/01/17/how-to-use-fescar-to-ensure-consistency-between-dubbo-microservices/) 来完成对分布式事务的支持。
\ No newline at end of file
+在 Dubbo 中,可以采用 [seata](/zh/blog/2019/01/17/如何使用seata保证dubbo微服务间的一致性/) 来完成对分布式事务的支持。
\ No newline at end of file