diff --git a/pjcloud-app-server/pjcloud-app-server-biz/pom.xml b/pjcloud-app-server/pjcloud-app-server-biz/pom.xml index b09ae7397..6788632a8 100644 --- a/pjcloud-app-server/pjcloud-app-server-biz/pom.xml +++ b/pjcloud-app-server/pjcloud-app-server-biz/pom.xml @@ -95,6 +95,12 @@ com.bsd pjcloud-common-swagger + + + com.bsd + pjcloud-common-seata + + diff --git a/pjcloud-app-server/pjcloud-app-server-biz/src/main/java/com/bsd/pjcloud/app/controller/AppUserAutoLoginController.java b/pjcloud-app-server/pjcloud-app-server-biz/src/main/java/com/bsd/pjcloud/app/controller/AppUserAutoLoginController.java index a214176ff..b8c0bfb84 100644 --- a/pjcloud-app-server/pjcloud-app-server-biz/src/main/java/com/bsd/pjcloud/app/controller/AppUserAutoLoginController.java +++ b/pjcloud-app-server/pjcloud-app-server-biz/src/main/java/com/bsd/pjcloud/app/controller/AppUserAutoLoginController.java @@ -35,10 +35,12 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; +import org.apache.seata.spring.annotation.GlobalTransactional; import org.springframework.http.HttpHeaders; import org.springframework.security.oauth2.core.OAuth2AccessToken; import org.springframework.security.oauth2.core.OAuth2RefreshToken; import org.springframework.security.oauth2.server.authorization.authentication.OAuth2AccessTokenAuthenticationToken; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; @@ -76,6 +78,8 @@ public class AppUserAutoLoginController { @GetMapping("/zzdsso/{token}") @Operation(summary = "浙政钉单点登录") @Inner(value = false) + @GlobalTransactional + @Transactional(rollbackFor = Exception.class) //todo 引入seata分布式事务 public R zzdsso(@PathVariable(name = "token") String token) { diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml b/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml index 87b707a64..ddcd9854b 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml @@ -94,6 +94,11 @@ org.springframework.boot spring-boot-starter-test + + + com.bsd + pjcloud-common-seata + diff --git a/pjcloud-upms/pjcloud-upms-biz/pom.xml b/pjcloud-upms/pjcloud-upms-biz/pom.xml index dec2c48bc..086b9dc78 100644 --- a/pjcloud-upms/pjcloud-upms-biz/pom.xml +++ b/pjcloud-upms/pjcloud-upms-biz/pom.xml @@ -184,6 +184,12 @@ org.springframework.boot spring-boot-starter-undertow + + + com.bsd + pjcloud-common-seata + + diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserController.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserController.java index 3be756660..8b932e3da 100644 --- a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserController.java +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/controller/SysUserController.java @@ -44,6 +44,7 @@ import jakarta.validation.Valid; import lombok.AllArgsConstructor; import org.springdoc.core.annotations.ParameterObject; import org.springframework.http.HttpHeaders; +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; @@ -326,7 +327,9 @@ public class SysUserController { @GetMapping("/getUserByMobile") @Inner + @Transactional(rollbackFor = Exception.class) public R> getUserByMobile(@RequestParam("mobile") String mobile) { + int i=8/0; return R.ok(userService.list(Wrappers.lambdaQuery().eq(SysUser::getPhone, mobile))); } } diff --git a/seata/Dockerfile b/seata/Dockerfile new file mode 100644 index 000000000..5e7f19dca --- /dev/null +++ b/seata/Dockerfile @@ -0,0 +1,43 @@ +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# the Dockerfile support x86 & arrch64 +# build: +# 1. mvn -Prelease-seata -Dmaven.test.skip=true clean install -U +# 2. cd distribution/target/seata-server-xxx/seata/ +# 3. docker build --no-cache --build-arg SEATA_VERSION=1.6.0-SNAPSHOT -t seata-server:1.6.0-dev . +# +# run: +# 1. docker run --name=seata-server -d seata-server:1.6.0-dev +# +# https://hub.docker.com/orgs/seataio +FROM openjdk:8u342 + +# set label +LABEL maintainer="Seata " + +WORKDIR /$BASE_DIR + +# ADD FORM distribution +ADD bin/ /seata-server/bin +ADD ext/ /seata-server/ext +ADD target/ /seata-server/target +ADD lib/ /seata-server/lib +ADD conf/ /seata-server/conf +ADD LICENSE /seata-server/LICENSE + +# set extra environment +ENV LOADER_PATH="/seata-server/lib" +ENV TZ="Asia/Shanghai" +CMD ["bash","-c","/seata-server/bin/seata-server.sh && tail -f /dev/null"] diff --git a/seata/LICENSE b/seata/LICENSE new file mode 100644 index 000000000..f1b55a144 --- /dev/null +++ b/seata/LICENSE @@ -0,0 +1,218 @@ + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (properties) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +======================================================================= +Seata Subcomponents: + +The Seata project contains subcomponents with separate copyright +notices and license terms. Your use of the source code for the these +subcomponents is subject to the terms and conditions of the following +licenses. + +======================================================================== +Apache 2.0 licenses +======================================================================== + +The following components are provided under the Apache License. See project link for details. +The text of each license is the standard Apache 2.0 license. + + Apache: skywalking 8.4.0: https://github.com/apache/skywalking, Apache 2.0 \ No newline at end of file diff --git a/seata/conf/application.example.yml b/seata/conf/application.example.yml new file mode 100644 index 000000000..58c6c1188 --- /dev/null +++ b/seata/conf/application.example.yml @@ -0,0 +1,213 @@ +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +server: + port: 7091 + +spring: + application: + name: seata-server + +logging: + config: classpath:logback-spring.xml + file: + path: ${log.home:${user.home}/logs/seata} + extend: + logstash-appender: + destination: 127.0.0.1:4560 + kafka-appender: + bootstrap-servers: 127.0.0.1:9092 + topic: logback_to_logstash + +seata: + config: + # support: nacos 、 consul 、 apollo 、 zk 、 etcd3 + type: file + nacos: + server-addr: 127.0.0.1:8848 + namespace: + group: SEATA_GROUP + username: + password: + context-path: + ##if use MSE Nacos with auth, mutex with username/password attribute + #access-key: + #secret-key: + data-id: seataServer.properties + consul: + server-addr: 127.0.0.1:8500 + acl-token: + key: seata.properties + apollo: + appId: seata-server + apollo-meta: http://192.168.1.204:8801 + apollo-config-service: http://192.168.1.204:8080 + namespace: application + apollo-access-key-secret: + cluster: seata + zk: + server-addr: 127.0.0.1:2181 + session-timeout: 6000 + connect-timeout: 2000 + username: + password: + node-path: /seata/seata.properties + etcd3: + server-addr: http://localhost:2379 + key: seata.properties + registry: + # support: nacos 、 eureka 、 redis 、 zk 、 consul 、 etcd3 、 sofa + type: file + preferred-networks: 30.240.* + nacos: + application: seata-server + server-addr: 127.0.0.1:8848 + group: SEATA_GROUP + namespace: + cluster: default + username: + password: + context-path: + ##if use MSE Nacos with auth, mutex with username/password attribute + #access-key: + #secret-key: + eureka: + service-url: http://localhost:8761/eureka + application: default + weight: 1 + redis: + server-addr: localhost:6379 + db: 0 + password: + cluster: default + timeout: 0 + zk: + cluster: default + server-addr: 127.0.0.1:2181 + session-timeout: 6000 + connect-timeout: 2000 + username: + password: + consul: + cluster: default + server-addr: 127.0.0.1:8500 + acl-token: + etcd3: + cluster: default + server-addr: http://localhost:2379 + sofa: + server-addr: 127.0.0.1:9603 + application: default + region: DEFAULT_ZONE + datacenter: DefaultDataCenter + cluster: default + group: SEATA_GROUP + address-wait-time: 3000 + + server: + raft: + group: default + cluster: + snapshot-interval: 600 + apply-batch: 32 + max-append-bufferSize: 262144 + max-replicator-inflight-msgs: 256 + disruptor-buffer-size: 16384 + election-timeout-ms: 1000 + reporter-enabled: false + reporter-initial-delay: 60 + serialization: jackson + compressor: none + sync: true # sync log&snapshot to disk + service-port: 8091 #If not configured, the default is '${server.port} + 1000' + max-commit-retry-timeout: -1 + max-rollback-retry-timeout: -1 + rollback-retry-timeout-unlock-enable: false + enable-check-auth: true + enable-parallel-request-handle: true + enable-parallel-handle-branch: false + retry-dead-threshold: 130000 + xaer-nota-retry-timeout: 60000 + enableParallelRequestHandle: true + recovery: + committing-retry-period: 1000 + async-committing-retry-period: 1000 + rollbacking-retry-period: 1000 + timeout-retry-period: 1000 + undo: + log-save-days: 7 + log-delete-period: 86400000 + session: + branch-async-queue-size: 5000 #branch async remove queue size + enable-branch-async-remove: false #enable to asynchronous remove branchSession + store: + # support: file 、 db 、 redis 、 raft + mode: file + session: + mode: file + lock: + mode: file + file: + dir: sessionStore + max-branch-session-size: 16384 + max-global-session-size: 512 + file-write-buffer-cache-size: 16384 + session-reload-read-size: 100 + flush-disk-mode: async + db: + datasource: druid + db-type: mysql + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true + user: mysql + password: mysql + min-conn: 10 + max-conn: 100 + global-table: global_table + branch-table: branch_table + lock-table: lock_table + distributed-lock-table: distributed_lock + query-limit: 1000 + max-wait: 5000 + redis: + mode: single + # support: lua 、 pipeline + type: lua + database: 0 + min-conn: 10 + max-conn: 100 + password: + max-total: 100 + query-limit: 1000 + single: + host: 127.0.0.1 + port: 6379 + sentinel: + master-name: + sentinel-hosts: + sentinel-password: + metrics: + enabled: false + registry-type: compact + exporter-list: prometheus + exporter-prometheus-port: 9898 + transport: + rpc-tc-request-timeout: 15000 + enable-tc-server-batch-send-response: false + shutdown: + wait: 3 + thread-factory: + boss-thread-prefix: NettyBoss + worker-thread-prefix: NettyServerNIOWorker + boss-thread-size: 1 diff --git a/seata/conf/application.raft.example.yml b/seata/conf/application.raft.example.yml new file mode 100644 index 000000000..5d07b8b27 --- /dev/null +++ b/seata/conf/application.raft.example.yml @@ -0,0 +1,132 @@ +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +server: + port: 7091 + +spring: + application: + name: seata-server + +logging: + config: classpath:logback-spring.xml + file: + path: ${log.home:${user.home}/logs/seata} + extend: + logstash-appender: + destination: 127.0.0.1:4560 + kafka-appender: + bootstrap-servers: 127.0.0.1:9092 + topic: logback_to_logstash + +seata: + config: + # support: nacos 、 consul 、 apollo 、 zk 、 etcd3 + type: file + nacos: + server-addr: 127.0.0.1:8848 + namespace: + group: SEATA_GROUP + username: + password: + context-path: + ##if use MSE Nacos with auth, mutex with username/password attribute + #access-key: + #secret-key: + data-id: seataServer.properties + consul: + server-addr: 127.0.0.1:8500 + acl-token: + key: seata.properties + apollo: + appId: seata-server + apollo-meta: http://192.168.1.204:8801 + apollo-config-service: http://192.168.1.204:8080 + namespace: application + apollo-access-key-secret: + cluster: seata + zk: + server-addr: 127.0.0.1:2181 + session-timeout: 6000 + connect-timeout: 2000 + username: + password: + node-path: /seata/seata.properties + etcd3: + server-addr: http://localhost:2379 + key: seata.properties + registry: + # support: nacos 、 eureka 、 redis 、 zk 、 consul 、 etcd3 、 sofa + type: file + preferred-networks: 30.240.* + server: + raft: + group: default + server-addr: + snapshot-interval: 600 + apply-batch: 32 + max-append-bufferSize: 262144 + max-replicator-inflight-msgs: 256 + disruptor-buffer-size: 16384 + election-timeout-ms: 1000 + reporter-enabled: false + reporter-initial-delay: 60 + serialization: jackson + compressor: none + sync: true # sync log&snapshot to disk + service-port: 8091 #If not configured, the default is '${server.port} + 1000' + max-commit-retry-timeout: -1 + max-rollback-retry-timeout: -1 + rollback-retry-timeout-unlock-enable: false + enable-check-auth: true + enable-parallel-request-handle: true + enable-parallel-handle-branch: false + retry-dead-threshold: 130000 + xaer-nota-retry-timeout: 60000 + enableParallelRequestHandle: true + recovery: + committing-retry-period: 1000 + async-committing-retry-period: 1000 + rollbacking-retry-period: 1000 + timeout-retry-period: 1000 + undo: + log-save-days: 7 + log-delete-period: 86400000 + session: + branch-async-queue-size: 5000 #branch async remove queue size + enable-branch-async-remove: false #enable to asynchronous remove branchSession + store: + # support: file + mode: file + file: + dir: sessionStore + max-branch-session-size: 16384 + max-global-session-size: 512 + file-write-buffer-cache-size: 16384 + session-reload-read-size: 100 + flush-disk-mode: async + metrics: + enabled: false + registry-type: compact + exporter-list: prometheus + exporter-prometheus-port: 9898 + transport: + rpc-tc-request-timeout: 15000 + enable-tc-server-batch-send-response: false + shutdown: + wait: 3 + thread-factory: + boss-thread-prefix: NettyBoss + worker-thread-prefix: NettyServerNIOWorker + boss-thread-size: 1 diff --git a/seata/conf/application.yml b/seata/conf/application.yml new file mode 100644 index 000000000..5f8fdc324 --- /dev/null +++ b/seata/conf/application.yml @@ -0,0 +1,107 @@ +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +server: + port: 7091 + +spring: + application: + name: seata-server + +logging: + config: classpath:logback-spring.xml + file: + path: ${log.home:${user.home}/logs/seata} + extend: + logstash-appender: + destination: 127.0.0.1:4560 + kafka-appender: + bootstrap-servers: 127.0.0.1:9092 + topic: logback_to_logstash + +console: + user: + username: seata + password: seata +seata: + config: + # support: nacos, consul, apollo, zk, etcd3 + type: nacos + nacos: + server-addr: 127.0.0.1:8848 + namespace: + group: SEATA_GROUP + username: nacos + password: nacos + context-path: + ##if use MSE Nacos with auth, mutex with username/password attribute + #access-key: + #secret-key: + data-id: seataServer.properties + registry: + # support: nacos, eureka, redis, zk, consul, etcd3, sofa + type: nacos + preferred-networks: 30.240.* + nacos: + application: seata-server + server-addr: 127.0.0.1:8848 + group: SEATA_GROUP + namespace: + cluster: default + username: nacos + password: nacos + context-path: + store: + # support: file 、 db 、 redis 、 raft + mode: db + session: + mode: db + lock: + mode: db + file: + dir: sessionStore + max-branch-session-size: 16384 + max-global-session-size: 512 + file-write-buffer-cache-size: 16384 + session-reload-read-size: 100 + flush-disk-mode: async + db: + 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: root + min-conn: 10 + max-conn: 100 + global-table: global_table + branch-table: branch_table + lock-table: lock_table + distributed-lock-table: distributed_lock + query-limit: 1000 + max-wait: 5000 + security: + secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017 + tokenValidityInMilliseconds: 1800000 + ignore: + urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.jpeg,/**/*.ico,/api/v1/auth/login,/metadata/v1/** + + + transport: + enableTmClientChannelCheckFailFast: true + enableRmClientChannelCheckFailFast: true + +transport: + enableTmClientChannelCheckFailFast: true + enableRmClientChannelCheckFailFast: true \ No newline at end of file diff --git a/seata/conf/logback-spring.xml b/seata/conf/logback-spring.xml new file mode 100644 index 000000000..490141ac6 --- /dev/null +++ b/seata/conf/logback-spring.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + 0 + 2048 + true + + + + + true + 0 + 2048 + true + + + + true + 0 + 1024 + true + + + + true + 0 + 1024 + true + + + + + + + + + + + + + + + + + + + diff --git a/seata/conf/logback/console-appender.xml b/seata/conf/logback/console-appender.xml new file mode 100644 index 000000000..542b1b46a --- /dev/null +++ b/seata/conf/logback/console-appender.xml @@ -0,0 +1,29 @@ + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + UTF-8 + + + diff --git a/seata/conf/logback/file-appender.xml b/seata/conf/logback/file-appender.xml new file mode 100644 index 000000000..9225d75ef --- /dev/null +++ b/seata/conf/logback/file-appender.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + ${LOG_FILE_PATH}/${APPLICATION_NAME:-seata-server}.${RPC_PORT}.all.log + true + + ${LOG_FILE_PATH}/history/${APPLICATION_NAME:-seata-server}.${RPC_PORT}.all.%d{yyyy-MM-dd}.%i.log.gz + 2GB + 7 + 7GB + true + + + ${FILE_LOG_PATTERN} + UTF-8 + + + + + + + WARN + ACCEPT + DENY + + ${LOG_FILE_PATH}/${APPLICATION_NAME:-seata-server}.${RPC_PORT}.warn.log + true + + ${LOG_FILE_PATH}/history/${APPLICATION_NAME:-seata-server}.${RPC_PORT}.warn.%d{yyyy-MM-dd}.%i.log.gz + 2GB + 7 + 7GB + true + + + ${FILE_LOG_PATTERN} + UTF-8 + + + + + + + ERROR + ACCEPT + DENY + + ${LOG_FILE_PATH}/${APPLICATION_NAME:-seata-server}.${RPC_PORT}.error.log + true + + ${LOG_FILE_PATH}/history/${APPLICATION_NAME:-seata-server}.${RPC_PORT}.error.%d{yyyy-MM-dd}.%i.log.gz + 2GB + 7 + 7GB + true + + + ${FILE_LOG_PATTERN} + UTF-8 + + + diff --git a/seata/conf/logback/kafka-appender.xml b/seata/conf/logback/kafka-appender.xml new file mode 100644 index 000000000..a13000a23 --- /dev/null +++ b/seata/conf/logback/kafka-appender.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + { + "@timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS}", + "level":"%p", + "app_name":"${APPLICATION_NAME:-seata-server}", + "PORT": ${RPC_PORT:-0}, + "thread_name": "%t", + "logger_name": "%logger", + "X-TX-XID": "%X{X-TX-XID:-}", + "X-TX-BRANCH-ID": "%X{X-TX-BRANCH-ID:-}", + "message": "%m", + "stack_trace": "%wex" +} + + + ${KAFKA_TOPIC} + + + bootstrap.servers=${KAFKA_BOOTSTRAP_SERVERS} + acks=0 + linger.ms=1000 + max.block.ms=0 + + diff --git a/seata/conf/logback/logstash-appender.xml b/seata/conf/logback/logstash-appender.xml new file mode 100644 index 000000000..2c2f97215 --- /dev/null +++ b/seata/conf/logback/logstash-appender.xml @@ -0,0 +1,45 @@ + + + + + + + + + + ${LOGSTASH_DESTINATION} + + + + + + { + "app_name": "${APPLICATION_NAME:-seata-server}" + } + + + + net.logstash.logback.composite.LogstashVersionJsonProvider + + net.logstash.logback.composite.loggingevent.JsonMessageJsonProvider + net.logstash.logback.composite.loggingevent.TagsJsonProvider + net.logstash.logback.composite.loggingevent.LogstashMarkersJsonProvider + net.logstash.logback.composite.loggingevent.ArgumentsJsonProvider + + + diff --git a/seata/conf/logback/metric-appender.xml b/seata/conf/logback/metric-appender.xml new file mode 100644 index 000000000..5527239e1 --- /dev/null +++ b/seata/conf/logback/metric-appender.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/seata/ext/apm-skywalking/plugins/apm-jdbc-commons-8.6.0.jar b/seata/ext/apm-skywalking/plugins/apm-jdbc-commons-8.6.0.jar new file mode 100644 index 000000000..588f8145b Binary files /dev/null and b/seata/ext/apm-skywalking/plugins/apm-jdbc-commons-8.6.0.jar differ diff --git a/seata/ext/apm-skywalking/plugins/apm-mysql-5.x-plugin-8.6.0.jar b/seata/ext/apm-skywalking/plugins/apm-mysql-5.x-plugin-8.6.0.jar new file mode 100644 index 000000000..3e750d3e1 Binary files /dev/null and b/seata/ext/apm-skywalking/plugins/apm-mysql-5.x-plugin-8.6.0.jar differ diff --git a/seata/ext/apm-skywalking/plugins/apm-mysql-6.x-plugin-8.6.0.jar b/seata/ext/apm-skywalking/plugins/apm-mysql-6.x-plugin-8.6.0.jar new file mode 100644 index 000000000..c07ec0abb Binary files /dev/null and b/seata/ext/apm-skywalking/plugins/apm-mysql-6.x-plugin-8.6.0.jar differ diff --git a/seata/ext/apm-skywalking/plugins/apm-mysql-8.x-plugin-8.6.0.jar b/seata/ext/apm-skywalking/plugins/apm-mysql-8.x-plugin-8.6.0.jar new file mode 100644 index 000000000..2e9654984 Binary files /dev/null and b/seata/ext/apm-skywalking/plugins/apm-mysql-8.x-plugin-8.6.0.jar differ diff --git a/seata/ext/apm-skywalking/plugins/apm-mysql-commons-8.6.0.jar b/seata/ext/apm-skywalking/plugins/apm-mysql-commons-8.6.0.jar new file mode 100644 index 000000000..e9ea6b169 Binary files /dev/null and b/seata/ext/apm-skywalking/plugins/apm-mysql-commons-8.6.0.jar differ diff --git a/seata/ext/apm-skywalking/plugins/apm-seata-skywalking-plugin-2.0.0.jar b/seata/ext/apm-skywalking/plugins/apm-seata-skywalking-plugin-2.0.0.jar new file mode 100644 index 000000000..2369d12ee Binary files /dev/null and b/seata/ext/apm-skywalking/plugins/apm-seata-skywalking-plugin-2.0.0.jar differ diff --git a/seata/ext/apm-skywalking/skywalking-agent.jar b/seata/ext/apm-skywalking/skywalking-agent.jar new file mode 100644 index 000000000..2f9db5998 Binary files /dev/null and b/seata/ext/apm-skywalking/skywalking-agent.jar differ diff --git a/seata/lib/DmJdbcDriver18-8.1.2.192.jar b/seata/lib/DmJdbcDriver18-8.1.2.192.jar new file mode 100644 index 000000000..2374edf50 Binary files /dev/null and b/seata/lib/DmJdbcDriver18-8.1.2.192.jar differ diff --git a/seata/lib/HikariCP-4.0.3.jar b/seata/lib/HikariCP-4.0.3.jar new file mode 100644 index 000000000..f328920f7 Binary files /dev/null and b/seata/lib/HikariCP-4.0.3.jar differ diff --git a/seata/lib/animal-sniffer-annotations-1.18.jar b/seata/lib/animal-sniffer-annotations-1.18.jar new file mode 100644 index 000000000..392527325 Binary files /dev/null and b/seata/lib/animal-sniffer-annotations-1.18.jar differ diff --git a/seata/lib/annotations-4.1.1.4.jar b/seata/lib/annotations-4.1.1.4.jar new file mode 100644 index 000000000..8cbf103fa Binary files /dev/null and b/seata/lib/annotations-4.1.1.4.jar differ diff --git a/seata/lib/ant-1.10.12.jar b/seata/lib/ant-1.10.12.jar new file mode 100644 index 000000000..1a1d3ea89 Binary files /dev/null and b/seata/lib/ant-1.10.12.jar differ diff --git a/seata/lib/ant-launcher-1.10.12.jar b/seata/lib/ant-launcher-1.10.12.jar new file mode 100644 index 000000000..f7dd54b7e Binary files /dev/null and b/seata/lib/ant-launcher-1.10.12.jar differ diff --git a/seata/lib/antlr-2.7.7.jar b/seata/lib/antlr-2.7.7.jar new file mode 100644 index 000000000..5e5f14b35 Binary files /dev/null and b/seata/lib/antlr-2.7.7.jar differ diff --git a/seata/lib/antlr-runtime-3.4.jar b/seata/lib/antlr-runtime-3.4.jar new file mode 100644 index 000000000..865a537b0 Binary files /dev/null and b/seata/lib/antlr-runtime-3.4.jar differ diff --git a/seata/lib/aopalliance-1.0.jar b/seata/lib/aopalliance-1.0.jar new file mode 100644 index 000000000..578b1a0c3 Binary files /dev/null and b/seata/lib/aopalliance-1.0.jar differ diff --git a/seata/lib/apollo-client-2.0.1.jar b/seata/lib/apollo-client-2.0.1.jar new file mode 100644 index 000000000..90b00ec4f Binary files /dev/null and b/seata/lib/apollo-client-2.0.1.jar differ diff --git a/seata/lib/apollo-core-2.0.1.jar b/seata/lib/apollo-core-2.0.1.jar new file mode 100644 index 000000000..f64ce3a7a Binary files /dev/null and b/seata/lib/apollo-core-2.0.1.jar differ diff --git a/seata/lib/archaius-core-0.7.6.jar b/seata/lib/archaius-core-0.7.6.jar new file mode 100644 index 000000000..58182d16e Binary files /dev/null and b/seata/lib/archaius-core-0.7.6.jar differ diff --git a/seata/lib/asm-6.0.jar b/seata/lib/asm-6.0.jar new file mode 100644 index 000000000..cf2de272c Binary files /dev/null and b/seata/lib/asm-6.0.jar differ diff --git a/seata/lib/audience-annotations-0.5.0.jar b/seata/lib/audience-annotations-0.5.0.jar new file mode 100644 index 000000000..52491a7ea Binary files /dev/null and b/seata/lib/audience-annotations-0.5.0.jar differ diff --git a/seata/lib/bolt-1.6.4.jar b/seata/lib/bolt-1.6.4.jar new file mode 100644 index 000000000..46e1c57f4 Binary files /dev/null and b/seata/lib/bolt-1.6.4.jar differ diff --git a/seata/lib/byte-buddy-1.12.23.jar b/seata/lib/byte-buddy-1.12.23.jar new file mode 100644 index 000000000..8078f0393 Binary files /dev/null and b/seata/lib/byte-buddy-1.12.23.jar differ diff --git a/seata/lib/checker-qual-3.5.0.jar b/seata/lib/checker-qual-3.5.0.jar new file mode 100644 index 000000000..f98cde8b2 Binary files /dev/null and b/seata/lib/checker-qual-3.5.0.jar differ diff --git a/seata/lib/commons-codec-1.15.jar b/seata/lib/commons-codec-1.15.jar new file mode 100644 index 000000000..f14985ac9 Binary files /dev/null and b/seata/lib/commons-codec-1.15.jar differ diff --git a/seata/lib/commons-compiler-3.1.10.jar b/seata/lib/commons-compiler-3.1.10.jar new file mode 100644 index 000000000..0f6dfe2ad Binary files /dev/null and b/seata/lib/commons-compiler-3.1.10.jar differ diff --git a/seata/lib/commons-configuration-1.10.jar b/seata/lib/commons-configuration-1.10.jar new file mode 100644 index 000000000..792243660 Binary files /dev/null and b/seata/lib/commons-configuration-1.10.jar differ diff --git a/seata/lib/commons-dbcp2-2.9.0.jar b/seata/lib/commons-dbcp2-2.9.0.jar new file mode 100644 index 000000000..ddfd42c8d Binary files /dev/null and b/seata/lib/commons-dbcp2-2.9.0.jar differ diff --git a/seata/lib/commons-io-2.8.0.jar b/seata/lib/commons-io-2.8.0.jar new file mode 100644 index 000000000..177e58dc6 Binary files /dev/null and b/seata/lib/commons-io-2.8.0.jar differ diff --git a/seata/lib/commons-jxpath-1.3.jar b/seata/lib/commons-jxpath-1.3.jar new file mode 100644 index 000000000..e344a1e66 Binary files /dev/null and b/seata/lib/commons-jxpath-1.3.jar differ diff --git a/seata/lib/commons-lang-2.6.jar b/seata/lib/commons-lang-2.6.jar new file mode 100644 index 000000000..98467d3a6 Binary files /dev/null and b/seata/lib/commons-lang-2.6.jar differ diff --git a/seata/lib/commons-logging-1.2.jar b/seata/lib/commons-logging-1.2.jar new file mode 100644 index 000000000..93a3b9f6d Binary files /dev/null and b/seata/lib/commons-logging-1.2.jar differ diff --git a/seata/lib/commons-math-2.2.jar b/seata/lib/commons-math-2.2.jar new file mode 100644 index 000000000..b29a39c54 Binary files /dev/null and b/seata/lib/commons-math-2.2.jar differ diff --git a/seata/lib/commons-pool-1.6.jar b/seata/lib/commons-pool-1.6.jar new file mode 100644 index 000000000..72ca75a3e Binary files /dev/null and b/seata/lib/commons-pool-1.6.jar differ diff --git a/seata/lib/commons-pool2-2.11.1.jar b/seata/lib/commons-pool2-2.11.1.jar new file mode 100644 index 000000000..8da8a8278 Binary files /dev/null and b/seata/lib/commons-pool2-2.11.1.jar differ diff --git a/seata/lib/compactmap-2.0.jar b/seata/lib/compactmap-2.0.jar new file mode 100644 index 000000000..9e6686dcf Binary files /dev/null and b/seata/lib/compactmap-2.0.jar differ diff --git a/seata/lib/config-1.2.1.jar b/seata/lib/config-1.2.1.jar new file mode 100644 index 000000000..d2ed5a6e5 Binary files /dev/null and b/seata/lib/config-1.2.1.jar differ diff --git a/seata/lib/consul-api-1.4.2.jar b/seata/lib/consul-api-1.4.2.jar new file mode 100644 index 000000000..6a671d54f Binary files /dev/null and b/seata/lib/consul-api-1.4.2.jar differ diff --git a/seata/lib/dexx-collections-0.2.jar b/seata/lib/dexx-collections-0.2.jar new file mode 100644 index 000000000..eb2f763a6 Binary files /dev/null and b/seata/lib/dexx-collections-0.2.jar differ diff --git a/seata/lib/disruptor-3.3.7.jar b/seata/lib/disruptor-3.3.7.jar new file mode 100644 index 000000000..1777a3756 Binary files /dev/null and b/seata/lib/disruptor-3.3.7.jar differ diff --git a/seata/lib/druid-1.2.7.jar b/seata/lib/druid-1.2.7.jar new file mode 100644 index 000000000..811a80ec3 Binary files /dev/null and b/seata/lib/druid-1.2.7.jar differ diff --git a/seata/lib/error_prone_annotations-2.3.4.jar b/seata/lib/error_prone_annotations-2.3.4.jar new file mode 100644 index 000000000..c9bea2abc Binary files /dev/null and b/seata/lib/error_prone_annotations-2.3.4.jar differ diff --git a/seata/lib/eureka-client-1.10.17.jar b/seata/lib/eureka-client-1.10.17.jar new file mode 100644 index 000000000..8bc7ce71f Binary files /dev/null and b/seata/lib/eureka-client-1.10.17.jar differ diff --git a/seata/lib/failsafe-2.3.3.jar b/seata/lib/failsafe-2.3.3.jar new file mode 100644 index 000000000..a1f9541da Binary files /dev/null and b/seata/lib/failsafe-2.3.3.jar differ diff --git a/seata/lib/failureaccess-1.0.1.jar b/seata/lib/failureaccess-1.0.1.jar new file mode 100644 index 000000000..9b56dc751 Binary files /dev/null and b/seata/lib/failureaccess-1.0.1.jar differ diff --git a/seata/lib/fastjson-1.2.83.jar b/seata/lib/fastjson-1.2.83.jar new file mode 100644 index 000000000..fd843ae91 Binary files /dev/null and b/seata/lib/fastjson-1.2.83.jar differ diff --git a/seata/lib/grpc-api-1.27.1.jar b/seata/lib/grpc-api-1.27.1.jar new file mode 100644 index 000000000..53bfc300f Binary files /dev/null and b/seata/lib/grpc-api-1.27.1.jar differ diff --git a/seata/lib/grpc-context-1.27.1.jar b/seata/lib/grpc-context-1.27.1.jar new file mode 100644 index 000000000..b742f7ca4 Binary files /dev/null and b/seata/lib/grpc-context-1.27.1.jar differ diff --git a/seata/lib/grpc-core-1.27.1.jar b/seata/lib/grpc-core-1.27.1.jar new file mode 100644 index 000000000..ecbdf18a7 Binary files /dev/null and b/seata/lib/grpc-core-1.27.1.jar differ diff --git a/seata/lib/grpc-grpclb-1.27.1.jar b/seata/lib/grpc-grpclb-1.27.1.jar new file mode 100644 index 000000000..8bc389612 Binary files /dev/null and b/seata/lib/grpc-grpclb-1.27.1.jar differ diff --git a/seata/lib/grpc-netty-1.27.1.jar b/seata/lib/grpc-netty-1.27.1.jar new file mode 100644 index 000000000..fd6d0b52f Binary files /dev/null and b/seata/lib/grpc-netty-1.27.1.jar differ diff --git a/seata/lib/grpc-protobuf-1.27.1.jar b/seata/lib/grpc-protobuf-1.27.1.jar new file mode 100644 index 000000000..44880f2a2 Binary files /dev/null and b/seata/lib/grpc-protobuf-1.27.1.jar differ diff --git a/seata/lib/grpc-protobuf-lite-1.27.1.jar b/seata/lib/grpc-protobuf-lite-1.27.1.jar new file mode 100644 index 000000000..b628257c2 Binary files /dev/null and b/seata/lib/grpc-protobuf-lite-1.27.1.jar differ diff --git a/seata/lib/grpc-stub-1.27.1.jar b/seata/lib/grpc-stub-1.27.1.jar new file mode 100644 index 000000000..dbb3a7ea2 Binary files /dev/null and b/seata/lib/grpc-stub-1.27.1.jar differ diff --git a/seata/lib/gson-2.9.1.jar b/seata/lib/gson-2.9.1.jar new file mode 100644 index 000000000..8a663ecce Binary files /dev/null and b/seata/lib/gson-2.9.1.jar differ diff --git a/seata/lib/guava-30.1-jre.jar b/seata/lib/guava-30.1-jre.jar new file mode 100644 index 000000000..4244e8a27 Binary files /dev/null and b/seata/lib/guava-30.1-jre.jar differ diff --git a/seata/lib/guice-5.0.1.jar b/seata/lib/guice-5.0.1.jar new file mode 100644 index 000000000..ce6a9d49d Binary files /dev/null and b/seata/lib/guice-5.0.1.jar differ diff --git a/seata/lib/h2-2.1.214.jar b/seata/lib/h2-2.1.214.jar new file mode 100644 index 000000000..e8e3efc6c Binary files /dev/null and b/seata/lib/h2-2.1.214.jar differ diff --git a/seata/lib/hessian-4.0.3.jar b/seata/lib/hessian-4.0.3.jar new file mode 100644 index 000000000..618e194fd Binary files /dev/null and b/seata/lib/hessian-4.0.3.jar differ diff --git a/seata/lib/hessian-4.0.63.jar b/seata/lib/hessian-4.0.63.jar new file mode 100644 index 000000000..873749e82 Binary files /dev/null and b/seata/lib/hessian-4.0.63.jar differ diff --git a/seata/lib/httpasyncclient-4.1.5.jar b/seata/lib/httpasyncclient-4.1.5.jar new file mode 100644 index 000000000..5a63e4d79 Binary files /dev/null and b/seata/lib/httpasyncclient-4.1.5.jar differ diff --git a/seata/lib/httpclient-4.5.14.jar b/seata/lib/httpclient-4.5.14.jar new file mode 100644 index 000000000..2bb7c0736 Binary files /dev/null and b/seata/lib/httpclient-4.5.14.jar differ diff --git a/seata/lib/httpcore-4.4.16.jar b/seata/lib/httpcore-4.4.16.jar new file mode 100644 index 000000000..f0bdebeb9 Binary files /dev/null and b/seata/lib/httpcore-4.4.16.jar differ diff --git a/seata/lib/httpcore-nio-4.4.16.jar b/seata/lib/httpcore-nio-4.4.16.jar new file mode 100644 index 000000000..d52d89228 Binary files /dev/null and b/seata/lib/httpcore-nio-4.4.16.jar differ diff --git a/seata/lib/j2objc-annotations-1.3.jar b/seata/lib/j2objc-annotations-1.3.jar new file mode 100644 index 000000000..a429c7219 Binary files /dev/null and b/seata/lib/j2objc-annotations-1.3.jar differ diff --git a/seata/lib/jackson-annotations-2.13.5.jar b/seata/lib/jackson-annotations-2.13.5.jar new file mode 100644 index 000000000..20ecaedc7 Binary files /dev/null and b/seata/lib/jackson-annotations-2.13.5.jar differ diff --git a/seata/lib/jackson-core-2.13.5.jar b/seata/lib/jackson-core-2.13.5.jar new file mode 100644 index 000000000..401dee317 Binary files /dev/null and b/seata/lib/jackson-core-2.13.5.jar differ diff --git a/seata/lib/jackson-databind-2.13.5.jar b/seata/lib/jackson-databind-2.13.5.jar new file mode 100644 index 000000000..fde442b1f Binary files /dev/null and b/seata/lib/jackson-databind-2.13.5.jar differ diff --git a/seata/lib/jackson-datatype-jdk8-2.13.5.jar b/seata/lib/jackson-datatype-jdk8-2.13.5.jar new file mode 100644 index 000000000..b002723da Binary files /dev/null and b/seata/lib/jackson-datatype-jdk8-2.13.5.jar differ diff --git a/seata/lib/jackson-datatype-jsr310-2.13.5.jar b/seata/lib/jackson-datatype-jsr310-2.13.5.jar new file mode 100644 index 000000000..adf48ed8c Binary files /dev/null and b/seata/lib/jackson-datatype-jsr310-2.13.5.jar differ diff --git a/seata/lib/jackson-module-parameter-names-2.13.5.jar b/seata/lib/jackson-module-parameter-names-2.13.5.jar new file mode 100644 index 000000000..1208f7c30 Binary files /dev/null and b/seata/lib/jackson-module-parameter-names-2.13.5.jar differ diff --git a/seata/lib/jakarta.annotation-api-1.3.5.jar b/seata/lib/jakarta.annotation-api-1.3.5.jar new file mode 100644 index 000000000..606d992eb Binary files /dev/null and b/seata/lib/jakarta.annotation-api-1.3.5.jar differ diff --git a/seata/lib/janino-3.1.10.jar b/seata/lib/janino-3.1.10.jar new file mode 100644 index 000000000..a876fbd75 Binary files /dev/null and b/seata/lib/janino-3.1.10.jar differ diff --git a/seata/lib/javax.inject-1.jar b/seata/lib/javax.inject-1.jar new file mode 100644 index 000000000..b2a9d0bf7 Binary files /dev/null and b/seata/lib/javax.inject-1.jar differ diff --git a/seata/lib/javax.servlet-api-4.0.1.jar b/seata/lib/javax.servlet-api-4.0.1.jar new file mode 100644 index 000000000..844ec7f17 Binary files /dev/null and b/seata/lib/javax.servlet-api-4.0.1.jar differ diff --git a/seata/lib/jcommander-1.82.jar b/seata/lib/jcommander-1.82.jar new file mode 100644 index 000000000..90f44247e Binary files /dev/null and b/seata/lib/jcommander-1.82.jar differ diff --git a/seata/lib/jctools-core-2.1.1.jar b/seata/lib/jctools-core-2.1.1.jar new file mode 100644 index 000000000..289dfb1cd Binary files /dev/null and b/seata/lib/jctools-core-2.1.1.jar differ diff --git a/seata/lib/jdbc/mysql-connector-java-5.1.42.jar b/seata/lib/jdbc/mysql-connector-java-5.1.42.jar new file mode 100644 index 000000000..cf242a7d6 Binary files /dev/null and b/seata/lib/jdbc/mysql-connector-java-5.1.42.jar differ diff --git a/seata/lib/jdbc/mysql-connector-java-8.0.27.jar b/seata/lib/jdbc/mysql-connector-java-8.0.27.jar new file mode 100644 index 000000000..683ac2681 Binary files /dev/null and b/seata/lib/jdbc/mysql-connector-java-8.0.27.jar differ diff --git a/seata/lib/jedis-3.8.0.jar b/seata/lib/jedis-3.8.0.jar new file mode 100644 index 000000000..eb9d41823 Binary files /dev/null and b/seata/lib/jedis-3.8.0.jar differ diff --git a/seata/lib/jersey-apache-client4-1.19.1.jar b/seata/lib/jersey-apache-client4-1.19.1.jar new file mode 100644 index 000000000..d88eab760 Binary files /dev/null and b/seata/lib/jersey-apache-client4-1.19.1.jar differ diff --git a/seata/lib/jersey-client-1.19.1.jar b/seata/lib/jersey-client-1.19.1.jar new file mode 100644 index 000000000..455a7f280 Binary files /dev/null and b/seata/lib/jersey-client-1.19.1.jar differ diff --git a/seata/lib/jersey-core-1.19.1.jar b/seata/lib/jersey-core-1.19.1.jar new file mode 100644 index 000000000..8e5185d27 Binary files /dev/null and b/seata/lib/jersey-core-1.19.1.jar differ diff --git a/seata/lib/jetcd-common-0.5.0.jar b/seata/lib/jetcd-common-0.5.0.jar new file mode 100644 index 000000000..8aae76daa Binary files /dev/null and b/seata/lib/jetcd-common-0.5.0.jar differ diff --git a/seata/lib/jetcd-core-0.5.0.jar b/seata/lib/jetcd-core-0.5.0.jar new file mode 100644 index 000000000..e1b7ee1d0 Binary files /dev/null and b/seata/lib/jetcd-core-0.5.0.jar differ diff --git a/seata/lib/jetcd-resolver-0.5.0.jar b/seata/lib/jetcd-resolver-0.5.0.jar new file mode 100644 index 000000000..85351a20e Binary files /dev/null and b/seata/lib/jetcd-resolver-0.5.0.jar differ diff --git a/seata/lib/jettison-1.4.0.jar b/seata/lib/jettison-1.4.0.jar new file mode 100644 index 000000000..a823cf912 Binary files /dev/null and b/seata/lib/jettison-1.4.0.jar differ diff --git a/seata/lib/jjwt-api-0.10.5.jar b/seata/lib/jjwt-api-0.10.5.jar new file mode 100644 index 000000000..9ff2d9cd6 Binary files /dev/null and b/seata/lib/jjwt-api-0.10.5.jar differ diff --git a/seata/lib/jjwt-impl-0.10.5.jar b/seata/lib/jjwt-impl-0.10.5.jar new file mode 100644 index 000000000..3f7a0ac7d Binary files /dev/null and b/seata/lib/jjwt-impl-0.10.5.jar differ diff --git a/seata/lib/jjwt-jackson-0.10.5.jar b/seata/lib/jjwt-jackson-0.10.5.jar new file mode 100644 index 000000000..513b67171 Binary files /dev/null and b/seata/lib/jjwt-jackson-0.10.5.jar differ diff --git a/seata/lib/jna-5.5.0.jar b/seata/lib/jna-5.5.0.jar new file mode 100644 index 000000000..ff423c8f3 Binary files /dev/null and b/seata/lib/jna-5.5.0.jar differ diff --git a/seata/lib/joda-time-2.3.jar b/seata/lib/joda-time-2.3.jar new file mode 100644 index 000000000..9dce4f92a Binary files /dev/null and b/seata/lib/joda-time-2.3.jar differ diff --git a/seata/lib/jraft-core-1.3.13.jar b/seata/lib/jraft-core-1.3.13.jar new file mode 100644 index 000000000..7cf33ca87 Binary files /dev/null and b/seata/lib/jraft-core-1.3.13.jar differ diff --git a/seata/lib/jsr305-3.0.2.jar b/seata/lib/jsr305-3.0.2.jar new file mode 100644 index 000000000..59222d9ca Binary files /dev/null and b/seata/lib/jsr305-3.0.2.jar differ diff --git a/seata/lib/jsr311-api-1.1.1.jar b/seata/lib/jsr311-api-1.1.1.jar new file mode 100644 index 000000000..ec8bc8185 Binary files /dev/null and b/seata/lib/jsr311-api-1.1.1.jar differ diff --git a/seata/lib/jul-to-slf4j-1.7.36.jar b/seata/lib/jul-to-slf4j-1.7.36.jar new file mode 100644 index 000000000..ae8f815e2 Binary files /dev/null and b/seata/lib/jul-to-slf4j-1.7.36.jar differ diff --git a/seata/lib/kafka-clients-3.1.2.jar b/seata/lib/kafka-clients-3.1.2.jar new file mode 100644 index 000000000..46d0f2dc6 Binary files /dev/null and b/seata/lib/kafka-clients-3.1.2.jar differ diff --git a/seata/lib/kryo-5.4.0.jar b/seata/lib/kryo-5.4.0.jar new file mode 100644 index 000000000..bf84ecb22 Binary files /dev/null and b/seata/lib/kryo-5.4.0.jar differ diff --git a/seata/lib/kryo-serializers-0.45.jar b/seata/lib/kryo-serializers-0.45.jar new file mode 100644 index 000000000..faafbfbe3 Binary files /dev/null and b/seata/lib/kryo-serializers-0.45.jar differ diff --git a/seata/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar b/seata/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar new file mode 100644 index 000000000..45832c052 Binary files /dev/null and b/seata/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar differ diff --git a/seata/lib/logback-classic-1.2.12.jar b/seata/lib/logback-classic-1.2.12.jar new file mode 100644 index 000000000..b33d4d5fd Binary files /dev/null and b/seata/lib/logback-classic-1.2.12.jar differ diff --git a/seata/lib/logback-core-1.2.12.jar b/seata/lib/logback-core-1.2.12.jar new file mode 100644 index 000000000..64fac138b Binary files /dev/null and b/seata/lib/logback-core-1.2.12.jar differ diff --git a/seata/lib/logback-kafka-appender-0.2.0-RC2.jar b/seata/lib/logback-kafka-appender-0.2.0-RC2.jar new file mode 100644 index 000000000..37742a15e Binary files /dev/null and b/seata/lib/logback-kafka-appender-0.2.0-RC2.jar differ diff --git a/seata/lib/logstash-logback-encoder-6.5.jar b/seata/lib/logstash-logback-encoder-6.5.jar new file mode 100644 index 000000000..f7ef12f74 Binary files /dev/null and b/seata/lib/logstash-logback-encoder-6.5.jar differ diff --git a/seata/lib/lz4-java-1.7.1.jar b/seata/lib/lz4-java-1.7.1.jar new file mode 100644 index 000000000..95f57ca10 Binary files /dev/null and b/seata/lib/lz4-java-1.7.1.jar differ diff --git a/seata/lib/metrics-core-4.2.21.jar b/seata/lib/metrics-core-4.2.21.jar new file mode 100644 index 000000000..c27f0e006 Binary files /dev/null and b/seata/lib/metrics-core-4.2.21.jar differ diff --git a/seata/lib/minlog-1.3.1.jar b/seata/lib/minlog-1.3.1.jar new file mode 100644 index 000000000..9a1557092 Binary files /dev/null and b/seata/lib/minlog-1.3.1.jar differ diff --git a/seata/lib/mxparser-1.2.2.jar b/seata/lib/mxparser-1.2.2.jar new file mode 100644 index 000000000..f32ad580b Binary files /dev/null and b/seata/lib/mxparser-1.2.2.jar differ diff --git a/seata/lib/nacos-api-1.4.2.jar b/seata/lib/nacos-api-1.4.2.jar new file mode 100644 index 000000000..1fad7a7cc Binary files /dev/null and b/seata/lib/nacos-api-1.4.2.jar differ diff --git a/seata/lib/nacos-client-1.4.2.jar b/seata/lib/nacos-client-1.4.2.jar new file mode 100644 index 000000000..8c5b92dfb Binary files /dev/null and b/seata/lib/nacos-client-1.4.2.jar differ diff --git a/seata/lib/nacos-common-1.4.2.jar b/seata/lib/nacos-common-1.4.2.jar new file mode 100644 index 000000000..c0912e551 Binary files /dev/null and b/seata/lib/nacos-common-1.4.2.jar differ diff --git a/seata/lib/netflix-eventbus-0.3.0.jar b/seata/lib/netflix-eventbus-0.3.0.jar new file mode 100644 index 000000000..b910dc370 Binary files /dev/null and b/seata/lib/netflix-eventbus-0.3.0.jar differ diff --git a/seata/lib/netflix-infix-0.3.0.jar b/seata/lib/netflix-infix-0.3.0.jar new file mode 100644 index 000000000..cb1b67e07 Binary files /dev/null and b/seata/lib/netflix-infix-0.3.0.jar differ diff --git a/seata/lib/netty-all-4.1.100.Final.jar b/seata/lib/netty-all-4.1.100.Final.jar new file mode 100644 index 000000000..57f42560b Binary files /dev/null and b/seata/lib/netty-all-4.1.100.Final.jar differ diff --git a/seata/lib/netty-buffer-4.1.100.Final.jar b/seata/lib/netty-buffer-4.1.100.Final.jar new file mode 100644 index 000000000..055ecf3b4 Binary files /dev/null and b/seata/lib/netty-buffer-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-4.1.100.Final.jar b/seata/lib/netty-codec-4.1.100.Final.jar new file mode 100644 index 000000000..04c2f74b6 Binary files /dev/null and b/seata/lib/netty-codec-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-dns-4.1.100.Final.jar b/seata/lib/netty-codec-dns-4.1.100.Final.jar new file mode 100644 index 000000000..56b94595c Binary files /dev/null and b/seata/lib/netty-codec-dns-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-haproxy-4.1.100.Final.jar b/seata/lib/netty-codec-haproxy-4.1.100.Final.jar new file mode 100644 index 000000000..97097fe99 Binary files /dev/null and b/seata/lib/netty-codec-haproxy-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-http-4.1.100.Final.jar b/seata/lib/netty-codec-http-4.1.100.Final.jar new file mode 100644 index 000000000..50e5a9b01 Binary files /dev/null and b/seata/lib/netty-codec-http-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-http2-4.1.100.Final.jar b/seata/lib/netty-codec-http2-4.1.100.Final.jar new file mode 100644 index 000000000..c9b4d8f80 Binary files /dev/null and b/seata/lib/netty-codec-http2-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-memcache-4.1.100.Final.jar b/seata/lib/netty-codec-memcache-4.1.100.Final.jar new file mode 100644 index 000000000..914c26f7f Binary files /dev/null and b/seata/lib/netty-codec-memcache-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-mqtt-4.1.100.Final.jar b/seata/lib/netty-codec-mqtt-4.1.100.Final.jar new file mode 100644 index 000000000..433762699 Binary files /dev/null and b/seata/lib/netty-codec-mqtt-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-redis-4.1.100.Final.jar b/seata/lib/netty-codec-redis-4.1.100.Final.jar new file mode 100644 index 000000000..4289ff9b2 Binary files /dev/null and b/seata/lib/netty-codec-redis-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-smtp-4.1.100.Final.jar b/seata/lib/netty-codec-smtp-4.1.100.Final.jar new file mode 100644 index 000000000..9ed5f4fc7 Binary files /dev/null and b/seata/lib/netty-codec-smtp-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-socks-4.1.100.Final.jar b/seata/lib/netty-codec-socks-4.1.100.Final.jar new file mode 100644 index 000000000..e02c3ff01 Binary files /dev/null and b/seata/lib/netty-codec-socks-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-stomp-4.1.100.Final.jar b/seata/lib/netty-codec-stomp-4.1.100.Final.jar new file mode 100644 index 000000000..73d4434e8 Binary files /dev/null and b/seata/lib/netty-codec-stomp-4.1.100.Final.jar differ diff --git a/seata/lib/netty-codec-xml-4.1.100.Final.jar b/seata/lib/netty-codec-xml-4.1.100.Final.jar new file mode 100644 index 000000000..a09fbee03 Binary files /dev/null and b/seata/lib/netty-codec-xml-4.1.100.Final.jar differ diff --git a/seata/lib/netty-common-4.1.100.Final.jar b/seata/lib/netty-common-4.1.100.Final.jar new file mode 100644 index 000000000..2946576ef Binary files /dev/null and b/seata/lib/netty-common-4.1.100.Final.jar differ diff --git a/seata/lib/netty-handler-4.1.100.Final.jar b/seata/lib/netty-handler-4.1.100.Final.jar new file mode 100644 index 000000000..8a42dbb7c Binary files /dev/null and b/seata/lib/netty-handler-4.1.100.Final.jar differ diff --git a/seata/lib/netty-handler-proxy-4.1.100.Final.jar b/seata/lib/netty-handler-proxy-4.1.100.Final.jar new file mode 100644 index 000000000..14315ff1d Binary files /dev/null and b/seata/lib/netty-handler-proxy-4.1.100.Final.jar differ diff --git a/seata/lib/netty-handler-ssl-ocsp-4.1.100.Final.jar b/seata/lib/netty-handler-ssl-ocsp-4.1.100.Final.jar new file mode 100644 index 000000000..1d0281d30 Binary files /dev/null and b/seata/lib/netty-handler-ssl-ocsp-4.1.100.Final.jar differ diff --git a/seata/lib/netty-resolver-4.1.100.Final.jar b/seata/lib/netty-resolver-4.1.100.Final.jar new file mode 100644 index 000000000..7292648b3 Binary files /dev/null and b/seata/lib/netty-resolver-4.1.100.Final.jar differ diff --git a/seata/lib/netty-resolver-dns-4.1.100.Final.jar b/seata/lib/netty-resolver-dns-4.1.100.Final.jar new file mode 100644 index 000000000..a4c254f80 Binary files /dev/null and b/seata/lib/netty-resolver-dns-4.1.100.Final.jar differ diff --git a/seata/lib/netty-resolver-dns-classes-macos-4.1.100.Final.jar b/seata/lib/netty-resolver-dns-classes-macos-4.1.100.Final.jar new file mode 100644 index 000000000..268dde972 Binary files /dev/null and b/seata/lib/netty-resolver-dns-classes-macos-4.1.100.Final.jar differ diff --git a/seata/lib/netty-resolver-dns-native-macos-4.1.100.Final-osx-aarch_64.jar b/seata/lib/netty-resolver-dns-native-macos-4.1.100.Final-osx-aarch_64.jar new file mode 100644 index 000000000..594ae5457 Binary files /dev/null and b/seata/lib/netty-resolver-dns-native-macos-4.1.100.Final-osx-aarch_64.jar differ diff --git a/seata/lib/netty-resolver-dns-native-macos-4.1.100.Final-osx-x86_64.jar b/seata/lib/netty-resolver-dns-native-macos-4.1.100.Final-osx-x86_64.jar new file mode 100644 index 000000000..2e197eb2a Binary files /dev/null and b/seata/lib/netty-resolver-dns-native-macos-4.1.100.Final-osx-x86_64.jar differ diff --git a/seata/lib/netty-transport-4.1.100.Final.jar b/seata/lib/netty-transport-4.1.100.Final.jar new file mode 100644 index 000000000..124a8973a Binary files /dev/null and b/seata/lib/netty-transport-4.1.100.Final.jar differ diff --git a/seata/lib/netty-transport-classes-epoll-4.1.100.Final.jar b/seata/lib/netty-transport-classes-epoll-4.1.100.Final.jar new file mode 100644 index 000000000..4511b1d2c Binary files /dev/null and b/seata/lib/netty-transport-classes-epoll-4.1.100.Final.jar differ diff --git a/seata/lib/netty-transport-classes-kqueue-4.1.100.Final.jar b/seata/lib/netty-transport-classes-kqueue-4.1.100.Final.jar new file mode 100644 index 000000000..2805d6c7a Binary files /dev/null and b/seata/lib/netty-transport-classes-kqueue-4.1.100.Final.jar differ diff --git a/seata/lib/netty-transport-native-epoll-4.1.100.Final-linux-aarch_64.jar b/seata/lib/netty-transport-native-epoll-4.1.100.Final-linux-aarch_64.jar new file mode 100644 index 000000000..b95b4bf3f Binary files /dev/null and b/seata/lib/netty-transport-native-epoll-4.1.100.Final-linux-aarch_64.jar differ diff --git a/seata/lib/netty-transport-native-epoll-4.1.100.Final-linux-x86_64.jar b/seata/lib/netty-transport-native-epoll-4.1.100.Final-linux-x86_64.jar new file mode 100644 index 000000000..6583f16cc Binary files /dev/null and b/seata/lib/netty-transport-native-epoll-4.1.100.Final-linux-x86_64.jar differ diff --git a/seata/lib/netty-transport-native-epoll-4.1.100.Final.jar b/seata/lib/netty-transport-native-epoll-4.1.100.Final.jar new file mode 100644 index 000000000..601bf37cc Binary files /dev/null and b/seata/lib/netty-transport-native-epoll-4.1.100.Final.jar differ diff --git a/seata/lib/netty-transport-native-kqueue-4.1.100.Final-osx-aarch_64.jar b/seata/lib/netty-transport-native-kqueue-4.1.100.Final-osx-aarch_64.jar new file mode 100644 index 000000000..484abb126 Binary files /dev/null and b/seata/lib/netty-transport-native-kqueue-4.1.100.Final-osx-aarch_64.jar differ diff --git a/seata/lib/netty-transport-native-kqueue-4.1.100.Final-osx-x86_64.jar b/seata/lib/netty-transport-native-kqueue-4.1.100.Final-osx-x86_64.jar new file mode 100644 index 000000000..5370e5d6b Binary files /dev/null and b/seata/lib/netty-transport-native-kqueue-4.1.100.Final-osx-x86_64.jar differ diff --git a/seata/lib/netty-transport-native-unix-common-4.1.100.Final.jar b/seata/lib/netty-transport-native-unix-common-4.1.100.Final.jar new file mode 100644 index 000000000..557b3d531 Binary files /dev/null and b/seata/lib/netty-transport-native-unix-common-4.1.100.Final.jar differ diff --git a/seata/lib/netty-transport-rxtx-4.1.100.Final.jar b/seata/lib/netty-transport-rxtx-4.1.100.Final.jar new file mode 100644 index 000000000..1665a6510 Binary files /dev/null and b/seata/lib/netty-transport-rxtx-4.1.100.Final.jar differ diff --git a/seata/lib/netty-transport-sctp-4.1.100.Final.jar b/seata/lib/netty-transport-sctp-4.1.100.Final.jar new file mode 100644 index 000000000..de301b87c Binary files /dev/null and b/seata/lib/netty-transport-sctp-4.1.100.Final.jar differ diff --git a/seata/lib/netty-transport-udt-4.1.100.Final.jar b/seata/lib/netty-transport-udt-4.1.100.Final.jar new file mode 100644 index 000000000..24842885a Binary files /dev/null and b/seata/lib/netty-transport-udt-4.1.100.Final.jar differ diff --git a/seata/lib/objenesis-3.2.jar b/seata/lib/objenesis-3.2.jar new file mode 100644 index 000000000..1888e2ea1 Binary files /dev/null and b/seata/lib/objenesis-3.2.jar differ diff --git a/seata/lib/perfmark-api-0.19.0.jar b/seata/lib/perfmark-api-0.19.0.jar new file mode 100644 index 000000000..557a05631 Binary files /dev/null and b/seata/lib/perfmark-api-0.19.0.jar differ diff --git a/seata/lib/postgresql-42.3.8.jar b/seata/lib/postgresql-42.3.8.jar new file mode 100644 index 000000000..4dab8a5d6 Binary files /dev/null and b/seata/lib/postgresql-42.3.8.jar differ diff --git a/seata/lib/proto-google-common-protos-1.17.0.jar b/seata/lib/proto-google-common-protos-1.17.0.jar new file mode 100644 index 000000000..990ff3a3c Binary files /dev/null and b/seata/lib/proto-google-common-protos-1.17.0.jar differ diff --git a/seata/lib/protobuf-java-3.16.3.jar b/seata/lib/protobuf-java-3.16.3.jar new file mode 100644 index 000000000..fffc4cd64 Binary files /dev/null and b/seata/lib/protobuf-java-3.16.3.jar differ diff --git a/seata/lib/protobuf-java-util-3.11.0.jar b/seata/lib/protobuf-java-util-3.11.0.jar new file mode 100644 index 000000000..2a8639cc9 Binary files /dev/null and b/seata/lib/protobuf-java-util-3.11.0.jar differ diff --git a/seata/lib/reflectasm-1.11.9.jar b/seata/lib/reflectasm-1.11.9.jar new file mode 100644 index 000000000..050129b54 Binary files /dev/null and b/seata/lib/reflectasm-1.11.9.jar differ diff --git a/seata/lib/registry-client-all-6.3.0.jar b/seata/lib/registry-client-all-6.3.0.jar new file mode 100644 index 000000000..bc61a6f5d Binary files /dev/null and b/seata/lib/registry-client-all-6.3.0.jar differ diff --git a/seata/lib/rocksdbjni-7.7.3.jar b/seata/lib/rocksdbjni-7.7.3.jar new file mode 100644 index 000000000..251b211a9 Binary files /dev/null and b/seata/lib/rocksdbjni-7.7.3.jar differ diff --git a/seata/lib/seata-common-2.0.0.jar b/seata/lib/seata-common-2.0.0.jar new file mode 100644 index 000000000..67690442d Binary files /dev/null and b/seata/lib/seata-common-2.0.0.jar differ diff --git a/seata/lib/seata-compressor-all-2.0.0.jar b/seata/lib/seata-compressor-all-2.0.0.jar new file mode 100644 index 000000000..c60332829 Binary files /dev/null and b/seata/lib/seata-compressor-all-2.0.0.jar differ diff --git a/seata/lib/seata-compressor-bzip2-2.0.0.jar b/seata/lib/seata-compressor-bzip2-2.0.0.jar new file mode 100644 index 000000000..25b0c5b8a Binary files /dev/null and b/seata/lib/seata-compressor-bzip2-2.0.0.jar differ diff --git a/seata/lib/seata-compressor-deflater-2.0.0.jar b/seata/lib/seata-compressor-deflater-2.0.0.jar new file mode 100644 index 000000000..8dceff3bf Binary files /dev/null and b/seata/lib/seata-compressor-deflater-2.0.0.jar differ diff --git a/seata/lib/seata-compressor-gzip-2.0.0.jar b/seata/lib/seata-compressor-gzip-2.0.0.jar new file mode 100644 index 000000000..85dd48c26 Binary files /dev/null and b/seata/lib/seata-compressor-gzip-2.0.0.jar differ diff --git a/seata/lib/seata-compressor-lz4-2.0.0.jar b/seata/lib/seata-compressor-lz4-2.0.0.jar new file mode 100644 index 000000000..34d353ea0 Binary files /dev/null and b/seata/lib/seata-compressor-lz4-2.0.0.jar differ diff --git a/seata/lib/seata-compressor-zip-2.0.0.jar b/seata/lib/seata-compressor-zip-2.0.0.jar new file mode 100644 index 000000000..a636374fb Binary files /dev/null and b/seata/lib/seata-compressor-zip-2.0.0.jar differ diff --git a/seata/lib/seata-compressor-zstd-2.0.0.jar b/seata/lib/seata-compressor-zstd-2.0.0.jar new file mode 100644 index 000000000..0a9969205 Binary files /dev/null and b/seata/lib/seata-compressor-zstd-2.0.0.jar differ diff --git a/seata/lib/seata-config-all-2.0.0.jar b/seata/lib/seata-config-all-2.0.0.jar new file mode 100644 index 000000000..b013e1929 Binary files /dev/null and b/seata/lib/seata-config-all-2.0.0.jar differ diff --git a/seata/lib/seata-config-apollo-2.0.0.jar b/seata/lib/seata-config-apollo-2.0.0.jar new file mode 100644 index 000000000..ee97ec8ac Binary files /dev/null and b/seata/lib/seata-config-apollo-2.0.0.jar differ diff --git a/seata/lib/seata-config-consul-2.0.0.jar b/seata/lib/seata-config-consul-2.0.0.jar new file mode 100644 index 000000000..ced82e440 Binary files /dev/null and b/seata/lib/seata-config-consul-2.0.0.jar differ diff --git a/seata/lib/seata-config-core-2.0.0.jar b/seata/lib/seata-config-core-2.0.0.jar new file mode 100644 index 000000000..8b299bb34 Binary files /dev/null and b/seata/lib/seata-config-core-2.0.0.jar differ diff --git a/seata/lib/seata-config-etcd3-2.0.0.jar b/seata/lib/seata-config-etcd3-2.0.0.jar new file mode 100644 index 000000000..d21de7c17 Binary files /dev/null and b/seata/lib/seata-config-etcd3-2.0.0.jar differ diff --git a/seata/lib/seata-config-nacos-2.0.0.jar b/seata/lib/seata-config-nacos-2.0.0.jar new file mode 100644 index 000000000..7cb33ef94 Binary files /dev/null and b/seata/lib/seata-config-nacos-2.0.0.jar differ diff --git a/seata/lib/seata-config-spring-cloud-2.0.0.jar b/seata/lib/seata-config-spring-cloud-2.0.0.jar new file mode 100644 index 000000000..1adf27aa8 Binary files /dev/null and b/seata/lib/seata-config-spring-cloud-2.0.0.jar differ diff --git a/seata/lib/seata-config-zk-2.0.0.jar b/seata/lib/seata-config-zk-2.0.0.jar new file mode 100644 index 000000000..1b8d71830 Binary files /dev/null and b/seata/lib/seata-config-zk-2.0.0.jar differ diff --git a/seata/lib/seata-console-2.0.0.jar b/seata/lib/seata-console-2.0.0.jar new file mode 100644 index 000000000..1fd11fcce Binary files /dev/null and b/seata/lib/seata-console-2.0.0.jar differ diff --git a/seata/lib/seata-core-2.0.0.jar b/seata/lib/seata-core-2.0.0.jar new file mode 100644 index 000000000..dc5af8c0f Binary files /dev/null and b/seata/lib/seata-core-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-all-2.0.0.jar b/seata/lib/seata-discovery-all-2.0.0.jar new file mode 100644 index 000000000..33ff5025b Binary files /dev/null and b/seata/lib/seata-discovery-all-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-consul-2.0.0.jar b/seata/lib/seata-discovery-consul-2.0.0.jar new file mode 100644 index 000000000..24f714fbe Binary files /dev/null and b/seata/lib/seata-discovery-consul-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-core-2.0.0.jar b/seata/lib/seata-discovery-core-2.0.0.jar new file mode 100644 index 000000000..728a94629 Binary files /dev/null and b/seata/lib/seata-discovery-core-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-custom-2.0.0.jar b/seata/lib/seata-discovery-custom-2.0.0.jar new file mode 100644 index 000000000..d634715d6 Binary files /dev/null and b/seata/lib/seata-discovery-custom-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-etcd3-2.0.0.jar b/seata/lib/seata-discovery-etcd3-2.0.0.jar new file mode 100644 index 000000000..e41668c26 Binary files /dev/null and b/seata/lib/seata-discovery-etcd3-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-eureka-2.0.0.jar b/seata/lib/seata-discovery-eureka-2.0.0.jar new file mode 100644 index 000000000..acff19e9c Binary files /dev/null and b/seata/lib/seata-discovery-eureka-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-nacos-2.0.0.jar b/seata/lib/seata-discovery-nacos-2.0.0.jar new file mode 100644 index 000000000..9ed79e1a4 Binary files /dev/null and b/seata/lib/seata-discovery-nacos-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-redis-2.0.0.jar b/seata/lib/seata-discovery-redis-2.0.0.jar new file mode 100644 index 000000000..5ff4bcce1 Binary files /dev/null and b/seata/lib/seata-discovery-redis-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-sofa-2.0.0.jar b/seata/lib/seata-discovery-sofa-2.0.0.jar new file mode 100644 index 000000000..17fc9d8d6 Binary files /dev/null and b/seata/lib/seata-discovery-sofa-2.0.0.jar differ diff --git a/seata/lib/seata-discovery-zk-2.0.0.jar b/seata/lib/seata-discovery-zk-2.0.0.jar new file mode 100644 index 000000000..69316c9a2 Binary files /dev/null and b/seata/lib/seata-discovery-zk-2.0.0.jar differ diff --git a/seata/lib/seata-metrics-all-2.0.0.jar b/seata/lib/seata-metrics-all-2.0.0.jar new file mode 100644 index 000000000..de5126317 Binary files /dev/null and b/seata/lib/seata-metrics-all-2.0.0.jar differ diff --git a/seata/lib/seata-metrics-api-2.0.0.jar b/seata/lib/seata-metrics-api-2.0.0.jar new file mode 100644 index 000000000..39b183531 Binary files /dev/null and b/seata/lib/seata-metrics-api-2.0.0.jar differ diff --git a/seata/lib/seata-metrics-core-2.0.0.jar b/seata/lib/seata-metrics-core-2.0.0.jar new file mode 100644 index 000000000..59b85950a Binary files /dev/null and b/seata/lib/seata-metrics-core-2.0.0.jar differ diff --git a/seata/lib/seata-metrics-exporter-prometheus-2.0.0.jar b/seata/lib/seata-metrics-exporter-prometheus-2.0.0.jar new file mode 100644 index 000000000..1c0f6d147 Binary files /dev/null and b/seata/lib/seata-metrics-exporter-prometheus-2.0.0.jar differ diff --git a/seata/lib/seata-metrics-registry-compact-2.0.0.jar b/seata/lib/seata-metrics-registry-compact-2.0.0.jar new file mode 100644 index 000000000..a83442828 Binary files /dev/null and b/seata/lib/seata-metrics-registry-compact-2.0.0.jar differ diff --git a/seata/lib/seata-serializer-all-2.0.0.jar b/seata/lib/seata-serializer-all-2.0.0.jar new file mode 100644 index 000000000..530bed1a4 Binary files /dev/null and b/seata/lib/seata-serializer-all-2.0.0.jar differ diff --git a/seata/lib/seata-serializer-hessian-2.0.0.jar b/seata/lib/seata-serializer-hessian-2.0.0.jar new file mode 100644 index 000000000..537cf5e39 Binary files /dev/null and b/seata/lib/seata-serializer-hessian-2.0.0.jar differ diff --git a/seata/lib/seata-serializer-kryo-2.0.0.jar b/seata/lib/seata-serializer-kryo-2.0.0.jar new file mode 100644 index 000000000..962de9ce2 Binary files /dev/null and b/seata/lib/seata-serializer-kryo-2.0.0.jar differ diff --git a/seata/lib/seata-serializer-protobuf-2.0.0.jar b/seata/lib/seata-serializer-protobuf-2.0.0.jar new file mode 100644 index 000000000..306e7768d Binary files /dev/null and b/seata/lib/seata-serializer-protobuf-2.0.0.jar differ diff --git a/seata/lib/seata-serializer-seata-2.0.0.jar b/seata/lib/seata-serializer-seata-2.0.0.jar new file mode 100644 index 000000000..38513c650 Binary files /dev/null and b/seata/lib/seata-serializer-seata-2.0.0.jar differ diff --git a/seata/lib/seata-spring-autoconfigure-core-2.0.0.jar b/seata/lib/seata-spring-autoconfigure-core-2.0.0.jar new file mode 100644 index 000000000..92b1cb15b Binary files /dev/null and b/seata/lib/seata-spring-autoconfigure-core-2.0.0.jar differ diff --git a/seata/lib/seata-spring-autoconfigure-server-2.0.0.jar b/seata/lib/seata-spring-autoconfigure-server-2.0.0.jar new file mode 100644 index 000000000..8c84fe933 Binary files /dev/null and b/seata/lib/seata-spring-autoconfigure-server-2.0.0.jar differ diff --git a/seata/lib/servo-core-0.12.21.jar b/seata/lib/servo-core-0.12.21.jar new file mode 100644 index 000000000..731431d1a Binary files /dev/null and b/seata/lib/servo-core-0.12.21.jar differ diff --git a/seata/lib/simpleclient-0.15.0.jar b/seata/lib/simpleclient-0.15.0.jar new file mode 100644 index 000000000..b6d23482a Binary files /dev/null and b/seata/lib/simpleclient-0.15.0.jar differ diff --git a/seata/lib/simpleclient_common-0.15.0.jar b/seata/lib/simpleclient_common-0.15.0.jar new file mode 100644 index 000000000..7580a8c08 Binary files /dev/null and b/seata/lib/simpleclient_common-0.15.0.jar differ diff --git a/seata/lib/simpleclient_httpserver-0.15.0.jar b/seata/lib/simpleclient_httpserver-0.15.0.jar new file mode 100644 index 000000000..a0cf9f3c3 Binary files /dev/null and b/seata/lib/simpleclient_httpserver-0.15.0.jar differ diff --git a/seata/lib/simpleclient_tracer_common-0.15.0.jar b/seata/lib/simpleclient_tracer_common-0.15.0.jar new file mode 100644 index 000000000..92b1a2f25 Binary files /dev/null and b/seata/lib/simpleclient_tracer_common-0.15.0.jar differ diff --git a/seata/lib/simpleclient_tracer_otel-0.15.0.jar b/seata/lib/simpleclient_tracer_otel-0.15.0.jar new file mode 100644 index 000000000..1cfefd164 Binary files /dev/null and b/seata/lib/simpleclient_tracer_otel-0.15.0.jar differ diff --git a/seata/lib/simpleclient_tracer_otel_agent-0.15.0.jar b/seata/lib/simpleclient_tracer_otel_agent-0.15.0.jar new file mode 100644 index 000000000..b33308a70 Binary files /dev/null and b/seata/lib/simpleclient_tracer_otel_agent-0.15.0.jar differ diff --git a/seata/lib/slf4j-api-1.7.36.jar b/seata/lib/slf4j-api-1.7.36.jar new file mode 100644 index 000000000..7d3ce68d2 Binary files /dev/null and b/seata/lib/slf4j-api-1.7.36.jar differ diff --git a/seata/lib/snakeyaml-2.0.jar b/seata/lib/snakeyaml-2.0.jar new file mode 100644 index 000000000..469b0430e Binary files /dev/null and b/seata/lib/snakeyaml-2.0.jar differ diff --git a/seata/lib/snappy-java-1.1.8.4.jar b/seata/lib/snappy-java-1.1.8.4.jar new file mode 100644 index 000000000..aa5231eba Binary files /dev/null and b/seata/lib/snappy-java-1.1.8.4.jar differ diff --git a/seata/lib/sofa-common-tools-1.0.12.jar b/seata/lib/sofa-common-tools-1.0.12.jar new file mode 100644 index 000000000..d28e2343f Binary files /dev/null and b/seata/lib/sofa-common-tools-1.0.12.jar differ diff --git a/seata/lib/spring-aop-5.3.30.jar b/seata/lib/spring-aop-5.3.30.jar new file mode 100644 index 000000000..df9e3ef46 Binary files /dev/null and b/seata/lib/spring-aop-5.3.30.jar differ diff --git a/seata/lib/spring-beans-5.3.30.jar b/seata/lib/spring-beans-5.3.30.jar new file mode 100644 index 000000000..772d69d46 Binary files /dev/null and b/seata/lib/spring-beans-5.3.30.jar differ diff --git a/seata/lib/spring-boot-2.7.17.jar b/seata/lib/spring-boot-2.7.17.jar new file mode 100644 index 000000000..fd8e0ef70 Binary files /dev/null and b/seata/lib/spring-boot-2.7.17.jar differ diff --git a/seata/lib/spring-boot-autoconfigure-2.7.17.jar b/seata/lib/spring-boot-autoconfigure-2.7.17.jar new file mode 100644 index 000000000..5ae6cfc2f Binary files /dev/null and b/seata/lib/spring-boot-autoconfigure-2.7.17.jar differ diff --git a/seata/lib/spring-boot-starter-2.7.17.jar b/seata/lib/spring-boot-starter-2.7.17.jar new file mode 100644 index 000000000..ff72c5028 Binary files /dev/null and b/seata/lib/spring-boot-starter-2.7.17.jar differ diff --git a/seata/lib/spring-boot-starter-json-2.7.17.jar b/seata/lib/spring-boot-starter-json-2.7.17.jar new file mode 100644 index 000000000..5509a30b1 Binary files /dev/null and b/seata/lib/spring-boot-starter-json-2.7.17.jar differ diff --git a/seata/lib/spring-boot-starter-logging-2.7.17.jar b/seata/lib/spring-boot-starter-logging-2.7.17.jar new file mode 100644 index 000000000..b76223e6f Binary files /dev/null and b/seata/lib/spring-boot-starter-logging-2.7.17.jar differ diff --git a/seata/lib/spring-boot-starter-security-2.7.17.jar b/seata/lib/spring-boot-starter-security-2.7.17.jar new file mode 100644 index 000000000..f1b0578fc Binary files /dev/null and b/seata/lib/spring-boot-starter-security-2.7.17.jar differ diff --git a/seata/lib/spring-boot-starter-tomcat-2.7.17.jar b/seata/lib/spring-boot-starter-tomcat-2.7.17.jar new file mode 100644 index 000000000..f3be8edad Binary files /dev/null and b/seata/lib/spring-boot-starter-tomcat-2.7.17.jar differ diff --git a/seata/lib/spring-boot-starter-web-2.7.17.jar b/seata/lib/spring-boot-starter-web-2.7.17.jar new file mode 100644 index 000000000..bc7c0b927 Binary files /dev/null and b/seata/lib/spring-boot-starter-web-2.7.17.jar differ diff --git a/seata/lib/spring-context-5.3.30.jar b/seata/lib/spring-context-5.3.30.jar new file mode 100644 index 000000000..7d5483d9a Binary files /dev/null and b/seata/lib/spring-context-5.3.30.jar differ diff --git a/seata/lib/spring-core-5.3.30.jar b/seata/lib/spring-core-5.3.30.jar new file mode 100644 index 000000000..80650695d Binary files /dev/null and b/seata/lib/spring-core-5.3.30.jar differ diff --git a/seata/lib/spring-expression-5.3.30.jar b/seata/lib/spring-expression-5.3.30.jar new file mode 100644 index 000000000..f248a27c8 Binary files /dev/null and b/seata/lib/spring-expression-5.3.30.jar differ diff --git a/seata/lib/spring-jcl-5.3.30.jar b/seata/lib/spring-jcl-5.3.30.jar new file mode 100644 index 000000000..ce31f7596 Binary files /dev/null and b/seata/lib/spring-jcl-5.3.30.jar differ diff --git a/seata/lib/spring-security-config-5.7.11.jar b/seata/lib/spring-security-config-5.7.11.jar new file mode 100644 index 000000000..43ebe7ab4 Binary files /dev/null and b/seata/lib/spring-security-config-5.7.11.jar differ diff --git a/seata/lib/spring-security-core-5.7.11.jar b/seata/lib/spring-security-core-5.7.11.jar new file mode 100644 index 000000000..8aa839d97 Binary files /dev/null and b/seata/lib/spring-security-core-5.7.11.jar differ diff --git a/seata/lib/spring-security-crypto-5.7.11.jar b/seata/lib/spring-security-crypto-5.7.11.jar new file mode 100644 index 000000000..68456ab30 Binary files /dev/null and b/seata/lib/spring-security-crypto-5.7.11.jar differ diff --git a/seata/lib/spring-security-web-5.7.11.jar b/seata/lib/spring-security-web-5.7.11.jar new file mode 100644 index 000000000..5e9ef0b8d Binary files /dev/null and b/seata/lib/spring-security-web-5.7.11.jar differ diff --git a/seata/lib/spring-web-5.3.30.jar b/seata/lib/spring-web-5.3.30.jar new file mode 100644 index 000000000..ff1bc9460 Binary files /dev/null and b/seata/lib/spring-web-5.3.30.jar differ diff --git a/seata/lib/spring-webmvc-5.3.30.jar b/seata/lib/spring-webmvc-5.3.30.jar new file mode 100644 index 000000000..456640490 Binary files /dev/null and b/seata/lib/spring-webmvc-5.3.30.jar differ diff --git a/seata/lib/stringtemplate-3.2.1.jar b/seata/lib/stringtemplate-3.2.1.jar new file mode 100644 index 000000000..d0e11b719 Binary files /dev/null and b/seata/lib/stringtemplate-3.2.1.jar differ diff --git a/seata/lib/tomcat-embed-core-9.0.82.jar b/seata/lib/tomcat-embed-core-9.0.82.jar new file mode 100644 index 000000000..4e84690f0 Binary files /dev/null and b/seata/lib/tomcat-embed-core-9.0.82.jar differ diff --git a/seata/lib/tomcat-embed-el-9.0.82.jar b/seata/lib/tomcat-embed-el-9.0.82.jar new file mode 100644 index 000000000..0815ee605 Binary files /dev/null and b/seata/lib/tomcat-embed-el-9.0.82.jar differ diff --git a/seata/lib/tomcat-embed-websocket-9.0.82.jar b/seata/lib/tomcat-embed-websocket-9.0.82.jar new file mode 100644 index 000000000..9b7cc999c Binary files /dev/null and b/seata/lib/tomcat-embed-websocket-9.0.82.jar differ diff --git a/seata/lib/xstream-1.4.20.jar b/seata/lib/xstream-1.4.20.jar new file mode 100644 index 000000000..a8f7cd802 Binary files /dev/null and b/seata/lib/xstream-1.4.20.jar differ diff --git a/seata/lib/zkclient-0.11.jar b/seata/lib/zkclient-0.11.jar new file mode 100644 index 000000000..dba04fb02 Binary files /dev/null and b/seata/lib/zkclient-0.11.jar differ diff --git a/seata/lib/zookeeper-3.5.9.jar b/seata/lib/zookeeper-3.5.9.jar new file mode 100644 index 000000000..f5eceaab8 Binary files /dev/null and b/seata/lib/zookeeper-3.5.9.jar differ diff --git a/seata/lib/zookeeper-jute-3.5.9.jar b/seata/lib/zookeeper-jute-3.5.9.jar new file mode 100644 index 000000000..3c9c184a0 Binary files /dev/null and b/seata/lib/zookeeper-jute-3.5.9.jar differ diff --git a/seata/lib/zstd-jni-1.5.0-4.jar b/seata/lib/zstd-jni-1.5.0-4.jar new file mode 100644 index 000000000..f51ad8828 Binary files /dev/null and b/seata/lib/zstd-jni-1.5.0-4.jar differ diff --git a/seata/logs/start.out b/seata/logs/start.out new file mode 100644 index 000000000..84d9c4011 --- /dev/null +++ b/seata/logs/start.out @@ -0,0 +1,2 @@ +/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java -server -Dloader.path=../lib -Xmx2048m -Xms2048m -Xmn1024m -Xss512k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/Users/min.ji/Git/github/seata/distribution/logs/java_heapdump.hprof -XX:+DisableExplicitGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75 -Xloggc:/Users/min.ji/Git/github/seata/distribution/logs/seata_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -Dio.netty.leakDetectionLevel=advanced -Dapp.name=seata-server -Dapp.pid=68288 -Dapp.home=/Users/min.ji/Git/github/seata/distribution -Dbasedir=/Users/min.ji/Git/github/seata/distribution -Dspring.config.location=/Users/min.ji/Git/github/seata/distribution/conf/application.yml -Dlogging.config=/Users/min.ji/Git/github/seata/distribution/conf/logback-spring.xml -jar /Users/min.ji/Git/github/seata/distribution/target/seata-server.jar +Error: Unable to access jarfile /Users/min.ji/Git/github/seata/distribution/target/seata-server.jar diff --git a/seata/script/config-center/README.md b/seata/script/config-center/README.md new file mode 100644 index 000000000..b255d6fac --- /dev/null +++ b/seata/script/config-center/README.md @@ -0,0 +1,274 @@ +# Script usage demo +![Since 1.2.0](https://img.shields.io/badge/Since%20-1.2.0-orange.svg?style=flat-square) + +## important attributes + +you only need to follow the instructions below and keep the corresponding configuration in 'config.txt' to run. For more configuration information, please visit [seata.io](https://seata.io/) + +| server | client | +| ------------------------ | ------------------------------------------------------------ | +| store.mode: file,db | config.type: file、nacos 、apollo、zk、consul、etcd3、custom | +| #only db: | #only file: | +| store.db.driverClassName | service.default.grouplist | +| store.db.url | #All: | +| store.db.user | service.vgroupMapping.default_tx_group | +| store.db.password | service.disableGlobalTransaction | + +## Script Introduction + +The Script has interactive and non-interactive configuration modes,different patterns are distinguished by different file names. + +interactive mode(*-config-interactive.sh or *-config-interactive.py): the script starts the config program in interactive mode on the command line, prompting you for each option. + +non-interactive mode(*-config.sh or *-config.py): the script use additional config options to specify values for the options you choose during interactive mode, thus scripting the config process. + +## Nacos + +shell: + +- Interactive Mode + +```bash +sh ${SEATAPATH}/script/config-center/nacos/nacos-config-interactive.sh +``` + +This command will generate interactive configuration mode, eg: + +``` +Please enter the host of nacos. +请输入nacos的host [localhost]: +>>> +Please enter the port of nacos. +请输入nacos的port [8848]: +>>> +Please enter the group of nacos. +请输入nacos的group [SEATA_GROUP]: +>>> +Please enter the tenant of nacos. +请输入nacos的tenant: +>>> +Please enter the username of nacos. +请输入nacos的username: +>>> +Please enter the password of nacos. +请输入nacos的password: +>>> +Are you sure to continue? [y/n] +``` + +- Non-Interactive Mode + +```bash +sh ${SEATAPATH}/script/config-center/nacos/nacos-config.sh -h localhost -p 8848 -g SEATA_GROUP -t 5a3c7d6c-f497-4d68-a71a-2e5e3340b3ca -u username -w password +``` + +python: + +- Interactive Mode + + +```bash +python ${SEATAPATH}/script/config-center/nacos/nacos-config-interactive.py +``` + +This command will generate interactive configuration mode like nacos-config-interactive.sh. + +- Non-Interactive Mode + + +```bash +python ${SEATAPATH}/script/config-center/nacos/nacos-config.py localhost:8848 +``` + +Parameter Description: + +-h: host, the default value is localhost. + +-p: port, the default value is 8848. + +-g: Configure grouping, the default value is 'SEATA_GROUP'. + +-t: Tenant information, corresponding to the namespace ID field of Nacos, the default value is ''. + +-u: username, nacos 1.2.0+ on permission control, the default value is ''. + +-w: password, nacos 1.2.0+ on permission control, the default value is ''. + +## Apollo + +- Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/apollo/apollo-config-interactive.sh +``` + +This command will generate interactive configuration mode, eg: + +``` +Please enter the host of apollo. +请输入apollo的host [localhost]: +>>> +Please enter the port of apollo. +请输入apollo的port [8070]: +>>> +Please enter the env of apollo. +请输入apollo的env [DEV]: +>>> +Please enter the appId of apollo. +请输入apollo的appId [seata-server]: +>>> +Please enter the clusterName of apollo. +请输入apollo的clusterName [default]: +>>> +Please enter the namespaceName of apollo. +请输入apollo的namespaceName [application]: +>>> +Please enter the dataChangeCreatedBy of apollo. +请输入apollo的dataChangeCreatedBy: +>>> +Please enter the releasedBy of apollo. +请输入apollo的releasedBy: +>>> +Please enter the token of apollo. +请输入apollo的token: +>>> +Are you sure to continue? [y/n] +``` + +- Non-Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/apollo/apollo-config.sh -h localhost -p 8070 -e DEV -a seata-server -c default -n application -d apollo -r apollo -t 3aa026fc8435d0fc4505b345b8fa4578fb646a2c +``` +Parameter Description: + +-h: host, the default value is localhost. + +-p: port, the default value is 8070. + +-e: Managed configuration environment, the default value is DEV. + +-a: AppId to which the namespace belongs, the default value is seata-server. + +-c: Managed configuration cluster name, Generally, you can pass in default. If it is a special cluster, just pass in the name of the corresponding cluster,the default value is default. + +-n: Name of the managed namespace, If the format is not properties, you need to add a suffix name, such as sample.yml, the default value is application. + +-d: The creator of the item, in the format of a domain account, which is the User ID of the sso system. + +-r: Publisher, domain account, note: if namespace.lock.switch in ApolloConfigDB.ServerConfig is set to true (default is false), Then the environment does not allow the publisher and editor to be the same person. So if the editor is zhangsan, the publisher can no longer be zhangsan. + +-t: Apollo admin creates third-party applications in http://{portal_address}/open/manage.html, It is best to check whether this AppId has been created before creation. After successful creation, a token will be generated. + +For details of the above parameter descriptions, please see: + +https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0 + +## Consul + +- Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/consul/consul-config-interactive.sh +``` + +This command will generate interactive configuration mode, eg: + +``` +Please enter the host of consul. +请输入consul的host [localhost]: +>>> +Please enter the port of consul. +请输入consul的port [8500]: +>>> +Are you sure to continue? [y/n] +``` + +- Non-Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/consul/consul-config.sh -h localhost -p 8500 +``` + +Parameter Description: + +-h: host, the default value is localhost. + +-p: port, the default value is 8500. + +## Etcd3 + +- Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/etcd3/etcd3-config-interactive.sh +``` + +This command will generate interactive configuration mode, eg: + +``` +Please enter the host of etcd3. +请输入etcd3的host [localhost]:" +>>> +Please enter the port of etcd3. +请输入etcd3的port [2379]: +>>> +Are you sure to continue? [y/n] +``` + +- Non-Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/etcd3/etcd3-config.sh -h localhost -p 2379 +``` + +Parameter Description: + +-h: host, the default value is localhost. + +-p: port, the default value is 2379. + +## ZK + +- Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/zk/zk-config-interactive.sh +``` + +This command will generate interactive configuration mode, eg: + +``` +Please enter the host of zookeeper. +请输入zookeeper的host [localhost]: +>>> +Please enter the port of zookeeper. +请输入zookeeper的port [2181]: +>>> +Please enter the zkHome of zookeeper. +请输入zookeeper的zkHome: +>>> +Are you sure to continue? [y/n] +``` + +- Non-Interactive Mode + + +```bash +sh ${SEATAPATH}/script/config-center/zk/zk-config.sh -h localhost -p 2181 -z "/Users/zhangchenghui/zookeeper-3.4.14" +``` +Parameter Description: + +-h: host, the default value is localhost. + +-p: port, the default value is 2181. + +-z: zk path. + diff --git a/seata/script/config-center/apollo/apollo-config-interactive.sh b/seata/script/config-center/apollo/apollo-config-interactive.sh new file mode 100644 index 000000000..a97dbd562 --- /dev/null +++ b/seata/script/config-center/apollo/apollo-config-interactive.sh @@ -0,0 +1,152 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# apollo open api, click on the link for details: +# https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0 + +# add config: http://{portal_address}/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items +# publish config: http://{portal_address}/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases + +echo -e "Please enter the host of apollo.\n请输入apollo的host [localhost]:" +read -p ">>> " host +echo -e "Please enter the port of apollo.\n请输入apollo的port [8070]:" +read -p ">>> " port +echo -e "Please enter the env of apollo.\n请输入apollo的env [DEV]:" +read -p ">>> " env +echo -e "Please enter the appId of apollo.\n请输入apollo的appId [seata-server]:" +read -p ">>> " appId +echo -e "Please enter the clusterName of apollo.\n请输入apollo的clusterName [default]:" +read -p ">>> " clusterName +echo -e "Please enter the namespaceName of apollo.\n请输入apollo的namespaceName [application]:" +read -p ">>> " namespaceName +echo -e "Please enter the dataChangeCreatedBy of apollo.\n请输入apollo的dataChangeCreatedBy:" +read -p ">>> " dataChangeCreatedBy +echo -e "Please enter the releasedBy of apollo.\n请输入apollo的releasedBy:" +read -p ">>> " releasedBy +echo -e "Please enter the token of apollo.\n请输入apollo的token:" +read -p ">>> " token +read -p "Are you sure to continue? [y/n]" input +case $input in + [yY]*) + if [[ -z ${host} ]]; then + host=localhost + fi + if [[ -z ${port} ]]; then + port=8070 + fi + if [[ -z ${env} ]]; then + env=DEV + fi + if [[ -z ${appId} ]]; then + appId=seata-server + fi + if [[ -z ${clusterName} ]]; then + clusterName=default + fi + if [[ -z ${namespaceName} ]]; then + namespaceName=application + fi + if [[ -z ${dataChangeCreatedBy} ]]; then + echo " dataChangeCreatedBy is empty, please input it " + exit 1 + fi + if [[ -z ${releasedBy} ]]; then + echo " releasedBy is empty, please input it " + exit 1 + fi + if [[ -z ${token} ]]; then + echo " token is empty, please input it " + exit 1 + fi + ;; + [nN]*) + exit + ;; + *) + echo "Just enter y or n, please." + exit + ;; +esac + +portalAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" +authorization="Authorization:$token" +publishBody="{\"releaseTitle\":\"$(date +%Y%m%d%H%M%S)\",\"releaseComment\":\"\",\"releasedBy\":\"${releasedBy}\"}" + +echo "portalAddr is ${portalAddr}" +echo "env is ${env}" +echo "appId is ${appId}" +echo "clusterName is ${clusterName}" +echo "namespaceName is ${namespaceName}" +echo "dataChangeCreatedBy is ${dataChangeCreatedBy}" +echo "releasedBy is ${releasedBy}" +echo "token is ${token}" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + curl -X POST -H "${1}" -H "${2}" -d "${3}" "http://${4}/openapi/v1/envs/${5}/apps/${6}/clusters/${7}/namespaces/${8}/items" >"${tempLog}" 2>/dev/null + log=$(cat "${tempLog}") + if [[ ${log} =~ ":401" || ${log} =~ ":403" + || ${log} =~ ":404" || ${log} =~ ":405" + || ${log} =~ ":500" || ! ${log} =~ "{" ]]; then + echo "set $9=${10} failure " + (( failCount++ )) + else + echo "set $9=${10} successfully " + fi +} + +function publishConfig() { + curl -X POST -H "${1}" -H "${2}" -d "${3}" "http://${4}/openapi/v1/envs/${5}/apps/${6}/clusters/${7}/namespaces/${8}/releases" >"${tempLog}" 2>/dev/null + log=$(cat "${tempLog}") + if [[ ${log} =~ ":401" || ${log} =~ ":403" + || ${log} =~ ":404" || ${log} =~ ":405" + || ${log} =~ ":500" || ! ${log} =~ "{" ]]; then + echo " Publish fail " + exit 1 + else + echo " Publish successfully, please start seata-server. " + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + (( count++ )) + key=${line%%=*} + value=${line#*=} + body="{\"key\":\"${key}\",\"value\":\"${value}\",\"comment\":\"\",\"dataChangeCreatedBy\":\"${dataChangeCreatedBy}\"}" + addConfig ${contentType} "${authorization}" "${body}" "${portalAddr}" "${env}" "${appId}" "${clusterName}" "${namespaceName}" "${key}" "${value}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [[ $failCount -eq 0 ]]; then + read -p "Publish now, y/n: " result + if [[ ${result} == "y" ]]; then + publishConfig "${contentType}" "${authorization}" "${publishBody}" "${portalAddr}" "${env}" "${appId}" "${clusterName}" "${namespaceName}" + else + echo "Remember to publish later..." + fi +else + echo " init apollo config fail. " +fi diff --git a/seata/script/config-center/apollo/apollo-config.sh b/seata/script/config-center/apollo/apollo-config.sh new file mode 100644 index 000000000..e02b2b501 --- /dev/null +++ b/seata/script/config-center/apollo/apollo-config.sh @@ -0,0 +1,159 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# apollo open api, click on the link for details: +# https://github.com/ctripcorp/apollo/wiki/Apollo%E5%BC%80%E6%94%BE%E5%B9%B3%E5%8F%B0 + +# add config: http://{portal_address}/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/items +# publish config: http://{portal_address}/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases + +while getopts ":h:p:e:a:c:n:d:r:t:" opt +do + case $opt in + h) + host=$OPTARG + ;; + p) + port=$OPTARG + ;; + e) + env=$OPTARG + ;; + a) + appId=$OPTARG + ;; + c) + clusterName=$OPTARG + ;; + n) + namespaceName=$OPTARG + ;; + d) + dataChangeCreatedBy=$OPTARG + ;; + r) + releasedBy=$OPTARG + ;; + t) + token=$OPTARG + ;; + ?) + echo " USAGE OPTION: $0 [-h host] [-p port] [-e env] [a appId] [-c clusterName] [-n namespaceName] [-d dataChangeCreatedBy] [-r releasedBy] [-t token] " + exit 1 + ;; + esac +done + +if [[ -z ${host} ]]; then + host=localhost +fi +if [[ -z ${port} ]]; then + port=8070 +fi +if [[ -z ${env} ]]; then + env=DEV +fi +if [[ -z ${appId} ]]; then + appId=seata-server +fi +if [[ -z ${clusterName} ]]; then + clusterName=default +fi +if [[ -z ${namespaceName} ]]; then + namespaceName=application +fi +if [[ -z ${dataChangeCreatedBy} ]]; then + echo " dataChangeCreatedBy is empty, please usage option: [-d dataChangeCreatedBy] " + exit 1 +fi +if [[ -z ${releasedBy} ]]; then + echo " releasedBy is empty, please usage option: [-r releasedBy] " + exit 1 +fi +if [[ -z ${token} ]]; then + echo " token is empty, please usage option: [-t token] " + exit 1 +fi + +portalAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" +authorization="Authorization:$token" +publishBody="{\"releaseTitle\":\"$(date +%Y%m%d%H%M%S)\",\"releaseComment\":\"\",\"releasedBy\":\"${releasedBy}\"}" + +echo "portalAddr is ${portalAddr}" +echo "env is ${env}" +echo "appId is ${appId}" +echo "clusterName is ${clusterName}" +echo "namespaceName is ${namespaceName}" +echo "dataChangeCreatedBy is ${dataChangeCreatedBy}" +echo "releasedBy is ${releasedBy}" +echo "token is ${token}" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + curl -X POST -H "${1}" -H "${2}" -d "${3}" "http://${4}/openapi/v1/envs/${5}/apps/${6}/clusters/${7}/namespaces/${8}/items" >"${tempLog}" 2>/dev/null + log=$(cat "${tempLog}") + if [[ ${log} =~ ":401" || ${log} =~ ":403" + || ${log} =~ ":404" || ${log} =~ ":405" + || ${log} =~ ":500" || ! ${log} =~ "{" ]]; then + echo "set $9=${10} failure " + (( failCount++ )) + else + echo "set $9=${10} successfully " + fi +} + +function publishConfig() { + curl -X POST -H "${1}" -H "${2}" -d "${3}" "http://${4}/openapi/v1/envs/${5}/apps/${6}/clusters/${7}/namespaces/${8}/releases" >"${tempLog}" 2>/dev/null + log=$(cat "${tempLog}") + if [[ ${log} =~ ":401" || ${log} =~ ":403" + || ${log} =~ ":404" || ${log} =~ ":405" + || ${log} =~ ":500" || ! ${log} =~ "{" ]]; then + echo " Publish fail " + exit 1 + else + echo " Publish successfully, please start seata-server. " + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + (( count++ )) + key=${line%%=*} + value=${line#*=} + body="{\"key\":\"${key}\",\"value\":\"${value}\",\"comment\":\"\",\"dataChangeCreatedBy\":\"${dataChangeCreatedBy}\"}" + addConfig ${contentType} "${authorization}" "${body}" "${portalAddr}" "${env}" "${appId}" "${clusterName}" "${namespaceName}" "${key}" "${value}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [[ $failCount -eq 0 ]]; then + read -p "Publish now, y/n: " result + if [[ ${result} == "y" ]]; then + publishConfig "${contentType}" "${authorization}" "${publishBody}" "${portalAddr}" "${env}" "${appId}" "${clusterName}" "${namespaceName}" + else + echo "Remember to publish later..." + fi +else + echo " init apollo config fail. " +fi diff --git a/seata/script/config-center/config.txt b/seata/script/config-center/config.txt new file mode 100644 index 000000000..8b3e5cba8 --- /dev/null +++ b/seata/script/config-center/config.txt @@ -0,0 +1,153 @@ +#For details about configuration items, see https://seata.io/zh-cn/docs/user/configurations.html +#Transport configuration, for client and server +transport.type=TCP +transport.server=NIO +transport.heartbeat=true +transport.enableTmClientBatchSendRequest=false +transport.enableRmClientBatchSendRequest=true +transport.enableTmClientChannelCheckFailFast=true +transport.enableRmClientChannelCheckFailFast=true +transport.enableTcServerBatchSendResponse=false +transport.rpcRmRequestTimeout=30000 +transport.rpcTmRequestTimeout=30000 +transport.rpcTcRequestTimeout=30000 +transport.threadFactory.bossThreadPrefix=NettyBoss +transport.threadFactory.workerThreadPrefix=NettyServerNIOWorker +transport.threadFactory.serverExecutorThreadPrefix=NettyServerBizHandler +transport.threadFactory.shareBossWorker=false +transport.threadFactory.clientSelectorThreadPrefix=NettyClientSelector +transport.threadFactory.clientSelectorThreadSize=1 +transport.threadFactory.clientWorkerThreadPrefix=NettyClientWorkerThread +transport.threadFactory.bossThreadSize=1 +transport.threadFactory.workerThreadSize=default +transport.shutdown.wait=3 +transport.serialization=seata +transport.compressor=none + +#Transaction routing rules configuration, only for the client +service.vgroupMapping.default_tx_group=default +#If you use a registry, you can ignore it +service.default.grouplist=127.0.0.1:8091 +service.enableDegrade=false +service.disableGlobalTransaction=false + +client.metadataMaxAgeMs=30000 +#Transaction rule configuration, only for the client +client.rm.asyncCommitBufferLimit=10000 +client.rm.lock.retryInterval=10 +client.rm.lock.retryTimes=30 +client.rm.lock.retryPolicyBranchRollbackOnConflict=true +client.rm.reportRetryCount=5 +client.rm.tableMetaCheckEnable=true +client.rm.tableMetaCheckerInterval=60000 +client.rm.sqlParserType=druid +client.rm.reportSuccessEnable=false +client.rm.sagaBranchRegisterEnable=false +client.rm.sagaJsonParser=fastjson +client.rm.tccActionInterceptorOrder=-2147482648 +client.rm.sqlParserType=druid +client.tm.commitRetryCount=5 +client.tm.rollbackRetryCount=5 +client.tm.defaultGlobalTransactionTimeout=60000 +client.tm.degradeCheck=false +client.tm.degradeCheckAllowTimes=10 +client.tm.degradeCheckPeriod=2000 +client.tm.interceptorOrder=-2147482648 +client.undo.dataValidation=true +client.undo.logSerialization=jackson +client.undo.onlyCareUpdateColumns=true +server.undo.logSaveDays=7 +server.undo.logDeletePeriod=86400000 +client.undo.logTable=undo_log +client.undo.compress.enable=true +client.undo.compress.type=zip +client.undo.compress.threshold=64k +#For TCC transaction mode +tcc.fence.logTableName=tcc_fence_log +tcc.fence.cleanPeriod=1h +# You can choose from the following options: fastjson, jackson, gson +tcc.contextJsonParserType=fastjson + +#Log rule configuration, for client and server +log.exceptionRate=100 + +#Transaction storage configuration, only for the server. The file, db, and redis configuration values are optional. +store.mode=db +store.lock.mode=db +store.session.mode=db +#Used for password encryption +store.publicKey= + +#If `store.mode,store.lock.mode,store.session.mode` are not equal to `file`, you can remove the configuration block. +store.file.dir=file_store/data +store.file.maxBranchSessionSize=16384 +store.file.maxGlobalSessionSize=512 +store.file.fileWriteBufferCacheSize=16384 +store.file.flushDiskMode=async +store.file.sessionReloadReadSize=100 + +#These configurations are required if the `store mode` is `db`. If `store.mode,store.lock.mode,store.session.mode` are not equal to `db`, you can remove the configuration block. +store.db.datasource=druid +store.db.dbType=mysql +store.db.driverClassName=com.mysql.jdbc.Driver +store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&rewriteBatchedStatements=true +store.db.user=root +store.db.password=root +store.db.minConn=5 +store.db.maxConn=30 +store.db.globalTable=global_table +store.db.branchTable=branch_table +store.db.distributedLockTable=distributed_lock +store.db.queryLimit=100 +store.db.lockTable=lock_table +store.db.maxWait=5000 + +#These configurations are required if the `store mode` is `redis`. If `store.mode,store.lock.mode,store.session.mode` are not equal to `redis`, you can remove the configuration block. +store.redis.mode=single +store.redis.type=pipeline +store.redis.single.host=127.0.0.1 +store.redis.single.port=6379 +store.redis.sentinel.masterName= +store.redis.sentinel.sentinelHosts= +store.redis.sentinel.sentinelPassword= +store.redis.maxConn=10 +store.redis.minConn=1 +store.redis.maxTotal=100 +store.redis.database=0 +store.redis.password= +store.redis.queryLimit=100 + +#Transaction rule configuration, only for the server +server.recovery.committingRetryPeriod=1000 +server.recovery.asynCommittingRetryPeriod=1000 +server.recovery.rollbackingRetryPeriod=1000 +server.recovery.timeoutRetryPeriod=1000 +server.maxCommitRetryTimeout=-1 +server.maxRollbackRetryTimeout=-1 +server.rollbackRetryTimeoutUnlockEnable=false +server.distributedLockExpireTime=10000 +server.session.branchAsyncQueueSize=5000 +server.session.enableBranchAsyncRemove=false +server.enableParallelRequestHandle=true +server.enableParallelHandleBranch=false + +server.raft.cluster=127.0.0.1:7091,127.0.0.1:7092,127.0.0.1:7093 +server.raft.snapshotInterval=600 +server.raft.applyBatch=32 +server.raft.maxAppendBufferSize=262144 +server.raft.maxReplicatorInflightMsgs=256 +server.raft.disruptorBufferSize=16384 +server.raft.electionTimeoutMs=2000 +server.raft.reporterEnabled=false +server.raft.reporterInitialDelay=60 +server.raft.serialization=jackson +server.raft.compressor=none +server.raft.sync=true + + + +#Metrics configuration, only for the server +metrics.enabled=false +metrics.registryType=compact +metrics.exporterList=prometheus +metrics.exporterPrometheusPort=9898 diff --git a/seata/script/config-center/consul/consul-config-interactive.sh b/seata/script/config-center/consul/consul-config-interactive.sh new file mode 100644 index 000000000..aa306475a --- /dev/null +++ b/seata/script/config-center/consul/consul-config-interactive.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +echo -e "Please enter the host of consul.\n请输入consul的host [localhost]:" +read -p ">>> " host +echo -e "Please enter the port of consul.\n请输入consul的port [8500]:" +read -p ">>> " port +read -p "Are you sure to continue? [y/n]" input +case $input in + [yY]*) + if [[ -z ${host} ]]; then + host=localhost + fi + if [[ -z ${port} ]]; then + port=8500 + fi + ;; + [nN]*) + exit + ;; + *) + echo "Just enter y or n, please." + exit + ;; +esac + +consulAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" +echo "Set consulAddr=$consulAddr" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + curl -X PUT -H "${1}" -d "${2}" "http://$3/v1/kv/$4" >"${tempLog}" 2>/dev/null + if [[ -z $(cat "${tempLog}") ]]; then + echo " Please check the cluster status. " + exit 1 + fi + if [[ $(cat "${tempLog}") =~ "true" ]]; then + echo "Set $4=$2 successfully " + else + echo "Set $4=$2 failure " + (( failCount++ )) + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + (( count++ )) + key=${line%%=*} + value=${line#*=} + addConfig "${contentType}" "${value}" "${consulAddr}" "${key}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [[ ${failCount} -eq 0 ]]; then + echo " Init consul config finished, please start seata-server. " +else + echo " Init consul config fail. " +fi diff --git a/seata/script/config-center/consul/consul-config.sh b/seata/script/config-center/consul/consul-config.sh new file mode 100644 index 000000000..3d967a58e --- /dev/null +++ b/seata/script/config-center/consul/consul-config.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +while getopts ":h:p:" opt +do + case $opt in + h) + host=$OPTARG + ;; + p) + port=$OPTARG + ;; + ?) + echo " USAGE OPTION: $0 [-h host] [-p port] " + exit 1 + ;; + esac +done + +if [[ -z ${host} ]]; then + host=localhost +fi +if [[ -z ${port} ]]; then + port=8500 +fi + +consulAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" +echo "Set consulAddr=$consulAddr" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + curl -X PUT -H "${1}" -d "${2}" "http://$3/v1/kv/$4" >"${tempLog}" 2>/dev/null + if [[ -z $(cat "${tempLog}") ]]; then + echo " Please check the cluster status. " + exit 1 + fi + if [[ $(cat "${tempLog}") =~ "true" ]]; then + echo "Set $4=$2 successfully " + else + echo "Set $4=$2 failure " + (( failCount++ )) + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + (( count++ )) + key=${line%%=*} + value=${line#*=} + addConfig "${contentType}" "${value}" "${consulAddr}" "${key}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [[ ${failCount} -eq 0 ]]; then + echo " Init consul config finished, please start seata-server. " +else + echo " Init consul config fail. " +fi diff --git a/seata/script/config-center/etcd3/etcd3-config-interactive.sh b/seata/script/config-center/etcd3/etcd3-config-interactive.sh new file mode 100644 index 000000000..eae3e013c --- /dev/null +++ b/seata/script/config-center/etcd3/etcd3-config-interactive.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# etcd REST API v3. +# author:wangyuewen + +# shellcheck disable=SC2039,SC2162,SC2046,SC2013,SC2002 +echo -e "Please enter the host of etcd3.\n请输入etcd3的host [localhost]:" +read -p ">>> " host +echo -e "Please enter the port of etcd3.\n请输入etcd3的port [2379]:" +read -p ">>> " port +read -p "Are you sure to continue? [y/n]" input +case $input in + [yY]*) + if [[ -z ${host} ]]; then + host=localhost + fi + if [[ -z ${port} ]]; then + port=2379 + fi + ;; + [nN]*) + exit + ;; + *) + echo "Just enter y or n, please." + exit + ;; +esac + +etcd3Addr=$host:$port +contentType="content-type:application/json;charset=UTF-8" +echo "Set etcd3Addr=$etcd3Addr" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + keyBase64=$(printf "%s""$2" | base64) + valueBase64=$(printf "%s""$3" | base64) + curl -X POST -H "${1}" -d "{\"key\": \"$keyBase64\", \"value\": \"$valueBase64\"}" "http://$4/v3/kv/put" >"${tempLog}" 2>/dev/null + if [[ -z $(cat "${tempLog}") ]]; then + echo " Please check the cluster status. " + exit 1 + fi + if [[ $(cat "${tempLog}") =~ "error" || $(cat "${tempLog}") =~ "code" ]]; then + echo "Set $2=$3 failure " + (( failCount++ )) + else + echo "Set $2=$3 successfully " + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + (( count++ )) + key=${line%%=*} + value=${line#*=} + addConfig "${contentType}" "${key}" "${value}" "${etcd3Addr}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [[ ${failCount} -eq 0 ]]; then + echo " Init etcd3 config finished, please start seata-server. " +else + echo " Init etcd3 config fail. " +fi diff --git a/seata/script/config-center/etcd3/etcd3-config.sh b/seata/script/config-center/etcd3/etcd3-config.sh new file mode 100644 index 000000000..cca712f4f --- /dev/null +++ b/seata/script/config-center/etcd3/etcd3-config.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# etcd REST API v3. + +while getopts ":h:p:" opt +do + case $opt in + h) + host=$OPTARG + ;; + p) + port=$OPTARG + ;; + ?) + echo " USAGE OPTION: $0 [-h host] [-p port] " + exit 1 + ;; + esac +done + +if [[ -z ${host} ]]; then + host=localhost +fi +if [[ -z ${port} ]]; then + port=2379 +fi + +etcd3Addr=$host:$port +contentType="content-type:application/json;charset=UTF-8" +echo "Set etcd3Addr=$etcd3Addr" + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + keyBase64=$(printf "%s""$2" | base64) + valueBase64=$(printf "%s""$3" | base64) + curl -X POST -H "${1}" -d "{\"key\": \"$keyBase64\", \"value\": \"$valueBase64\"}" "http://$4/v3/kv/put" >"${tempLog}" 2>/dev/null + if [[ -z $(cat "${tempLog}") ]]; then + echo " Please check the cluster status. " + exit 1 + fi + if [[ $(cat "${tempLog}") =~ "error" || $(cat "${tempLog}") =~ "code" ]]; then + echo "Set $2=$3 failure " + (( failCount++ )) + else + echo "Set $2=$3 successfully " + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + (( count++ )) + key=${line%%=*} + value=${line#*=} + addConfig "${contentType}" "${key}" "${value}" "${etcd3Addr}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [[ ${failCount} -eq 0 ]]; then + echo " Init etcd3 config finished, please start seata-server. " +else + echo " Init etcd3 config fail. " +fi diff --git a/seata/script/config-center/nacos/nacos-config-interactive.py b/seata/script/config-center/nacos/nacos-config-interactive.py new file mode 100644 index 000000000..f23654ce8 --- /dev/null +++ b/seata/script/config-center/nacos/nacos-config-interactive.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- +# @Author : wangyeuwen +import http.client +import urllib.parse +import re + + +def get_params() -> dict: + params = { + 'host': '127.0.0.1', + 'port': '8848', + 'tenant': '', + 'group': 'SEATA_GROUP', + 'username': '', + 'password': '' + } + host = input("Please enter the host of nacos.\n请输入nacos的host [localhost]\n>>> ") + port = input("Please enter the port of nacos.\n请输入nacos的port [8848]\n>>> ") + group = input("Please enter the group of nacos.\n请输入nacos的group [SEATA_GROUP]\n>>> ") + tenant = input("Please enter the tenant of nacos.\n请输入nacos的tenant\n>>> ") + username = input("Please enter the username of nacos.\n请输入nacos的username\n>>> ") + password = input("Please enter the password of nacos.\n请输入nacos的password\n>>> ") + confirm = input("Are you sure to continue? [y/n]") + if confirm[0] == 'y' or confirm[0] == 'Y': + if len(host) != 0: params['host'] = host + if len(port) != 0: params['port'] = port + if len(group) != 0: params['group'] = group + if len(tenant) != 0: params['tenant'] = tenant + if len(username) != 0: params['username'] = username + if len(password) != 0: params['password'] = password + elif confirm[0] == 'n' or confirm[0] == 'N': + exit() + else: + print("Just enter y or n, please.") + exit() + + return params + + +def error_exit(): + print(' init nacos config fail.') + exit() + + +def get_pair(line: str) -> tuple: + res = re.match(r"([\.\w]+)=(.*)", line) + return res.groups() if res is not None else ['', ''] + + +headers = { + 'content-type': "application/x-www-form-urlencoded" +} + +hasError = False + +params = get_params() + +url_prefix = f"{params['host']}:{params['port']}" +tenant = params['tenant'] +username = params['username'] +password = params['password'] +group = params['group'] +url_postfix_base = f'/nacos/v1/cs/configs?group={group}&tenant={tenant}' + +if username != '' and password != '': + url_postfix_base += f'&username={username}&password={password}' + +if url_prefix == ':': + error_exit() + +for line in open('../config.txt'): + pair = get_pair(line.rstrip("\n")) + if len(pair) < 2 or pair[0] == '' or pair[0].startswith("#") or pair[1] == '': + continue + url_postfix = url_postfix_base + f'&dataId={urllib.parse.quote(str(pair[0]))}&content={urllib.parse.quote(str(pair[1])).strip()}' + conn = http.client.HTTPConnection(url_prefix) + conn.request("POST", url_postfix, headers=headers) + res = conn.getresponse() + data = res.read().decode("utf-8") + if data != "true": + hasError = True + print(f"{pair[0]}={pair[1]} {data if hasError else 'success'}") + +if hasError: + print("init nacos config fail.") +else: + print("init nacos config finished, please start seata-server.") diff --git a/seata/script/config-center/nacos/nacos-config-interactive.sh b/seata/script/config-center/nacos/nacos-config-interactive.sh new file mode 100644 index 000000000..03f8a7374 --- /dev/null +++ b/seata/script/config-center/nacos/nacos-config-interactive.sh @@ -0,0 +1,120 @@ +#!/bin/sh +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# author:wangyuewen + +# shellcheck disable=SC2039,SC2162,SC2046,SC2013,SC2002,SC2086 +echo -e "Please enter the host of nacos.\n请输入nacos的host [localhost]:" +read -p ">>> " host +echo -e "Please enter the port of nacos.\n请输入nacos的port [8848]:" +read -p ">>> " port +echo -e "Please enter the group of nacos.\n请输入nacos的group [SEATA_GROUP]:" +read -p ">>> " group +echo -e "Please enter the tenant of nacos.\n请输入nacos的tenant:" +read -p ">>> " tenant +echo -e "Please enter the username of nacos.\n请输入nacos的username:" +read -p ">>> " username +echo -e "Please enter the password of nacos.\n请输入nacos的password:" +read -p ">>> " password + +read -p "Are you sure to continue? [y/n]" input +case $input in + [yY]*) + if [ -z ${host} ]; then + host=localhost + fi + if [ -z ${port} ]; then + port=8848 + fi + if [ -z ${group} ]; then + group="SEATA_GROUP" + fi + if [ -z ${tenant} ]; then + tenant="" + fi + if [ -z ${username} ]; then + username="" + fi + if [ -z ${password} ]; then + password="" + fi + ;; + [nN]*) + exit + ;; + *) + echo "Just enter y or n, please." + exit + ;; +esac + +nacosAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" + +echo "set nacosAddr=$nacosAddr" +echo "set group=$group" + +urlencode() { + length="${#1}" + i=0 + while [ $length -gt $i ]; do + char="${1:$i:1}" + case $char in + [a-zA-Z0-9.~_-]) printf $char ;; + *) printf '%%%02X' "'$char" ;; + esac + i=`expr $i + 1` + done +} + +failCount=0 +tempLog=$(mktemp -u) +addConfig() { + dataId=`urlencode $1` + content=`urlencode $2` + curl -X POST -H "${contentType}" "http://$nacosAddr/nacos/v1/cs/configs?dataId=$dataId&group=$group&content=$content&tenant=$tenant&username=$username&password=$password" >"${tempLog}" 2>/dev/null + if [ -z $(cat "${tempLog}") ]; then + echo " Please check the cluster status. " + exit 1 + fi + if [ "$(cat "${tempLog}")" == "true" ]; then + echo "Set $1=$2 successfully " + else + echo "Set $1=$2 failure " + failCount=`expr $failCount + 1` + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + count=`expr $count + 1` + key=${line%%=*} + value=${line#*=} + addConfig "${key}" "${value}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [ ${failCount} -eq 0 ]; then + echo " Init nacos config finished, please start seata-server. " +else + echo " init nacos config fail. " +fi diff --git a/seata/script/config-center/nacos/nacos-config.py b/seata/script/config-center/nacos/nacos-config.py new file mode 100644 index 000000000..524d96149 --- /dev/null +++ b/seata/script/config-center/nacos/nacos-config.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- + +import http.client +import sys +import getopt as opts +import urllib.parse +import re + + +def get_params() -> dict: + params = { + '-h': '127.0.0.1', + '-p': '8848', + '-t': '', + '-g': 'SEATA_GROUP', + '-u': '', + '-w': '' + } + inputs, args = opts.getopt(sys.argv[1:], shortopts='h:p:t:g:u:w:') + for k, v in inputs: + params[k] = v + print(params) + return params + +def error_exit(): + print('python nacos-config.py [-h host] [-p port] [-t tenant] [-g group] [-u username] [-w password]') + exit() + +def get_pair(line: str) -> tuple: + res = re.match(r"([\.\w]+)=(.*)",line) + return res.groups() if res is not None else ['',''] + + +headers = { + 'content-type': "application/x-www-form-urlencoded" +} + +hasError = False + +params = get_params() + +url_prefix = f"{params['-h']}:{params['-p']}" +tenant = params['-t'] +username = params['-u'] +password = params['-w'] +group = params['-g'] +url_postfix_base = f'/nacos/v1/cs/configs?group={group}&tenant={tenant}' + +if username != '' and password != '': + url_postfix_base += f'&username={username}&password={password}' + +if url_prefix == ':': + error_exit() + +for line in open('../config.txt'): + pair = get_pair(line.rstrip("\n")) + if len(pair) < 2 or pair[0] == '' or pair[0].startswith("#") or pair[1] == '': + continue + url_postfix = url_postfix_base + f'&dataId={urllib.parse.quote(str(pair[0]))}&content={urllib.parse.quote(str(pair[1])).strip()}' + conn = http.client.HTTPConnection(url_prefix) + conn.request("POST", url_postfix, headers=headers) + res = conn.getresponse() + data = res.read().decode("utf-8") + if data != "true": + hasError = True + print(f"{pair[0]}={pair[1]} {data if hasError else 'success'}") + +if hasError: + print("init nacos config fail.") +else: + print("init nacos config finished, please start seata-server.") diff --git a/seata/script/config-center/nacos/nacos-config.sh b/seata/script/config-center/nacos/nacos-config.sh new file mode 100644 index 000000000..e1704e0df --- /dev/null +++ b/seata/script/config-center/nacos/nacos-config.sh @@ -0,0 +1,120 @@ +#!/bin/sh +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +while getopts ":h:p:g:t:u:w:" opt +do + case $opt in + h) + host=$OPTARG + ;; + p) + port=$OPTARG + ;; + g) + group=$OPTARG + ;; + t) + tenant=$OPTARG + ;; + u) + username=$OPTARG + ;; + w) + password=$OPTARG + ;; + ?) + echo " USAGE OPTION: $0 [-h host] [-p port] [-g group] [-t tenant] [-u username] [-w password] " + exit 1 + ;; + esac +done + +if [ -z ${host} ]; then + host=localhost +fi +if [ -z ${port} ]; then + port=8848 +fi +if [ -z ${group} ]; then + group="SEATA_GROUP" +fi +if [ -z ${tenant} ]; then + tenant="" +fi +if [ -z ${username} ]; then + username="" +fi +if [ -z ${password} ]; then + password="" +fi + +nacosAddr=$host:$port +contentType="content-type:application/json;charset=UTF-8" + +echo "set nacosAddr=$nacosAddr" +echo "set group=$group" + +urlencode() { + length="${#1}" + i=0 + while [ $length -gt $i ]; do + char="${1:$i:1}" + case $char in + [a-zA-Z0-9.~_-]) printf $char ;; + *) printf '%%%02X' "'$char" ;; + esac + i=`expr $i + 1` + done +} + +failCount=0 +tempLog=$(mktemp -u) +function addConfig() { + dataId=`urlencode $1` + content=`urlencode $2` + curl -X POST -H "${contentType}" "http://$nacosAddr/nacos/v1/cs/configs?dataId=$dataId&group=$group&content=$content&tenant=$tenant&username=$username&password=$password" >"${tempLog}" 2>/dev/null + if [ -z $(cat "${tempLog}") ]; then + echo " Please check the cluster status. " + exit 1 + fi + if [ "$(cat "${tempLog}")" == "true" ]; then + echo "Set $1=$2 successfully " + else + echo "Set $1=$2 failure " + failCount=`expr $failCount + 1` + fi +} + +count=0 +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + count=`expr $count + 1` + key=${line%%=*} + value=${line#*=} + addConfig "${key}" "${value}" +done + +echo "=========================================================================" +echo " Complete initialization parameters, total-count:$count , failure-count:$failCount " +echo "=========================================================================" + +if [ ${failCount} -eq 0 ]; then + echo " Init nacos config finished, please start seata-server. " +else + echo " init nacos config fail. " +fi diff --git a/seata/script/config-center/zk/zk-config-interactive.sh b/seata/script/config-center/zk/zk-config-interactive.sh new file mode 100644 index 000000000..75ba7b0ae --- /dev/null +++ b/seata/script/config-center/zk/zk-config-interactive.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# The purpose is to sync the local configuration(config.txt) to zk. +# This script need to rely on zk. +echo -e "Please enter the host of zookeeper.\n请输入zookeeper的host [localhost]:" +read -p ">>> " host +echo -e "Please enter the port of zookeeper.\n请输入zookeeper的port [2181]:" +read -p ">>> " port +echo -e "Please enter the zkHome of zookeeper.\n请输入zookeeper的zkHome:" +read -p ">>> " zkHome +read -p "Are you sure to continue? [y/n]" input +case $input in + [yY]*) + if [[ -z ${host} ]]; then + host=localhost + fi + if [[ -z ${port} ]]; then + port=2181 + fi + if [[ -z ${zkHome} ]]; then + echo " zk home is empty, please input it " + exit 1 + fi + ;; + [nN]*) + exit + ;; + *) + echo "Just enter y or n, please." + exit + ;; +esac + +zkAddr=$host:$port + +root="/seata" +tempLog=$(mktemp -u) + +echo "ZK address is $zkAddr" +echo "ZK home is $zkHome" +echo "ZK config root node is $root" + +function check_node() { + "$2"/bin/zkCli.sh -server "$1" ls ${root} >/dev/null 2>"${tempLog}" +} + +function create_node() { + "$2"/bin/zkCli.sh -server "$1" create ${root} "" >/dev/null +} + +function create_subNode() { + "$2"/bin/zkCli.sh -server "$1" create "${root}/$3" "$4" >/dev/null +} + +function delete_node() { + "$2"/bin/zkCli.sh -server $1 rmr ${root} "" >/dev/null +} + +check_node "${zkAddr}" "${zkHome}" + +if [[ $(cat "${tempLog}") =~ "No such file or directory" ]]; then + echo " ZK home is error, please enter correct zk home! " + exit 1 +elif [[ $(cat "${tempLog}") =~ "Exception" ]]; then + echo " Exception error, please check zk cluster status or if the zk address is entered correctly! " + exit 1 +elif [[ $(cat "${tempLog}") =~ "Node does not exist" ]]; then + create_node "${zkAddr}" "${zkHome}" +else + read -p "${root} node already exists, now delete ${root} node in zk, y/n: " result + if [[ ${result} == "y" ]]; then + echo "Delete ${root} node..." + delete_node "${zkAddr}" "${zkHome}" + create_node "${zkAddr}" "${zkHome}" + else + exit 0 + fi +fi + +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + key=${line%%=*} + value=${line#*=} + echo "Set" "${key}" "=" "${value}" + create_subNode "${zkAddr}" "${zkHome}" "${key}" "${value}" +done diff --git a/seata/script/config-center/zk/zk-config.sh b/seata/script/config-center/zk/zk-config.sh new file mode 100644 index 000000000..a1571e97a --- /dev/null +++ b/seata/script/config-center/zk/zk-config.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at、 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# The purpose is to sync the local configuration(config.txt) to zk. +# This script need to rely on zk. + + +while getopts ":h:p:z:" opt +do + case $opt in + h) + host=$OPTARG + ;; + p) + port=$OPTARG + ;; + z) + zkHome=$OPTARG + ;; + ?) + echo " USAGE OPTION: $0 [-h host] [-p port] [-z zkHome] " + exit 1 + ;; + esac +done + +if [[ -z ${host} ]]; then + host=localhost +fi +if [[ -z ${port} ]]; then + port=2181 +fi +if [[ -z ${zkHome} ]]; then + echo " zk home is empty, please usage option: [-z zkHome] " + exit 1 +fi + +zkAddr=$host:$port + +root="/seata" +tempLog=$(mktemp -u) + +echo "ZK address is $zkAddr" +echo "ZK home is $zkHome" +echo "ZK config root node is $root" + +function check_node() { + "$2"/bin/zkCli.sh -server "$1" ls ${root} >/dev/null 2>"${tempLog}" +} + +function create_node() { + "$2"/bin/zkCli.sh -server "$1" create ${root} "" >/dev/null +} + +function create_subNode() { + "$2"/bin/zkCli.sh -server "$1" create "${root}/$3" "$4" >/dev/null +} + +function delete_node() { + "$2"/bin/zkCli.sh -server $1 rmr ${root} "" >/dev/null +} + +check_node "${zkAddr}" "${zkHome}" + +if [[ $(cat "${tempLog}") =~ "No such file or directory" ]]; then + echo " ZK home is error, please enter correct zk home! " + exit 1 +elif [[ $(cat "${tempLog}") =~ "Exception" ]]; then + echo " Exception error, please check zk cluster status or if the zk address is entered correctly! " + exit 1 +elif [[ $(cat "${tempLog}") =~ "Node does not exist" ]]; then + create_node "${zkAddr}" "${zkHome}" +else + read -p "${root} node already exists, now delete ${root} node in zk, y/n: " result + if [[ ${result} == "y" ]]; then + echo "Delete ${root} node..." + delete_node "${zkAddr}" "${zkHome}" + create_node "${zkAddr}" "${zkHome}" + else + exit 0 + fi +fi + +COMMENT_START="#" +for line in $(cat $(dirname "$PWD")/config.txt | sed s/[[:space:]]//g); do + if [[ "$line" =~ ^"${COMMENT_START}".* ]]; then + continue + fi + key=${line%%=*} + value=${line#*=} + echo "Set" "${key}" "=" "${value}" + create_subNode "${zkAddr}" "${zkHome}" "${key}" "${value}" +done diff --git a/seata/script/logstash/config/logstash-kafka.conf b/seata/script/logstash/config/logstash-kafka.conf new file mode 100644 index 000000000..8423163b0 --- /dev/null +++ b/seata/script/logstash/config/logstash-kafka.conf @@ -0,0 +1,31 @@ +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# App(Logback KafkaAppender) -> Kafka -> Logstash -> Elasticsearch pipeline. + +input { + kafka { + bootstrap_servers => "localhost:9092" + topics => ["logback_to_logstash"] + } +} + +output{ + elasticsearch { + hosts => ["localhost:9200"] + } + stdout { + codec => rubydebug + } +} diff --git a/seata/script/logstash/config/logstash-logback.conf b/seata/script/logstash/config/logstash-logback.conf new file mode 100644 index 000000000..340f150d4 --- /dev/null +++ b/seata/script/logstash/config/logstash-logback.conf @@ -0,0 +1,33 @@ +# Copyright 1999-2019 Seata.io Group. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# App(Logback LogstashTcpSocketAppender) -> Logstash -> Elasticsearch pipeline. + +input { + # Using TCP protocol + tcp { + port => 4560 + # execute command `./logstash-plugin install logstash-codec-json_lines` to install this plugin. + codec => json_lines + } +} + +output{ + elasticsearch { + hosts => ["localhost:9200"] + } + stdout { + codec => rubydebug + } +} diff --git a/seata/script/server/db/dm.sql b/seata/script/server/db/dm.sql new file mode 100644 index 000000000..34e00e565 --- /dev/null +++ b/seata/script/server/db/dm.sql @@ -0,0 +1,76 @@ +-- -------------------------------- The script used when storeMode is 'db' -------------------------------- + +-- the table to store GlobalSession data +CREATE TABLE "SEATA"."GLOBAL_TABLE" +( + "XID" VARCHAR2(128) NOT NULL, + "TRANSACTION_ID" BIGINT, + "STATUS" TINYINT NOT NULL, + "APPLICATION_ID" VARCHAR2(32), + "TRANSACTION_SERVICE_GROUP" VARCHAR2(32), + "TRANSACTION_NAME" VARCHAR2(128), + "TIMEOUT" INT, + "BEGIN_TIME" BIGINT, + "APPLICATION_DATA" VARCHAR2(2000), + "GMT_CREATE" TIMESTAMP(0), + "GMT_MODIFIED" TIMESTAMP(0), + PRIMARY KEY ("XID") +); + +CREATE INDEX "IDX_GMT_MODIFIED_STATUS" ON "SEATA"."GLOBAL_TABLE"("GMT_MODIFIED" ASC,"STATUS" ASC); +CREATE INDEX "IDX_TRANSACTION_ID" ON "SEATA"."GLOBAL_TABLE"("TRANSACTION_ID" ASC); + + +-- the table to store BranchSession data +CREATE TABLE "SEATA"."BRANCH_TABLE" +( + "BRANCH_ID" BIGINT NOT NULL, + "XID" VARCHAR2(128) NOT NULL, + "TRANSACTION_ID" BIGINT, + "RESOURCE_GROUP_ID" VARCHAR2(32), + "RESOURCE_ID" VARCHAR2(256), + "BRANCH_TYPE" VARCHAR2(8), + "STATUS" TINYINT, + "CLIENT_ID" VARCHAR2(64), + "APPLICATION_DATA" VARCHAR2(2000), + "GMT_CREATE" TIMESTAMP(0), + "GMT_MODIFIED" TIMESTAMP(0), + PRIMARY KEY ("BRANCH_ID") +); + +CREATE INDEX "IDX_XID" ON "SEATA"."BRANCH_TABLE"("XID" ASC); + + +-- the table to store lock data +CREATE TABLE "SEATA"."LOCK_TABLE" +( + "ROW_KEY" VARCHAR2(128) NOT NULL, + "XID" VARCHAR2(128), + "TRANSACTION_ID" BIGINT, + "BRANCH_ID" BIGINT NOT NULL, + "RESOURCE_ID" VARCHAR2(256), + "TABLE_NAME" VARCHAR2(32), + "PK" VARCHAR2(36), + "STATUS" TINYINT NOT NULL DEFAULT 0, + "GMT_CREATE" TIMESTAMP(0), + "GMT_MODIFIED" TIMESTAMP(0), + PRIMARY KEY ("ROW_KEY") +); + +COMMENT ON COLUMN "SEATA"."LOCK_TABLE"."STATUS" IS '0:locked ,1:rollbacking'; + +CREATE INDEX "IDX_BRANCH_ID" ON "SEATA"."LOCK_TABLE" ("BRANCH_ID" ASC); +CREATE INDEX "IDX_STATUS" ON "SEATA"."LOCK_TABLE" ("STATUS" ASC); + +CREATE TABLE "SEATA"."DISTRIBUTED_LOCK" +( + "LOCK_KEY" VARCHAR2(20) NOT NULL, + "LOCK_VALUE" VARCHAR2(20) NOT NULL, + "EXPIRE" BIGINT NOT NULL, + PRIMARY KEY ("LOCK_KEY") +); + +INSERT INTO "SEATA"."DISTRIBUTED_LOCK" ("LOCK_KEY", "LOCK_VALUE", "EXPIRE") VALUES ('AsyncCommitting', ' ', 0); +INSERT INTO "SEATA"."DISTRIBUTED_LOCK" ("LOCK_KEY", "LOCK_VALUE", "EXPIRE") VALUES ('RetryCommitting', ' ', 0); +INSERT INTO "SEATA"."DISTRIBUTED_LOCK" ("LOCK_KEY", "LOCK_VALUE", "EXPIRE") VALUES ('RetryRollbacking', ' ', 0); +INSERT INTO "SEATA"."DISTRIBUTED_LOCK" ("LOCK_KEY", "LOCK_VALUE", "EXPIRE") VALUES ('TxTimeoutCheck', ' ', 0); diff --git a/seata/script/server/db/mysql.sql b/seata/script/server/db/mysql.sql new file mode 100644 index 000000000..bf4bbb35c --- /dev/null +++ b/seata/script/server/db/mysql.sql @@ -0,0 +1,73 @@ +-- -------------------------------- The script used when storeMode is 'db' -------------------------------- +-- the table to store GlobalSession data +CREATE TABLE IF NOT EXISTS `global_table` +( + `xid` VARCHAR(128) NOT NULL, + `transaction_id` BIGINT, + `status` TINYINT NOT NULL, + `application_id` VARCHAR(32), + `transaction_service_group` VARCHAR(32), + `transaction_name` VARCHAR(128), + `timeout` INT, + `begin_time` BIGINT, + `application_data` VARCHAR(2000), + `gmt_create` DATETIME, + `gmt_modified` DATETIME, + PRIMARY KEY (`xid`), + KEY `idx_status_gmt_modified` (`status` , `gmt_modified`), + KEY `idx_transaction_id` (`transaction_id`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4; + +-- the table to store BranchSession data +CREATE TABLE IF NOT EXISTS `branch_table` +( + `branch_id` BIGINT NOT NULL, + `xid` VARCHAR(128) NOT NULL, + `transaction_id` BIGINT, + `resource_group_id` VARCHAR(32), + `resource_id` VARCHAR(256), + `branch_type` VARCHAR(8), + `status` TINYINT, + `client_id` VARCHAR(64), + `application_data` VARCHAR(2000), + `gmt_create` DATETIME(6), + `gmt_modified` DATETIME(6), + PRIMARY KEY (`branch_id`), + KEY `idx_xid` (`xid`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4; + +-- the table to store lock data +CREATE TABLE IF NOT EXISTS `lock_table` +( + `row_key` VARCHAR(128) NOT NULL, + `xid` VARCHAR(128), + `transaction_id` BIGINT, + `branch_id` BIGINT NOT NULL, + `resource_id` VARCHAR(256), + `table_name` VARCHAR(32), + `pk` VARCHAR(36), + `status` TINYINT NOT NULL DEFAULT '0' COMMENT '0:locked ,1:rollbacking', + `gmt_create` DATETIME, + `gmt_modified` DATETIME, + PRIMARY KEY (`row_key`), + KEY `idx_status` (`status`), + KEY `idx_branch_id` (`branch_id`), + KEY `idx_xid` (`xid`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4; + +CREATE TABLE IF NOT EXISTS `distributed_lock` +( + `lock_key` CHAR(20) NOT NULL, + `lock_value` VARCHAR(20) NOT NULL, + `expire` BIGINT, + primary key (`lock_key`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4; + +INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('AsyncCommitting', ' ', 0); +INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryCommitting', ' ', 0); +INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('RetryRollbacking', ' ', 0); +INSERT INTO `distributed_lock` (lock_key, lock_value, expire) VALUES ('TxTimeoutCheck', ' ', 0); \ No newline at end of file diff --git a/seata/script/server/db/oracle.sql b/seata/script/server/db/oracle.sql new file mode 100644 index 000000000..462d6b892 --- /dev/null +++ b/seata/script/server/db/oracle.sql @@ -0,0 +1,72 @@ +-- -------------------------------- The script used when storeMode is 'db' -------------------------------- +-- the table to store GlobalSession data +CREATE TABLE global_table +( + xid VARCHAR2(128) NOT NULL, + transaction_id NUMBER(19), + status NUMBER(3) NOT NULL, + application_id VARCHAR2(32), + transaction_service_group VARCHAR2(32), + transaction_name VARCHAR2(128), + timeout NUMBER(10), + begin_time NUMBER(19), + application_data VARCHAR2(2000), + gmt_create TIMESTAMP(0), + gmt_modified TIMESTAMP(0), + PRIMARY KEY (xid) +); + +CREATE INDEX idx_status_gmt_modified ON global_table (status, gmt_modified); +CREATE INDEX idx_transaction_id ON global_table (transaction_id); + +-- the table to store BranchSession data +CREATE TABLE branch_table +( + branch_id NUMBER(19) NOT NULL, + xid VARCHAR2(128) NOT NULL, + transaction_id NUMBER(19), + resource_group_id VARCHAR2(32), + resource_id VARCHAR2(256), + branch_type VARCHAR2(8), + status NUMBER(3), + client_id VARCHAR2(64), + application_data VARCHAR2(2000), + gmt_create TIMESTAMP(6), + gmt_modified TIMESTAMP(6), + PRIMARY KEY (branch_id) +); + +CREATE INDEX idx_xid ON branch_table (xid); + +-- the table to store lock data +CREATE TABLE lock_table +( + row_key VARCHAR2(128) NOT NULL, + xid VARCHAR2(128), + transaction_id NUMBER(19), + branch_id NUMBER(19) NOT NULL, + resource_id VARCHAR2(256), + table_name VARCHAR2(32), + pk VARCHAR2(36), + status NUMBER(3) DEFAULT 0 NOT NULL, + gmt_create TIMESTAMP(0), + gmt_modified TIMESTAMP(0), + PRIMARY KEY (row_key) +); + +comment on column lock_table.status is '0:locked ,1:rollbacking'; +CREATE INDEX idx_branch_id ON lock_table (branch_id); +CREATE INDEX idx_lock_table_xid ON lock_table (xid); +CREATE INDEX idx_status ON lock_table (status); + +CREATE TABLE distributed_lock ( + lock_key VARCHAR2(20) NOT NULL, + lock_value VARCHAR2(20) NOT NULL, + expire DECIMAL(18) NOT NULL, + PRIMARY KEY (lock_key) +); + +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('AsyncCommitting', ' ', 0); +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('RetryCommitting', ' ', 0); +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('RetryRollbacking', ' ', 0); +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('TxTimeoutCheck', ' ', 0); diff --git a/seata/script/server/db/postgresql.sql b/seata/script/server/db/postgresql.sql new file mode 100644 index 000000000..f716f0dc6 --- /dev/null +++ b/seata/script/server/db/postgresql.sql @@ -0,0 +1,72 @@ +-- -------------------------------- The script used when storeMode is 'db' -------------------------------- +-- the table to store GlobalSession data +CREATE TABLE IF NOT EXISTS public.global_table +( + xid VARCHAR(128) NOT NULL, + transaction_id BIGINT, + status SMALLINT NOT NULL, + application_id VARCHAR(32), + transaction_service_group VARCHAR(32), + transaction_name VARCHAR(128), + timeout INT, + begin_time BIGINT, + application_data VARCHAR(2000), + gmt_create TIMESTAMP(0), + gmt_modified TIMESTAMP(0), + CONSTRAINT pk_global_table PRIMARY KEY (xid) +); + +CREATE INDEX idx_status_gmt_modified ON public.global_table (status, gmt_modified); +CREATE INDEX idx_transaction_id ON public.global_table (transaction_id); + +-- the table to store BranchSession data +CREATE TABLE IF NOT EXISTS public.branch_table +( + branch_id BIGINT NOT NULL, + xid VARCHAR(128) NOT NULL, + transaction_id BIGINT, + resource_group_id VARCHAR(32), + resource_id VARCHAR(256), + branch_type VARCHAR(8), + status SMALLINT, + client_id VARCHAR(64), + application_data VARCHAR(2000), + gmt_create TIMESTAMP(6), + gmt_modified TIMESTAMP(6), + CONSTRAINT pk_branch_table PRIMARY KEY (branch_id) +); + +CREATE INDEX idx_xid ON public.branch_table (xid); + +-- the table to store lock data +CREATE TABLE IF NOT EXISTS public.lock_table +( + row_key VARCHAR(128) NOT NULL, + xid VARCHAR(128), + transaction_id BIGINT, + branch_id BIGINT NOT NULL, + resource_id VARCHAR(256), + table_name VARCHAR(32), + pk VARCHAR(36), + status SMALLINT NOT NULL DEFAULT 0, + gmt_create TIMESTAMP(0), + gmt_modified TIMESTAMP(0), + CONSTRAINT pk_lock_table PRIMARY KEY (row_key) +); + +comment on column public.lock_table.status is '0:locked ,1:rollbacking'; +CREATE INDEX idx_branch_id ON public.lock_table (branch_id); +CREATE INDEX idx_xid ON public.lock_table (xid); +CREATE INDEX idx_status ON public.lock_table (status); + +CREATE TABLE distributed_lock ( + lock_key VARCHAR(20) NOT NULL, + lock_value VARCHAR(20) NOT NULL, + expire BIGINT NOT NULL, + CONSTRAINT pk_distributed_lock_table PRIMARY KEY (lock_key) +); + +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('AsyncCommitting', ' ', 0); +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('RetryCommitting', ' ', 0); +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('RetryRollbacking', ' ', 0); +INSERT INTO distributed_lock (lock_key, lock_value, expire) VALUES ('TxTimeoutCheck', ' ', 0); diff --git a/seata/script/server/db/sqlserver.sql b/seata/script/server/db/sqlserver.sql new file mode 100644 index 000000000..1ba15550b --- /dev/null +++ b/seata/script/server/db/sqlserver.sql @@ -0,0 +1,80 @@ +-- -------------------------------- The script used when storeMode is 'db' -------------------------------- +-- the table to store GlobalSession data +CREATE TABLE [global_table] +( + [xid] nvarchar(128) NOT NULL, + [transaction_id] bigint NULL, + [status] tinyint NOT NULL, + [application_id] nvarchar(32) NULL, + [transaction_service_group] nvarchar(32) NULL, + [transaction_name] nvarchar(128) NULL, + [timeout] int NULL, + [begin_time] bigint NULL, + [application_data] nvarchar(2000) NULL, + [gmt_create] datetime2 NULL, + [gmt_modified] datetime2 NULL, + PRIMARY KEY CLUSTERED ([xid]) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +) +GO + +CREATE NONCLUSTERED INDEX [idx_gmt_modified_status] + ON [global_table] ( + [gmt_modified], + [status] + ) +GO + +CREATE NONCLUSTERED INDEX [idx_transaction_id] + ON [global_table] ( + [transaction_id] + ) +GO + +-- the table to store BranchSession data +CREATE TABLE [branch_table] +( + [branch_id] bigint NOT NULL, + [xid] nvarchar(128) NOT NULL, + [transaction_id] bigint NULL, + [resource_group_id] nvarchar(32) NULL, + [resource_id] nvarchar(256) NULL, + [branch_type] varchar(8) NULL, + [status] tinyint NULL, + [client_id] nvarchar(64) NULL, + [application_data] nvarchar(2000) NULL, + [gmt_create] datetime2 NULL, + [gmt_modified] datetime2 NULL, + PRIMARY KEY CLUSTERED ([branch_id]) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +) +GO + +CREATE NONCLUSTERED INDEX [idx_xid] + ON [branch_table] ( + [xid] + ) +GO + +-- the table to store lock data +CREATE TABLE [lock_table] +( + [row_key] nvarchar(128) NOT NULL, + [xid] nvarchar(128) NULL, + [transaction_id] bigint NULL, + [branch_id] bigint NOT NULL, + [resource_id] nvarchar(256) NULL, + [table_name] nvarchar(32) NULL, + [pk] nvarchar(36) NULL, + [gmt_create] datetime2 NULL, + [gmt_modified] datetime2 NULL, + PRIMARY KEY CLUSTERED ([row_key]) + WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +) +GO + +CREATE NONCLUSTERED INDEX [idx_branch_id] + ON [lock_table] ( + [branch_id] + ) +GO diff --git a/seata/script/server/docker-compose/docker-compose.yaml b/seata/script/server/docker-compose/docker-compose.yaml new file mode 100644 index 000000000..e1791293c --- /dev/null +++ b/seata/script/server/docker-compose/docker-compose.yaml @@ -0,0 +1,10 @@ +version: "3" +services: + seata-server: + image: seataio/seata-server + hostname: seata-server + ports: + - "8091:8091" + environment: + - SEATA_PORT=8091 + - STORE_MODE=file \ No newline at end of file diff --git a/seata/script/server/helm/seata-server/.helmignore b/seata/script/server/helm/seata-server/.helmignore new file mode 100644 index 000000000..50af03172 --- /dev/null +++ b/seata/script/server/helm/seata-server/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/seata/script/server/helm/seata-server/Chart.yaml b/seata/script/server/helm/seata-server/Chart.yaml new file mode 100644 index 000000000..f282fc461 --- /dev/null +++ b/seata/script/server/helm/seata-server/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: Seata Server +name: seata-server +version: 1.0.0 diff --git a/seata/script/server/helm/seata-server/templates/NOTES.txt b/seata/script/server/helm/seata-server/templates/NOTES.txt new file mode 100644 index 000000000..ddc7f2eb9 --- /dev/null +++ b/seata/script/server/helm/seata-server/templates/NOTES.txt @@ -0,0 +1,15 @@ +1. Get the application URL by running these commands: +{{- if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "seata-server.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "seata-server.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "seata-server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "seata-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/seata/script/server/helm/seata-server/templates/_helpers.tpl b/seata/script/server/helm/seata-server/templates/_helpers.tpl new file mode 100644 index 000000000..7158c2c09 --- /dev/null +++ b/seata/script/server/helm/seata-server/templates/_helpers.tpl @@ -0,0 +1,56 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "seata-server.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "seata-server.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "seata-server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "seata-server.labels" -}} +app.kubernetes.io/name: {{ include "seata-server.name" . }} +helm.sh/chart: {{ include "seata-server.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "seata-server.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "seata-server.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/seata/script/server/helm/seata-server/templates/deployment.yaml b/seata/script/server/helm/seata-server/templates/deployment.yaml new file mode 100644 index 000000000..71af7c296 --- /dev/null +++ b/seata/script/server/helm/seata-server/templates/deployment.yaml @@ -0,0 +1,71 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: +{{- if .Values.namespace }} + namespace: {{ .Values.namespace }} +{{- end}} + name: {{ include "seata-server.name" . }} + labels: +{{ include "seata-server.labels" . | indent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "seata-server.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "seata-server.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8091 + protocol: TCP + {{- if .Values.volume }} + volumeMounts: + {{- range .Values.volume }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + {{- end}} + {{- end}} + {{- if .Values.env }} + env: + {{- if .Values.env.seataIp }} + - name: SEATA_IP + value: {{ .Values.env.seataIp | quote }} + {{- end }} + {{- if .Values.env.seataPort }} + - name: SEATA_PORT + value: {{ .Values.env.seataPort | quote }} + {{- end }} + {{- if .Values.env.seataEnv }} + - name: SEATA_ENV + value: {{ .Values.env.seataEnv }} + {{- end }} + {{- if .Values.env.seataConfigName }} + - name: SEATA_CONFIG_NAME + value: {{ .Values.env.seataConfigName }} + {{- end }} + {{- if .Values.env.serverNode }} + - name: SERVER_NODE + value: {{ .Values.env.serverNode | quote }} + {{- end }} + {{- if .Values.env.storeMode }} + - name: STORE_MODE + value: {{ .Values.env.storeMode }} + {{- end }} + {{- end }} + {{- if .Values.volume }} + volumes: + {{- range .Values.volume }} + - name: {{ .name }} + hostPath: + path: {{ .hostPath}} + {{- end}} + {{- end}} \ No newline at end of file diff --git a/seata/script/server/helm/seata-server/templates/service.yaml b/seata/script/server/helm/seata-server/templates/service.yaml new file mode 100644 index 000000000..812415b23 --- /dev/null +++ b/seata/script/server/helm/seata-server/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "seata-server.fullname" . }} + labels: +{{ include "seata-server.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ include "seata-server.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/seata/script/server/helm/seata-server/templates/tests/test-connection.yaml b/seata/script/server/helm/seata-server/templates/tests/test-connection.yaml new file mode 100644 index 000000000..97d699037 --- /dev/null +++ b/seata/script/server/helm/seata-server/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "seata-server.fullname" . }}-test-connection" + labels: +{{ include "seata-server.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "seata-server.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/seata/script/server/helm/seata-server/values.yaml b/seata/script/server/helm/seata-server/values.yaml new file mode 100644 index 000000000..9e88f9af0 --- /dev/null +++ b/seata/script/server/helm/seata-server/values.yaml @@ -0,0 +1,17 @@ +replicaCount: 1 + +namespace: default + +image: + repository: seataio/seata-server + tag: latest + pullPolicy: IfNotPresent + +service: + type: NodePort + port: 30091 + +env: + seataPort: "8091" + storeMode: "file" + serverNode: "1" \ No newline at end of file diff --git a/seata/script/server/kubernetes/seata-server.yaml b/seata/script/server/kubernetes/seata-server.yaml new file mode 100644 index 000000000..a5548ed1e --- /dev/null +++ b/seata/script/server/kubernetes/seata-server.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: Service +metadata: + name: seata-server + namespace: default + labels: + k8s-app: seata-server +spec: + type: NodePort + ports: + - port: 8091 + nodePort: 30091 + protocol: TCP + name: http + selector: + k8s-app: seata-server + +--- + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: seata-server + namespace: default + labels: + k8s-app: seata-server +spec: + replicas: 1 + selector: + matchLabels: + k8s-app: seata-server + template: + metadata: + labels: + k8s-app: seata-server + spec: + containers: + - name: seata-server + image: docker.io/seataio/seata-server:latest + imagePullPolicy: IfNotPresent + env: + - name: SEATA_PORT + value: "8091" + - name: STORE_MODE + value: file + ports: + - name: http + containerPort: 8091 + protocol: TCP \ No newline at end of file