{"id":66673,"date":"2026-01-27T09:05:28","date_gmt":"2026-01-27T01:05:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/66673.html"},"modified":"2026-01-27T09:05:28","modified_gmt":"2026-01-27T01:05:28","slug":"nacos%e8%a1%8c%e4%b8%9a%e5%ba%94%e7%94%a8-05%ef%bc%8cnacos-%e4%b8%8e-seata-%e6%95%b4%e5%90%88%ef%bc%9a%e5%88%86%e5%b8%83%e5%bc%8f%e4%ba%8b%e5%8a%a1%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88%e5%ae%9e","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/66673.html","title":{"rendered":"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5"},"content":{"rendered":"<p>\u5728\u5fae\u670d\u52a1\u67b6\u6784\u4e2d&#xff0c;\u4e1a\u52a1\u88ab\u62c6\u5206\u81f3\u591a\u4e2a\u72ec\u7acb\u670d\u52a1&#xff0c;\u6bcf\u4e2a\u670d\u52a1\u62e5\u6709\u4e13\u5c5e\u6570\u636e\u6e90\u3002\u5f53\u4e00\u7b14\u4e1a\u52a1\u8de8\u591a\u4e2a\u670d\u52a1\u64cd\u4f5c\u6570\u636e\u65f6&#xff08;\u5982\u7535\u5546\u4e0b\u5355\u9700\u8054\u52a8\u8ba2\u5355\u3001\u5e93\u5b58\u3001\u652f\u4ed8\u670d\u52a1&#xff09;&#xff0c;\u4f20\u7edf\u672c\u5730\u4e8b\u52a1\u65e0\u6cd5\u4fdd\u8bc1\u8de8\u670d\u52a1\u6570\u636e\u4e00\u81f4\u6027&#xff0c;\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898\u968f\u4e4b\u51f8\u663e\u3002Nacos \u4f5c\u4e3a\u963f\u91cc\u5f00\u6e90\u7684\u670d\u52a1\u6ce8\u518c\u4e0e\u914d\u7f6e\u4e2d\u5fc3&#xff0c;\u80fd\u63d0\u4f9b\u9ad8\u6548\u7684\u670d\u52a1\u53d1\u73b0\u4e0e\u52a8\u6001\u914d\u7f6e\u80fd\u529b&#xff1b;Seata \u5219\u662f\u8f7b\u91cf\u7ea7\u5206\u5e03\u5f0f\u4e8b\u52a1\u6846\u67b6&#xff0c;\u4e13\u6ce8\u4e8e\u5fae\u670d\u52a1\u573a\u666f\u4e0b\u7684\u4e8b\u52a1\u4e00\u81f4\u6027\u4fdd\u969c\u3002\u4e8c\u8005\u6574\u5408\u53ef\u6784\u5efa\u7a33\u5b9a\u3001\u6613\u7528\u7684\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848&#xff0c;\u672c\u6587\u5c06\u4ece\u539f\u7406\u3001\u5b9e\u6218\u3001\u4f18\u5316\u4e09\u65b9\u9762\u5b8c\u6574\u62c6\u89e3\u6574\u5408\u8fc7\u7a0b\u3002<\/p>\n<h3>\u4e00\u3001\u6838\u5fc3\u7ec4\u4ef6\u4e0e\u534f\u540c\u539f\u7406<\/h3>\n<h4>1.1 \u5173\u952e\u7ec4\u4ef6\u804c\u8d23<\/h4>\n<p>\u6574\u5408\u65b9\u6848\u4e2d&#xff0c;Nacos \u4e0e Seata \u5404\u53f8\u5176\u804c&#xff0c;\u540c\u65f6\u901a\u8fc7\u534f\u540c\u673a\u5236\u5b9e\u73b0\u4e8b\u52a1\u95ed\u73af&#xff1a;<\/p>\n<ul>\n<li>\n<p>Nacos&#xff1a;\u627f\u62c5\u53cc\u91cd\u89d2\u8272\u2014\u2014\u4f5c\u4e3a\u670d\u52a1\u6ce8\u518c\u4e2d\u5fc3&#xff0c;\u8ba9 Seata Server \u4e0e\u5fae\u670d\u52a1\u5b9e\u4f8b\u5b9e\u73b0\u52a8\u6001\u53d1\u73b0&#xff1b;\u4f5c\u4e3a\u914d\u7f6e\u4e2d\u5fc3&#xff0c;\u7edf\u4e00\u7ba1\u7406 Seata \u7684\u5168\u5c40\u914d\u7f6e&#xff08;\u5982\u4e8b\u52a1\u7ec4\u3001\u96c6\u7fa4\u6620\u5c04\u7b49&#xff09;&#xff0c;\u907f\u514d\u5206\u6563\u914d\u7f6e\u5bfc\u81f4\u7684\u4e0d\u4e00\u81f4\u95ee\u9898\u3002<\/p>\n<\/li>\n<li>\n<p>Seata&#xff1a;\u901a\u8fc7\u4e09\u5927\u6838\u5fc3\u89d2\u8272\u5b9e\u73b0\u5206\u5e03\u5f0f\u4e8b\u52a1\u7ba1\u63a7&#xff0c;\u5206\u522b\u662f\u4e8b\u52a1\u534f\u8c03\u8005&#xff08;TC&#xff0c;\u90e8\u7f72\u5728 Seata Server \u4e2d&#xff09;\u3001\u4e8b\u52a1\u7ba1\u7406\u8005&#xff08;TM&#xff0c;\u5d4c\u5165\u4e1a\u52a1\u670d\u52a1&#xff0c;\u53d1\u8d77\u5168\u5c40\u4e8b\u52a1&#xff09;\u3001\u8d44\u6e90\u7ba1\u7406\u8005&#xff08;RM&#xff0c;\u5d4c\u5165\u4e1a\u52a1\u670d\u52a1&#xff0c;\u7ba1\u7406\u672c\u5730\u4e8b\u52a1\u8d44\u6e90\u5e76\u54cd\u5e94 TC \u6307\u4ee4&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>1.2 \u534f\u540c\u5de5\u4f5c\u6d41\u7a0b<\/h4>\n<p>\u4ee5 Seata \u4e3b\u6d41\u7684 AT \u6a21\u5f0f&#xff08;\u81ea\u52a8\u4e8b\u52a1\u6a21\u5f0f&#xff0c;\u5e73\u8861\u6613\u7528\u6027\u4e0e\u6027\u80fd&#xff09;\u4e3a\u4f8b&#xff0c;Nacos \u4e0e Seata \u7684\u534f\u540c\u6d41\u7a0b\u5982\u4e0b&#xff1a;<\/p>\n<li>\n<p>TM \u53d1\u8d77\u5168\u5c40\u4e8b\u52a1&#xff0c;\u5411 TC \u6ce8\u518c\u5168\u5c40\u4e8b\u52a1\u5e76\u83b7\u53d6\u5168\u5c40\u4e8b\u52a1 ID&#xff08;XID&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u5fae\u670d\u52a1\u901a\u8fc7 Nacos \u53d1\u73b0 Seata Server \u5730\u5740&#xff0c;\u5c06 XID \u4f20\u9012\u81f3\u5404\u4e2a\u5206\u652f\u670d\u52a1&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u5404\u5206\u652f\u670d\u52a1\u7684 RM \u5411 TC \u6ce8\u518c\u5206\u652f\u4e8b\u52a1&#xff0c;\u6267\u884c\u672c\u5730\u4e1a\u52a1\u903b\u8f91\u5e76\u8bb0\u5f55\u56de\u6eda\u65e5\u5fd7&#xff08;Undo Log&#xff09;&#xff0c;\u5b8c\u6210\u7b2c\u4e00\u9636\u6bb5\u63d0\u4ea4&#xff1b;<\/p>\n<\/li>\n<li>\n<p>TC \u6c47\u603b\u6240\u6709\u5206\u652f\u4e8b\u52a1\u72b6\u6001&#xff0c;\u82e5\u5168\u90e8\u6210\u529f\u5219\u4e0b\u8fbe\u5168\u5c40\u63d0\u4ea4\u6307\u4ee4&#xff0c;\u5404 RM \u5220\u9664\u56de\u6eda\u65e5\u5fd7&#xff1b;\u82e5\u5b58\u5728\u5931\u8d25\u5219\u4e0b\u8fbe\u56de\u6eda\u6307\u4ee4&#xff0c;\u5404 RM \u57fa\u4e8e Undo Log \u6267\u884c\u56de\u6eda&#xff1b;<\/p>\n<\/li>\n<li>\n<p>Nacos \u5b9e\u65f6\u540c\u6b65 Seata \u914d\u7f6e\u53d8\u66f4&#xff0c;\u786e\u4fdd\u96c6\u7fa4\u8282\u70b9\u914d\u7f6e\u4e00\u81f4&#xff0c;\u4fdd\u969c\u4e8b\u52a1\u534f\u8c03\u7a33\u5b9a\u6027\u3002<\/p>\n<\/li>\n<h4>1.3 Seata \u6a21\u5f0f\u9009\u578b\u5efa\u8bae<\/h4>\n<p>Seata \u63d0\u4f9b\u591a\u79cd\u4e8b\u52a1\u6a21\u5f0f&#xff0c;\u9700\u7ed3\u5408\u4e1a\u52a1\u573a\u666f\u9009\u578b&#xff1a;<\/p>\n<ul>\n<li>\n<p>AT \u6a21\u5f0f&#xff1a;\u9ed8\u8ba4\u6a21\u5f0f&#xff0c;\u5bf9\u4e1a\u52a1\u65e0\u4fb5\u5165&#xff0c;\u901a\u8fc7 Undo Log \u5b9e\u73b0\u81ea\u52a8\u56de\u6eda&#xff0c;\u9002\u5408\u5927\u591a\u6570\u5fae\u670d\u52a1\u573a\u666f&#xff08;\u5982\u7535\u5546\u8ba2\u5355\u3001\u5e93\u5b58\u8054\u52a8&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>TCC \u6a21\u5f0f&#xff1a;\u9700\u624b\u52a8\u5b9e\u73b0 Try\u3001Confirm\u3001Cancel \u63a5\u53e3&#xff0c;\u4e00\u81f4\u6027\u5f3a&#xff0c;\u9002\u5408\u91d1\u878d\u7ea7\u6838\u5fc3\u4e1a\u52a1&#xff08;\u5982\u652f\u4ed8\u7ed3\u7b97&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>SAGA \u6a21\u5f0f&#xff1a;\u57fa\u4e8e\u72b6\u6001\u673a\u5b9e\u73b0\u957f\u4e8b\u52a1\u62c6\u5206&#xff0c;\u9002\u5408\u8de8\u670d\u52a1\u591a\u6b65\u9aa4\u7684\u957f\u4e8b\u52a1\u573a\u666f&#xff08;\u5982\u7269\u6d41\u8c03\u5ea6&#xff09;&#xff1b;<\/p>\n<\/li>\n<li>\n<p>XA \u6a21\u5f0f&#xff1a;\u4f9d\u8d56\u6570\u636e\u5e93\u539f\u751f\u4e8b\u52a1\u652f\u6301&#xff0c;\u5f3a\u4e00\u81f4\u6027\u4f46\u6027\u80fd\u8f83\u5dee&#xff0c;\u6781\u5c11\u5728\u9ad8\u5e76\u53d1\u573a\u666f\u4f7f\u7528\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u672c\u6587\u5b9e\u6218\u90e8\u5206\u5c06\u91c7\u7528 AT \u6a21\u5f0f&#xff0c;\u517c\u987e\u5f00\u53d1\u6548\u7387\u4e0e\u4e1a\u52a1\u9002\u914d\u6027\u3002<\/p>\n<h3>\u4e8c\u3001\u73af\u5883\u51c6\u5907\u4e0e\u6574\u5408\u5b9e\u6218<\/h3>\n<p>\u672c\u6b21\u5b9e\u6218\u57fa\u4e8e Spring Boot 2.7.x &#043; MyBatis-Plus 3.5.x &#043; Seata 1.7.1 &#043; MySQL 8.0 \u6280\u672f\u6808&#xff0c;\u4ee5\u201c\u8ba2\u5355\u521b\u5efa &#043; \u5e93\u5b58\u6263\u51cf\u201d\u7ecf\u5178\u573a\u666f\u4e3a\u4f8b&#xff0c;\u5b9e\u73b0\u5206\u5e03\u5f0f\u4e8b\u52a1\u7ba1\u63a7\u3002<\/p>\n<h4>2.1 \u524d\u7f6e\u73af\u5883\u90e8\u7f72<\/h4>\n<li>\n<p>Nacos Server \u90e8\u7f72&#xff1a;\u4e0b\u8f7d Nacos 1.4.0&#043; \u7248\u672c&#xff08;\u5efa\u8bae\u4e0e Seata \u7248\u672c\u517c\u5bb9&#xff09;&#xff0c;\u89e3\u538b\u540e\u542f\u52a8\u5355\u673a\u7248&#xff0c;\u8bbf\u95ee http:\/\/127.0.0.1:8848\/nacos \u9a8c\u8bc1\u662f\u5426\u6b63\u5e38\u8fd0\u884c&#xff0c;\u9ed8\u8ba4\u8d26\u53f7\u5bc6\u7801\u4e3a nacos\/nacos\u3002<\/p>\n<\/li>\n<li>\n<p>Seata Server \u90e8\u7f72\u4e0e Nacos \u6ce8\u518c&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u4e0b\u8f7d Seata 1.7.1 \u7248\u672c&#xff0c;\u89e3\u538b\u540e\u4fee\u6539conf\/application.yml&#xff0c;\u914d\u7f6e\u6570\u636e\u6e90&#xff08;\u5b58\u50a8\u5168\u5c40\u4e8b\u52a1\u72b6\u6001&#xff09;\u4e0e Nacos \u6ce8\u518c\u4e2d\u5fc3&#xff1b;<\/p>\n<\/li>\n<li>\n<p>\u6838\u5fc3\u914d\u7f6e\u5982\u4e0b&#xff08;\u91cd\u70b9\u5173\u6ce8 registry \u4e0e store \u8282\u70b9&#xff09;&#xff1a;<br \/>\nseata: registry:   type: nacos  # \u6ce8\u518c\u4e2d\u5fc3\u7c7b\u578b\u4e3a Nacos   nacos:     server-addr: 127.0.0.1:8848     group: SEATA_GROUP  # \u9700\u4e0e\u5ba2\u6237\u7aef\u4e00\u81f4     application: seata-server  # \u6ce8\u518c\u5230 Nacos \u7684\u670d\u52a1\u540d config:   type: nacos  # \u914d\u7f6e\u4e2d\u5fc3\u7c7b\u578b\u4e3a Nacos   nacos:     server-addr: 127.0.0.1:8848     group: SEATA_GROUP store:   mode: db  # \u5168\u5c40\u4e8b\u52a1\u72b6\u6001\u5b58\u50a8\u65b9\u5f0f\u4e3a\u6570\u636e\u5e93   db:     driver-class-name: com.mysql.cj.jdbc.Driver     url: jdbc:mysql:\/\/localhost:3306\/seata?useSSL&#061;false&amp;serverTimezone&#061;Asia\/Shanghai     user: root     password: 123456<\/p>\n<\/li>\n<li>\n<p>\u521d\u59cb\u5316 Seata \u6570\u636e\u5e93&#xff1a;\u521b\u5efa seata \u6570\u636e\u5e93&#xff0c;\u6267\u884c\u5b98\u7f51\u63d0\u4f9b\u7684\u5efa\u8868\u8bed\u53e5&#xff0c;\u751f\u6210 global_table&#xff08;\u5168\u5c40\u4e8b\u52a1\u8868&#xff09;\u3001branch_table&#xff08;\u5206\u652f\u4e8b\u52a1\u8868&#xff09;\u3001lock_table&#xff08;\u5168\u5c40\u9501\u8868&#xff09;\u7b49\u6838\u5fc3\u8868&#xff0c;\u7528\u4e8e\u5b58\u50a8\u4e8b\u52a1\u5143\u6570\u636e\u3002<\/p>\n<\/li>\n<li>\n<p>\u542f\u52a8 Seata Server&#xff1a;\u6267\u884c\u89e3\u538b\u76ee\u5f55\u4e0b\u7684 bin\/seata-server.bat&#xff08;Windows&#xff09;\u6216 bin\/seata-server.sh&#xff08;Linux&#xff09;&#xff0c;\u542f\u52a8\u540e\u53ef\u5728 Nacos \u63a7\u5236\u53f0\u201c\u670d\u52a1\u5217\u8868\u201d\u4e2d\u770b\u5230 seata-server \u5b9e\u4f8b&#xff0c;\u8bf4\u660e\u6ce8\u518c\u6210\u529f\u3002<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<h4>2.2 \u5fae\u670d\u52a1\u6574\u5408\u914d\u7f6e<\/h4>\n<p>\u5206\u522b\u642d\u5efa\u8ba2\u5355\u670d\u52a1&#xff08;order-service&#xff09;\u4e0e\u5e93\u5b58\u670d\u52a1&#xff08;stock-service&#xff09;&#xff0c;\u5b8c\u6210\u4e0e Nacos\u3001Seata \u7684\u6574\u5408\u914d\u7f6e\u3002<\/p>\n<h5>2.2.1 \u5f15\u5165\u6838\u5fc3\u4f9d\u8d56<\/h5>\n<p>\u4e24\u4e2a\u670d\u52a1\u7684 pom.xml \u5747\u9700\u5f15\u5165 Seata\u3001Nacos\u3001\u6570\u636e\u6e90\u76f8\u5173\u4f9d\u8d56&#xff0c;\u6838\u5fc3\u4f9d\u8d56\u5982\u4e0b&#xff1a;<\/p>\n<p><span class=\"token comment\">&lt;!&#8211; Seata \u6838\u5fc3\u4f9d\u8d56 &#8211;&gt;<\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>io.seata<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>seata-spring-boot-starter<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>1.7.1<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token comment\">&lt;!&#8211; Seata \u6570\u636e\u6e90\u4ee3\u7406&#xff08;AT \u6a21\u5f0f\u5fc5\u9700&#xff09; &#8211;&gt;<\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>io.seata<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>seata-datasource-proxy-druid<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>1.7.1<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token comment\">&lt;!&#8211; Nacos \u670d\u52a1\u6ce8\u518c\u53d1\u73b0 &#8211;&gt;<\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>com.alibaba.cloud<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>spring-cloud-starter-alibaba-nacos-discovery<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>2021.0.5.0<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token comment\">&lt;!&#8211; \u5fb7\u9c81\u4f0a\u8fde\u63a5\u6c60 &#043; MyBatis-Plus &#8211;&gt;<\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>com.alibaba<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>druid-spring-boot-starter<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>1.2.16<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>com.baomidou<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>groupId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>mybatis-plus-boot-starter<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>artifactId<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span>3.5.3.1<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>version<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><br \/>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;\/<\/span>dependency<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><\/p>\n<h5>2.2.2 \u914d\u7f6e\u6587\u4ef6\u7f16\u5199<\/h5>\n<p>\u4ee5\u8ba2\u5355\u670d\u52a1\u4e3a\u4f8b&#xff0c;application.yml \u914d\u7f6e\u5982\u4e0b&#xff0c;\u5e93\u5b58\u670d\u52a1\u4ec5\u9700\u4fee\u6539\u5e94\u7528\u540d\u4e0e\u6570\u636e\u6e90\u5730\u5740&#xff0c;\u6838\u5fc3\u914d\u7f6e\u4fdd\u6301\u4e00\u81f4&#xff1a;<\/p>\n<p><span class=\"token key atrule\">spring<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">application<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> order<span class=\"token punctuation\">&#8211;<\/span>service  <span class=\"token comment\"># \u5e93\u5b58\u670d\u52a1\u4e3a stock-service<\/span><br \/>\n  <span class=\"token key atrule\">cloud<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">nacos<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">discovery<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">server-addr<\/span><span class=\"token punctuation\">:<\/span> 127.0.0.1<span class=\"token punctuation\">:<\/span><span class=\"token number\">8848<\/span>  <span class=\"token comment\"># Nacos \u5730\u5740<\/span><br \/>\n  <span class=\"token key atrule\">datasource<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">driver-class-name<\/span><span class=\"token punctuation\">:<\/span> com.mysql.cj.jdbc.Driver<br \/>\n    <span class=\"token key atrule\">url<\/span><span class=\"token punctuation\">:<\/span> jdbc<span class=\"token punctuation\">:<\/span>mysql<span class=\"token punctuation\">:<\/span>\/\/localhost<span class=\"token punctuation\">:<\/span>3306\/order_db<span class=\"token punctuation\">?<\/span>useSSL&#061;false<span class=\"token important\">&amp;serverTimezone&#061;Asia\/Shanghai<\/span><br \/>\n    <span class=\"token key atrule\">username<\/span><span class=\"token punctuation\">:<\/span> root<br \/>\n    <span class=\"token key atrule\">password<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">123456<\/span><br \/>\n    <span class=\"token key atrule\">type<\/span><span class=\"token punctuation\">:<\/span> com.alibaba.druid.pool.DruidDataSource<\/p>\n<p><span class=\"token comment\"># Seata \u6838\u5fc3\u914d\u7f6e<\/span><br \/>\n<span class=\"token key atrule\">seata<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">enabled<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token boolean important\">true<\/span><br \/>\n  <span class=\"token key atrule\">tx-service-group<\/span><span class=\"token punctuation\">:<\/span> my_test_tx_group  <span class=\"token comment\"># \u4e8b\u52a1\u7ec4\u540d\u79f0&#xff0c;\u9700\u4e0e Seata Server \u4e00\u81f4<\/span><br \/>\n  <span class=\"token key atrule\">service<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">vgroup-mapping<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">my_test_tx_group<\/span><span class=\"token punctuation\">:<\/span> default  <span class=\"token comment\"># \u4e8b\u52a1\u7ec4\u4e0e\u96c6\u7fa4\u6620\u5c04<\/span><br \/>\n    <span class=\"token key atrule\">grouplist<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">default<\/span><span class=\"token punctuation\">:<\/span> 127.0.0.1<span class=\"token punctuation\">:<\/span><span class=\"token number\">8091<\/span>  <span class=\"token comment\"># Seata Server \u5730\u5740&#xff08;\u9ed8\u8ba4\u7aef\u53e3 8091&#xff09;<\/span><br \/>\n  <span class=\"token key atrule\">data-source-proxy-mode<\/span><span class=\"token punctuation\">:<\/span> AT  <span class=\"token comment\"># \u542f\u7528 AT \u6a21\u5f0f\u6570\u636e\u6e90\u4ee3\u7406<\/span><br \/>\n  <span class=\"token key atrule\">registry<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">type<\/span><span class=\"token punctuation\">:<\/span> nacos<br \/>\n    <span class=\"token key atrule\">nacos<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">server-addr<\/span><span class=\"token punctuation\">:<\/span> 127.0.0.1<span class=\"token punctuation\">:<\/span><span class=\"token number\">8848<\/span><br \/>\n      <span class=\"token key atrule\">group<\/span><span class=\"token punctuation\">:<\/span> SEATA_GROUP  <span class=\"token comment\"># \u4e0e Seata Server \u6ce8\u518c\u5206\u7ec4\u4e00\u81f4<\/span><\/p>\n<p><span class=\"token comment\"># MyBatis-Plus \u914d\u7f6e<\/span><br \/>\n<span class=\"token key atrule\">mybatis-plus<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">mapper-locations<\/span><span class=\"token punctuation\">:<\/span> classpath<span class=\"token punctuation\">:<\/span>mapper\/<span class=\"token important\">**\/*.xml<\/span><br \/>\n  <span class=\"token key atrule\">type-aliases-package<\/span><span class=\"token punctuation\">:<\/span> com.example.order.entity<\/p>\n<h4>2.3 \u4e1a\u52a1\u4ee3\u7801\u5b9e\u73b0<\/h4>\n<p>\u57fa\u4e8e AT \u6a21\u5f0f\u5b9e\u73b0\u201c\u521b\u5efa\u8ba2\u5355 &#043; \u6263\u51cf\u5e93\u5b58\u201d\u903b\u8f91&#xff0c;\u6838\u5fc3\u662f\u901a\u8fc7&#064;GlobalTransactional \u6ce8\u89e3\u6807\u8bb0\u5168\u5c40\u4e8b\u52a1\u53d1\u8d77\u8005\u3002<\/p>\n<h5>2.3.1 \u5e93\u5b58\u670d\u52a1\u63a5\u53e3<\/h5>\n<p>\u5e93\u5b58\u670d\u52a1\u63d0\u4f9b\u6263\u51cf\u5e93\u5b58\u63a5\u53e3&#xff0c;\u4f5c\u4e3a\u5206\u652f\u4e8b\u52a1&#xff1a;<\/p>\n<p><span class=\"token annotation punctuation\">&#064;Service<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">StockServiceImpl<\/span> <span class=\"token keyword\">implements<\/span> <span class=\"token class-name\">StockService<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Autowired<\/span><br \/>\n    <span class=\"token keyword\">private<\/span> <span class=\"token class-name\">StockMapper<\/span> stockMapper<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Override<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token keyword\">boolean<\/span> <span class=\"token function\">deductStock<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Long<\/span> productId<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">Integer<\/span> count<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ \u6263\u51cf\u5e93\u5b58\u903b\u8f91<\/span><br \/>\n        <span class=\"token class-name\">Stock<\/span> stock <span class=\"token operator\">&#061;<\/span> stockMapper<span class=\"token punctuation\">.<\/span><span class=\"token function\">selectById<\/span><span class=\"token punctuation\">(<\/span>productId<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>stock <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token keyword\">null<\/span> <span class=\"token operator\">||<\/span> stock<span class=\"token punctuation\">.<\/span><span class=\"token function\">getCount<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;<\/span> count<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RuntimeException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5e93\u5b58\u4e0d\u8db3&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n        stock<span class=\"token punctuation\">.<\/span><span class=\"token function\">setCount<\/span><span class=\"token punctuation\">(<\/span>stock<span class=\"token punctuation\">.<\/span><span class=\"token function\">getCount<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#8211;<\/span> count<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> stockMapper<span class=\"token punctuation\">.<\/span><span class=\"token function\">updateById<\/span><span class=\"token punctuation\">(<\/span>stock<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h5>2.3.2 \u8ba2\u5355\u670d\u52a1\u63a5\u53e3&#xff08;\u5168\u5c40\u4e8b\u52a1\u53d1\u8d77\u8005&#xff09;<\/h5>\n<p>\u8ba2\u5355\u670d\u52a1\u8c03\u7528\u5e93\u5b58\u670d\u52a1&#xff0c;\u901a\u8fc7 &#064;GlobalTransactional \u5f00\u542f\u5168\u5c40\u4e8b\u52a1&#xff0c;\u786e\u4fdd\u8ba2\u5355\u521b\u5efa\u4e0e\u5e93\u5b58\u6263\u51cf\u8981\u4e48\u540c\u65f6\u6210\u529f&#xff0c;\u8981\u4e48\u540c\u65f6\u56de\u6eda&#xff1a;<\/p>\n<p><span class=\"token annotation punctuation\">&#064;Service<\/span><br \/>\n<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">OrderServiceImpl<\/span> <span class=\"token keyword\">implements<\/span> <span class=\"token class-name\">OrderService<\/span> <span class=\"token punctuation\">{<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Autowired<\/span><br \/>\n    <span class=\"token keyword\">private<\/span> <span class=\"token class-name\">OrderMapper<\/span> orderMapper<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Autowired<\/span><br \/>\n    <span class=\"token keyword\">private<\/span> <span class=\"token class-name\">RestTemplate<\/span> restTemplate<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token annotation punctuation\">&#064;Override<\/span><br \/>\n    <span class=\"token annotation punctuation\">&#064;GlobalTransactional<\/span><span class=\"token punctuation\">(<\/span>name <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;createOrderTx&#034;<\/span><span class=\"token punctuation\">,<\/span> rollbackFor <span class=\"token operator\">&#061;<\/span> <span class=\"token class-name\">Exception<\/span><span class=\"token punctuation\">.<\/span><span class=\"token keyword\">class<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">public<\/span> <span class=\"token class-name\">Order<\/span> <span class=\"token function\">createOrder<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Long<\/span> userId<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">Long<\/span> productId<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">Integer<\/span> count<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token comment\">\/\/ 1. \u521b\u5efa\u8ba2\u5355&#xff08;\u672c\u5730\u4e8b\u52a1&#xff09;<\/span><br \/>\n        <span class=\"token class-name\">Order<\/span> order <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">Order<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        order<span class=\"token punctuation\">.<\/span><span class=\"token function\">setUserId<\/span><span class=\"token punctuation\">(<\/span>userId<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        order<span class=\"token punctuation\">.<\/span><span class=\"token function\">setProductId<\/span><span class=\"token punctuation\">(<\/span>productId<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        order<span class=\"token punctuation\">.<\/span><span class=\"token function\">setCount<\/span><span class=\"token punctuation\">(<\/span>count<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        order<span class=\"token punctuation\">.<\/span><span class=\"token function\">setStatus<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ 0-\u5f85\u652f\u4ed8<\/span><br \/>\n        orderMapper<span class=\"token punctuation\">.<\/span><span class=\"token function\">insert<\/span><span class=\"token punctuation\">(<\/span>order<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>        <span class=\"token comment\">\/\/ 2. \u8c03\u7528\u5e93\u5b58\u670d\u52a1\u6263\u51cf\u5e93\u5b58&#xff08;\u8fdc\u7a0b\u5206\u652f\u4e8b\u52a1&#xff09;<\/span><br \/>\n        <span class=\"token keyword\">boolean<\/span> deductResult <span class=\"token operator\">&#061;<\/span> restTemplate<span class=\"token punctuation\">.<\/span><span class=\"token function\">postForObject<\/span><span class=\"token punctuation\">(<\/span><br \/>\n            <span class=\"token string\">&#034;http:\/\/stock-service\/stock\/deduct&#034;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">StockDeductDTO<\/span><span class=\"token punctuation\">(<\/span>productId<span class=\"token punctuation\">,<\/span> count<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n            <span class=\"token class-name\">Boolean<\/span><span class=\"token punctuation\">.<\/span><span class=\"token keyword\">class<\/span><br \/>\n        <span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>deductResult<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token keyword\">throw<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">RuntimeException<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u5e93\u5b58\u6263\u51cf\u5931\u8d25&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><\/p>\n<p>        <span class=\"token keyword\">return<\/span> order<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h5>2.3.3 \u56de\u6eda\u65e5\u5fd7\u8868\u521b\u5efa<\/h5>\n<p>AT \u6a21\u5f0f\u9700\u5728\u6bcf\u4e2a\u4e1a\u52a1\u6570\u636e\u5e93&#xff08;order_db\u3001stock_db&#xff09;\u4e2d\u521b\u5efa undo_log \u8868&#xff0c;\u7528\u4e8e\u5b58\u50a8\u56de\u6eda\u65e5\u5fd7&#xff0c;\u5efa\u8868\u8bed\u53e5\u5982\u4e0b&#xff1a;<\/p>\n<p><span class=\"token keyword\">CREATE<\/span> <span class=\"token keyword\">TABLE<\/span> <span class=\"token keyword\">IF<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token keyword\">EXISTS<\/span> <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>undo_log<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token punctuation\">(<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>id<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">BIGINT<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">AUTO_INCREMENT<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u4e3b\u952e&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>branch_id<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">BIGINT<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u5206\u652f\u4e8b\u52a1ID&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>xid<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">VARCHAR<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">128<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u5168\u5c40\u4e8b\u52a1ID&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>context<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">VARCHAR<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">128<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u4e0a\u4e0b\u6587\u4fe1\u606f&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>rollback_info<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">LONGBLOB<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u56de\u6eda\u4fe1\u606f&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>log_status<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">INT<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u65e5\u5fd7\u72b6\u6001&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>log_created<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">DATETIME<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u521b\u5efa\u65f6\u95f4&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>log_modified<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token keyword\">DATETIME<\/span> <span class=\"token operator\">NOT<\/span> <span class=\"token boolean\">NULL<\/span> <span class=\"token keyword\">COMMENT<\/span> <span class=\"token string\">&#039;\u4fee\u6539\u65f6\u95f4&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token keyword\">PRIMARY<\/span> <span class=\"token keyword\">KEY<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>id<span class=\"token punctuation\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span><br \/>\n  <span class=\"token keyword\">UNIQUE<\/span> <span class=\"token keyword\">KEY<\/span> <span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>ux_undo_log<span class=\"token punctuation\">&#096;<\/span><\/span> <span class=\"token punctuation\">(<\/span><span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>xid<span class=\"token punctuation\">&#096;<\/span><\/span><span class=\"token punctuation\">,<\/span><span class=\"token identifier\"><span class=\"token punctuation\">&#096;<\/span>branch_id<span class=\"token punctuation\">&#096;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">ENGINE<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">InnoDB<\/span> <span class=\"token keyword\">DEFAULT<\/span> <span class=\"token keyword\">CHARSET<\/span> <span class=\"token operator\">&#061;<\/span> utf8mb4 <span class=\"token keyword\">COMMENT<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#039;AT\u6a21\u5f0f\u56de\u6eda\u65e5\u5fd7\u8868&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h3>\u4e09\u3001\u529f\u80fd\u6d4b\u8bd5\u4e0e\u95ee\u9898\u6392\u67e5<\/h3>\n<h4>3.1 \u6b63\u5e38\u573a\u666f\u6d4b\u8bd5<\/h4>\n<p>\u8c03\u7528\u8ba2\u5355\u670d\u52a1\u521b\u5efa\u8ba2\u5355\u63a5\u53e3&#xff0c;\u4f20\u5165\u5408\u6cd5\u53c2\u6570&#xff08;\u5e93\u5b58\u5145\u8db3&#xff09;&#xff0c;\u89c2\u5bdf\u5230&#xff1a;\u8ba2\u5355\u8868\u65b0\u589e\u8bb0\u5f55&#xff0c;\u5e93\u5b58\u8868\u5bf9\u5e94\u5546\u54c1\u5e93\u5b58\u6263\u51cf&#xff0c;Nacos \u4e2d Seata \u670d\u52a1\u6b63\u5e38&#xff0c;\u5168\u5c40\u4e8b\u52a1\u72b6\u6001\u4e3a\u63d0\u4ea4\u3002<\/p>\n<h4>3.2 \u5f02\u5e38\u573a\u666f\u6d4b\u8bd5<\/h4>\n<p>\u6a21\u62df\u5e93\u5b58\u4e0d\u8db3\u573a\u666f&#xff0c;\u8c03\u7528\u63a5\u53e3\u540e\u629b\u51fa\u5f02\u5e38&#xff1a;\u8ba2\u5355\u8868\u672a\u65b0\u589e\u8bb0\u5f55&#xff08;\u672c\u5730\u4e8b\u52a1\u56de\u6eda&#xff09;&#xff0c;\u5e93\u5b58\u8868\u6570\u636e\u65e0\u53d8\u5316&#xff08;\u5206\u652f\u4e8b\u52a1\u56de\u6eda&#xff09;&#xff0c;undo_log \u8868\u4e34\u65f6\u8bb0\u5f55\u88ab\u5220\u9664&#xff0c;\u9a8c\u8bc1\u5206\u5e03\u5f0f\u4e8b\u52a1\u56de\u6eda\u673a\u5236\u751f\u6548\u3002<\/p>\n<h4>3.3 \u5e38\u89c1\u95ee\u9898\u6392\u67e5<\/h4>\n<ul>\n<li>\n<p>Seata \u670d\u52a1\u65e0\u6cd5\u6ce8\u518c\u5230 Nacos&#xff1a;\u68c0\u67e5 Seata Server \u4e0e\u5ba2\u6237\u7aef\u7684 group\u3001namespace \u662f\u5426\u4e00\u81f4&#xff0c;Nacos \u5730\u5740\u662f\u5426\u53ef\u8bbf\u95ee&#xff0c;\u9632\u706b\u5899\u662f\u5426\u5f00\u653e 8848\u30018091 \u7aef\u53e3\u3002<\/p>\n<\/li>\n<li>\n<p>AT \u6a21\u5f0f\u56de\u6eda\u5931\u8d25&#xff1a;\u786e\u8ba4\u4e1a\u52a1\u6570\u636e\u5e93\u662f\u5426\u521b\u5efa undo_log \u8868&#xff0c;Seata \u6570\u636e\u6e90\u4ee3\u7406\u662f\u5426\u542f\u7528&#xff08;data-source-proxy-mode \u914d\u7f6e\u4e3a AT&#xff09;&#xff0c;\u4e1a\u52a1 SQL \u662f\u5426\u652f\u6301\u5e42\u7b49\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u5168\u5c40\u4e8b\u52a1 ID \u4f20\u9012\u5931\u8d25&#xff1a;\u786e\u4fdd\u5fae\u670d\u52a1\u95f4\u8c03\u7528\u65f6\u643a\u5e26 XID \u4e0a\u4e0b\u6587&#xff0c;Spring Cloud \u73af\u5883\u4e0b\u53ef\u901a\u8fc7 Seata \u81ea\u52a8\u62e6\u622a\u5668\u5b9e\u73b0&#xff0c;\u65e0\u9700\u624b\u52a8\u4f20\u9012\u3002<\/p>\n<\/li>\n<\/ul>\n<h3>\u56db\u3001\u751f\u4ea7\u73af\u5883\u4f18\u5316\u5efa\u8bae<\/h3>\n<li>\n<p>\u914d\u7f6e\u4e2d\u5fc3\u4f18\u5316&#xff1a;\u5c06 Seata \u5ba2\u6237\u7aef\u914d\u7f6e\u7edf\u4e00\u8fc1\u79fb\u81f3 Nacos \u914d\u7f6e\u4e2d\u5fc3&#xff0c;\u901a\u8fc7 dataId \u533a\u5206\u4e0d\u540c\u73af\u5883&#xff08;\u5982 seata-dev.yaml\u3001seata-prod.yaml&#xff09;&#xff0c;\u5b9e\u73b0\u52a8\u6001\u914d\u7f6e\u66f4\u65b0&#xff0c;\u907f\u514d\u91cd\u542f\u670d\u52a1\u3002<\/p>\n<\/li>\n<li>\n<p>Seata Server \u96c6\u7fa4\u90e8\u7f72&#xff1a;\u751f\u4ea7\u73af\u5883\u9700\u90e8\u7f72 Seata Server \u96c6\u7fa4&#xff0c;\u901a\u8fc7 Nacos \u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861&#xff0c;\u907f\u514d\u5355\u70b9\u6545\u969c&#xff0c;\u540c\u65f6\u5c06\u4e8b\u52a1\u5143\u6570\u636e\u5b58\u50a8\u5207\u6362\u4e3a MySQL \u4e3b\u4ece\u6216 Redis \u96c6\u7fa4&#xff0c;\u63d0\u5347\u53ef\u9760\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u6027\u80fd\u4f18\u5316&#xff1a;AT \u6a21\u5f0f\u4e0b&#xff0c;undo_log \u8868\u53ef\u6dfb\u52a0\u7d22\u5f15\u4f18\u5316\u67e5\u8be2\u6548\u7387&#xff1b;\u907f\u514d\u957f\u4e8b\u52a1\u5360\u7528\u5168\u5c40\u9501&#xff0c;\u62c6\u5206\u5927\u4e8b\u52a1\u4e3a\u591a\u4e2a\u5c0f\u4e8b\u52a1&#xff1b;\u5408\u7406\u8bbe\u7f6e\u4e8b\u52a1\u8d85\u65f6\u65f6\u95f4&#xff0c;\u9632\u6b62\u8d44\u6e90\u6cc4\u9732\u3002<\/p>\n<\/li>\n<li>\n<p>\u76d1\u63a7\u544a\u8b66&#xff1a;\u96c6\u6210 Seata \u76d1\u63a7\u9762\u677f&#xff0c;\u5b9e\u65f6\u76d1\u63a7\u5168\u5c40\u4e8b\u52a1\u6210\u529f\u7387\u3001\u56de\u6eda\u7387\u7b49\u6307\u6807&#xff1b;\u901a\u8fc7 Nacos \u5065\u5eb7\u68c0\u67e5\u673a\u5236&#xff0c;\u53ca\u65f6\u53d1\u73b0 Seata Server \u6216\u5fae\u670d\u52a1\u5b9e\u4f8b\u5f02\u5e38&#xff0c;\u914d\u7f6e\u544a\u8b66\u901a\u77e5\u3002<\/p>\n<\/li>\n<h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<p>Nacos \u4e0e Seata \u7684\u6574\u5408&#xff0c;\u65e2\u501f\u52a9 Nacos \u5b9e\u73b0\u4e86\u670d\u52a1\u7684\u52a8\u6001\u53d1\u73b0\u4e0e\u914d\u7f6e\u7edf\u4e00&#xff0c;\u53c8\u901a\u8fc7 Seata \u7b80\u5316\u4e86\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u5f00\u53d1\u6210\u672c&#xff0c;\u5c24\u5176 AT \u6a21\u5f0f\u51e0\u4e4e\u65e0\u9700\u4fb5\u5165\u4e1a\u52a1\u4ee3\u7801&#xff0c;\u5373\u53ef\u5b9e\u73b0\u8de8\u670d\u52a1\u6570\u636e\u4e00\u81f4\u6027\u4fdd\u969c\u3002\u672c\u6587\u901a\u8fc7\u7ecf\u5178\u7535\u5546\u573a\u666f&#xff0c;\u5b8c\u6574\u5448\u73b0\u4e86\u4ece\u73af\u5883\u90e8\u7f72\u3001\u914d\u7f6e\u6574\u5408\u5230\u4e1a\u52a1\u5b9e\u73b0\u7684\u5168\u6d41\u7a0b&#xff0c;\u540c\u65f6\u63d0\u4f9b\u4e86\u751f\u4ea7\u73af\u5883\u4f18\u5316\u65b9\u6848&#xff0c;\u53ef\u4e3a\u5fae\u670d\u52a1\u67b6\u6784\u4e0b\u7684\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898\u63d0\u4f9b\u53ef\u843d\u5730\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u540e\u7eed\u53ef\u8fdb\u4e00\u6b65\u63a2\u7d22 Seata TCC \u6a21\u5f0f\u4e0e Nacos \u7684\u6574\u5408\u7684\u9002\u914d\u573a\u666f&#xff0c;\u4ee5\u53ca\u7ed3\u5408 Sentinel \u5b9e\u73b0\u6d41\u91cf\u63a7\u5236\u4e0e\u4e8b\u52a1\u7194\u65ad\u7684\u8054\u52a8\u65b9\u6848&#xff0c;\u6784\u5efa\u66f4\u5065\u58ee\u7684\u5fae\u670d\u52a1\u4f53\u7cfb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5fae\u670d\u52a1\u67b6\u6784\u4e2d&#xff0c;\u4e1a\u52a1\u88ab\u62c6\u5206\u81f3\u591a\u4e2a\u72ec\u7acb\u670d\u52a1&#xff0c;\u6bcf\u4e2a\u670d\u52a1\u62e5\u6709\u4e13\u5c5e\u6570\u636e\u6e90\u3002\u5f53\u4e00\u7b14\u4e1a\u52a1\u8de8\u591a\u4e2a\u670d\u52a1\u64cd\u4f5c\u6570\u636e\u65f6&#xff08;\u5982\u7535\u5546\u4e0b\u5355\u9700\u8054\u52a8\u8ba2\u5355\u3001\u5e93\u5b58\u3001\u652f\u4ed8\u670d\u52a1&#xff09;&#xff0c;\u4f20\u7edf\u672c\u5730\u4e8b\u52a1\u65e0\u6cd5\u4fdd\u8bc1\u8de8\u670d\u52a1\u6570\u636e\u4e00\u81f4\u6027&#xff0c;\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898\u968f\u4e4b\u51f8\u663e\u3002Nacos \u4f5c\u4e3a\u963f\u91cc\u5f00\u6e90\u7684\u670d\u52a1\u6ce8\u518c\u4e0e\u914d\u7f6e\u4e2d\u5fc3&#xff0c;\u80fd\u63d0\u4f9b\u9ad8\u6548\u7684\u670d\u52a1\u53d1\u73b0\u4e0e\u52a8\u6001\u914d\u7f6e\u80fd\u529b&#xff1b;Seata \u5219\u662f\u8f7b\u91cf\u7ea7\u5206\u5e03\u5f0f\u4e8b\u52a1\u6846\u67b6&#xff0c;\u4e13\u6ce8\u4e8e\u5fae\u670d\u52a1\u573a\u666f\u4e0b\u7684\u4e8b\u52a1\u4e00\u81f4\u6027\u4fdd\u969c<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[963,664,1348],"topic":[],"class_list":["post-66673","post","type-post","status-publish","format-standard","hentry","category-server","tag-spring-cloud","tag-664","tag-1348"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/66673.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u5fae\u670d\u52a1\u67b6\u6784\u4e2d&#xff0c;\u4e1a\u52a1\u88ab\u62c6\u5206\u81f3\u591a\u4e2a\u72ec\u7acb\u670d\u52a1&#xff0c;\u6bcf\u4e2a\u670d\u52a1\u62e5\u6709\u4e13\u5c5e\u6570\u636e\u6e90\u3002\u5f53\u4e00\u7b14\u4e1a\u52a1\u8de8\u591a\u4e2a\u670d\u52a1\u64cd\u4f5c\u6570\u636e\u65f6&#xff08;\u5982\u7535\u5546\u4e0b\u5355\u9700\u8054\u52a8\u8ba2\u5355\u3001\u5e93\u5b58\u3001\u652f\u4ed8\u670d\u52a1&#xff09;&#xff0c;\u4f20\u7edf\u672c\u5730\u4e8b\u52a1\u65e0\u6cd5\u4fdd\u8bc1\u8de8\u670d\u52a1\u6570\u636e\u4e00\u81f4\u6027&#xff0c;\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898\u968f\u4e4b\u51f8\u663e\u3002Nacos \u4f5c\u4e3a\u963f\u91cc\u5f00\u6e90\u7684\u670d\u52a1\u6ce8\u518c\u4e0e\u914d\u7f6e\u4e2d\u5fc3&#xff0c;\u80fd\u63d0\u4f9b\u9ad8\u6548\u7684\u670d\u52a1\u53d1\u73b0\u4e0e\u52a8\u6001\u914d\u7f6e\u80fd\u529b&#xff1b;Seata \u5219\u662f\u8f7b\u91cf\u7ea7\u5206\u5e03\u5f0f\u4e8b\u52a1\u6846\u67b6&#xff0c;\u4e13\u6ce8\u4e8e\u5fae\u670d\u52a1\u573a\u666f\u4e0b\u7684\u4e8b\u52a1\u4e00\u81f4\u6027\u4fdd\u969c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/66673.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-27T01:05:28+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66673.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/66673.html\",\"name\":\"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-27T01:05:28+00:00\",\"dateModified\":\"2026-01-27T01:05:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/66673.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/66673.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66673.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/66673.html","og_locale":"zh_CN","og_type":"article","og_title":"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u5fae\u670d\u52a1\u67b6\u6784\u4e2d&#xff0c;\u4e1a\u52a1\u88ab\u62c6\u5206\u81f3\u591a\u4e2a\u72ec\u7acb\u670d\u52a1&#xff0c;\u6bcf\u4e2a\u670d\u52a1\u62e5\u6709\u4e13\u5c5e\u6570\u636e\u6e90\u3002\u5f53\u4e00\u7b14\u4e1a\u52a1\u8de8\u591a\u4e2a\u670d\u52a1\u64cd\u4f5c\u6570\u636e\u65f6&#xff08;\u5982\u7535\u5546\u4e0b\u5355\u9700\u8054\u52a8\u8ba2\u5355\u3001\u5e93\u5b58\u3001\u652f\u4ed8\u670d\u52a1&#xff09;&#xff0c;\u4f20\u7edf\u672c\u5730\u4e8b\u52a1\u65e0\u6cd5\u4fdd\u8bc1\u8de8\u670d\u52a1\u6570\u636e\u4e00\u81f4\u6027&#xff0c;\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898\u968f\u4e4b\u51f8\u663e\u3002Nacos \u4f5c\u4e3a\u963f\u91cc\u5f00\u6e90\u7684\u670d\u52a1\u6ce8\u518c\u4e0e\u914d\u7f6e\u4e2d\u5fc3&#xff0c;\u80fd\u63d0\u4f9b\u9ad8\u6548\u7684\u670d\u52a1\u53d1\u73b0\u4e0e\u52a8\u6001\u914d\u7f6e\u80fd\u529b&#xff1b;Seata \u5219\u662f\u8f7b\u91cf\u7ea7\u5206\u5e03\u5f0f\u4e8b\u52a1\u6846\u67b6&#xff0c;\u4e13\u6ce8\u4e8e\u5fae\u670d\u52a1\u573a\u666f\u4e0b\u7684\u4e8b\u52a1\u4e00\u81f4\u6027\u4fdd\u969c","og_url":"https:\/\/www.wsisp.com\/helps\/66673.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-27T01:05:28+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/66673.html","url":"https:\/\/www.wsisp.com\/helps\/66673.html","name":"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-27T01:05:28+00:00","dateModified":"2026-01-27T01:05:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/66673.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/66673.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/66673.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Nacos\u884c\u4e1a\u5e94\u7528 05\uff0cNacos \u4e0e Seata \u6574\u5408\uff1a\u5206\u5e03\u5f0f\u4e8b\u52a1\u89e3\u51b3\u65b9\u6848\u5b9e\u8df5"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/66673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=66673"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/66673\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=66673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=66673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=66673"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=66673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}