Browse Source

doc: add seata server startup docker compose file (#172)

doc: add seata server startup docker composer file
tags/v0.1.0-rc1
Yuecai Liu GitHub 3 years ago
parent
commit
2569cf79bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 111 additions and 38 deletions
  1. +7
    -1
      README.md
  2. +7
    -1
      README_ZH.md
  3. +1
    -1
      pkg/rm/rm_remoting.go
  4. +33
    -0
      sample/dockercompose/docker-compose.yml
  5. +30
    -0
      sample/dockercompose/docker-health-check.sh
  6. +16
    -17
      sample/tcc/dubbo/client/conf/dubbogo.yml
  7. +16
    -17
      sample/tcc/dubbo/server/conf/dubbogo.yml
  8. +1
    -1
      sample/tcc/dubbo/server/service/user_provider.go

+ 7
- 1
README.md View File

@@ -32,7 +32,13 @@ The principle of seata-go is consistent with that of Seata-java, which is compos

## How to run?

1. First download [**seata java**](https://github.com/seata/seata/tree/v1.5.2) and Start the TC service. For the specific process, refer to [**seata deployment guide**](https://seata.io/zh-cn/docs/ops/deploy-guide-beginner.ht ) Documentation
1. Start the seata-server service with the docker file under the sample/dockercomposer folder

~~~shell
cd sample/dockercompose
docker-compose -f docker-compose.yml up -d seata-server
~~~

2. Just execute the main function under samples/ in the root directory




+ 7
- 1
README_ZH.md View File

@@ -32,7 +32,13 @@ Seata-go 的原理和 Seata-java 保持一致,都是由 TM、RM 和 TC 组成

## 如何运行项目?

1. 首先下载 [**Seata Java**](https://github.com/seata/seata/tree/v1.5.2) 的源码,启动 TC 服务即可,具体流程参考 **[Seata部署指南](https://seata.io/zh-cn/docs/ops/deploy-guide-beginner.ht)**文档
1. 用 sample/dockercomposer 文件夹下的 docker 文件启动 seata-server 服务

~~~shell
cd sample/dockercompose
docker-compose -f docker-compose.yml up -d seata-server
~~~

2. 执行根目录下的 samples/ 下的 main 函数即可




+ 1
- 1
pkg/rm/rm_remoting.go View File

@@ -86,7 +86,7 @@ func (r *RMRemoting) RegisterResource(resource Resource) error {
req := message.RegisterRMRequest{
AbstractIdentifyRequest: message.AbstractIdentifyRequest{
//todo replace with config
Version: "1.4.2",
Version: "1.5.2",
ApplicationId: "tcc-sample",
TransactionServiceGroup: "my_test_tx_group",
},


+ 33
- 0
sample/dockercompose/docker-compose.yml View File

@@ -0,0 +1,33 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

version: '3'
services:
seata-server:
image: seataio/seata-server:1.5.2
ports:
- "8091:8091"
- "7091:7091"
environment:
- SEATA_PORT=8091
- STORE_MODE=file

zookeeper:
image: zookeeper
ports:
- "2181:2181"
restart: on-failure

+ 30
- 0
sample/dockercompose/docker-health-check.sh View File

@@ -0,0 +1,30 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

curl 127.0.0.1:7091
res=$?
passCode=52
while [ "$res" != "$passCode" ];do
sleep 5
curl 127.0.0.1:7091
res=$?
done

sleep 5
curl http://127.0.0.1:7091
sleep 10


+ 16
- 17
sample/tcc/dubbo/client/conf/dubbogo.yml View File

@@ -1,22 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

# dubbo client yaml configure file

dubbo:
registries:
demoZK:


+ 16
- 17
sample/tcc/dubbo/server/conf/dubbogo.yml View File

@@ -1,22 +1,21 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#

# dubbo server yaml configure file

dubbo:
registries:
demoZK:


+ 1
- 1
sample/tcc/dubbo/server/service/user_provider.go View File

@@ -44,5 +44,5 @@ func (t *UserProvider) Rollback(ctx context.Context, businessActionContext *tm.B

func (t *UserProvider) GetActionName() string {
logger.Infof("GetActionName result")
return "TwoPhaseDemoService2"
return "TwoPhaseDemoService"
}

Loading…
Cancel
Save