Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: add en&cn docs for ZooKeeper registry #682

Merged
merged 26 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d0c2623
fix:add SEO for domainModel
ggbocoder Nov 4, 2023
45a3c71
format dependencies
ggbocoder Nov 4, 2023
36d2021
format dependencies
ggbocoder Nov 4, 2023
691d0ab
Merge remote-tracking branch 'upstream/docusaurus' into opt_zk_registry
ggbocoder Nov 23, 2023
d75d3a8
optimize: add en&cn docs for ZooKeeper registry
ggbocoder Nov 23, 2023
bb61799
Merge remote-tracking branch 'upstream/docusaurus' into opt_zk_registry
ggbocoder Nov 28, 2023
2b83ea6
distinguish configurations based on versions
ggbocoder Nov 28, 2023
b9078c0
Merge branch 'docusaurus' into opt_zk_registry
ggbocoder Nov 28, 2023
baf88ff
fix
ggbocoder Nov 28, 2023
16fda6b
Merge remote-tracking branch 'origin/opt_zk_registry' into opt_zk_reg…
ggbocoder Nov 28, 2023
c2d3ee1
Merge branch 'docusaurus' into opt_zk_registry
funky-eyes Nov 30, 2023
7b1a29e
Merge branch 'docusaurus' into opt_zk_registry
slievrly Dec 7, 2023
2715aeb
remove coupled logs
ggbocoder Dec 12, 2023
42f1acd
Merge remote-tracking branch 'origin/opt_zk_registry' into opt_zk_reg…
ggbocoder Dec 12, 2023
c9bd3df
Merge branch 'docusaurus' into opt_zk_registry
ggbocoder Dec 12, 2023
437fbb0
bugfix
ggbocoder Dec 12, 2023
579a5bf
Merge remote-tracking branch 'origin/opt_zk_registry' into opt_zk_reg…
ggbocoder Dec 12, 2023
62a1fda
Merge branch 'docusaurus' into opt_zk_registry
funky-eyes Dec 14, 2023
dd77d44
Merge branch 'docusaurus' into opt_zk_registry
ggbocoder Dec 14, 2023
4ef1af8
opt
ggbocoder Dec 14, 2023
70675fc
Merge remote-tracking branch 'origin/opt_zk_registry' into opt_zk_reg…
ggbocoder Dec 14, 2023
f90def1
bugfix
ggbocoder Dec 14, 2023
a913287
opt
ggbocoder Dec 14, 2023
a8465c5
opt
ggbocoder Dec 14, 2023
f305565
Merge branch 'docusaurus' into opt_zk_registry
funky-eyes Dec 15, 2023
9bde199
add transaction and cluster mapping for file.conf
ggbocoder Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,128 @@ title: Zookeeper Registry Center
keywords: [Seata, Zookeeper, Registry Center]
description: Zookeeper Registry Center.
---
# ZooKeeper Registry Center

# Zookeeper Registry
ZooKeeper serves as a critical registry center implementation within the Seata component.

Welcome to claim and supplement this document.
This document is based on Seata 2.0.0, demonstrating how to register Seata with ZooKeeper using a file as the configuration center.

It is recommended to use ZooKeeper version 3.4.13 or above. The following example uses ZooKeeper version 3.4.14.

## Prerequisites

Before registering **Seata** with ZooKeeper, ensure that the ZooKeeper service is running. If you are unfamiliar with basic ZooKeeper usage, you can refer to the [ZooKeeper official documentation](https://zookeeper.apache.org/doc/r3.4.14/index.html).

## Quick Start

Integrating Seata with ZooKeeper involves simple steps, roughly categorized as "Adding Maven Dependencies" and "Configuring the Registry Center."

### Server-side Registry Center Configuration

Download [Seata 2.0.0 release](https://github.com/seata/seata/releases/tag/v2.0.0) and extract the files.

Modify the corresponding configuration in `/conf/registry.conf`. For other configuration options, refer to the [Seata configuration reference](https://github.com/seata/seata/blob/develop/script/client/conf/registry.conf).

```yaml
seata:
registry:
type: zk
zk:
cluster: default
server-addr: 127.0.0.1:2181
session-timeout: 6000
connect-timeout: 2000
username: ""
password: ""
```

Execute `/bin/seata-server.bat` (Windows) or `/bin/seata-server.sh` (Unix) to start Seata. The service will run on the local port 8091. Open the ZooKeeper command-line client and enter `ls /registry/zk/default`, check if the node address is listed, indicating successful registration (as shown below).

```
[zk: localhost:2181(CONNECTED) 1] ls /registry/zk/default
[127.0.0.1:8091]
```

### Client-side Maven Dependency

**For a Spring Boot project, add the following dependencies to your `pom.xml` file.**

It is recommended to use the latest version of Seata. Refer to the [version compatibility](https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明) between `spring-cloud-starter-alibaba-seata` and the corresponding microservices version.

```xml
<!-- Seata -->
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>${seata.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
<version>${alibaba.cloud.version}</version>
<exclusions>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- ZooKeeper client dependency -->
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>0.11</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.5.9</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
```

### Client-side Configuration

Add the following configuration to `application.yml`. For other configuration options, refer to the [Seata Spring configuration reference](https://github.com/seata/seata/blob/develop/script/client/spring/application.yml).

```yaml
seata:
registry:
type: zk
zk:
server-addr: 127.0.0.1:2181
session-timeout: 6000
connect-timeout: 2000
username:
password:
tx-service-group: default_tx_group
service:
vgroup-mapping:
default_tx_group: default
```

After configuring the client, start the application and wait for a moment. Once the following logs appear, the Seata service is operational.

```
textCopy coderegister TM success. client version:2.0.0, server version:2.0.0,channel:[id: 0xa4675e28, L:/127.0.0.1:8238 - R:/127.0.0.1:8091]
register RM success. client version:2.0.0, server version:2.0.0,channel:[id: 0x408192d3, L:/127.0.0.1:8237 - R:/127.0.0.1:8091]
register success, cost 94 ms, version:2.0.0,role:RMROLE,channel:[id: 0x408192d3, L:/127.0.0.1:8237 - R:/127.0.0.1:8091]
register success, cost 94 ms, version:2.0.0,role:TMROLE,channel:[id: 0xa4675e28, L:/127.0.0.
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,124 @@ title: Zookeeper Registry Center
keywords: [Seata, Zookeeper, Registry Center]
description: Zookeeper Registry Center.
---
# ZooKeeper Registry Center

# Zookeeper Registry
ZooKeeper serves as a critical registry center implementation within the Seata component.

Welcome to claim and supplement this document.
This document is based on Seata 1.0.0, demonstrating how to register Seata with ZooKeeper using a file as the configuration center.

It is recommended to use ZooKeeper version 3.4.13 or above. The following example uses ZooKeeper version 3.4.14.

## Prerequisites

Before registering **Seata** with ZooKeeper, ensure that the ZooKeeper service is running. If you are unfamiliar with basic ZooKeeper usage, you can refer to the [ZooKeeper official documentation](https://zookeeper.apache.org/doc/r3.4.14/index.html).

## Quick Start

Integrating Seata with ZooKeeper involves simple steps, roughly categorized as "Adding Maven Dependencies" and "Configuring the Registry Center."

### Server-side Registry Center Configuration

Download [Seata 1.0.0 release](https://github.com/seata/seata/releases/tag/v1.0.0) and extract the files.

Modify the corresponding configuration in `/conf/registry.conf`. For other configuration options, refer to the [Seata configuration reference](https://github.com/seata/seata/blob/develop/script/client/conf/registry.conf).

```
registry {
type = "zk"

zk {
# Cluster name registered on ZooKeeper, default is "default"
cluster = "default"
serverAddr = "127.0.0.1:2181"
sessionTimeout = 6000
connectTimeout = 2000
}
}
```

Execute `/bin/seata-server.bat` (Windows) or `/bin/seata-server.sh` (Unix) to start Seata. The service will run on the local port 8091. Open the ZooKeeper command-line client and enter `ls /registry/zk/default`, check if the node address is listed, indicating successful registration (as shown below).

```
[zk: localhost:2181(CONNECTED) 1] ls /registry/zk/default
[127.0.0.1:8091]
```

### Client-side Maven Dependency

**For a Spring Boot project, add the following dependencies to your `pom.xml` file.**

It is recommended to use the latest version of Seata. Refer to the [version compatibility](https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明) between `spring-cloud-starter-alibaba-seata` and the corresponding microservices version.

```xml
<!-- Seata -->
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>${seata.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
<version>${alibaba.cloud.version}</version>
<exclusions>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- ZooKeeper client dependency -->
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>0.11</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.5.9</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
```

### Client-side Configuration

Add the following configuration to `application.yml`. For other configuration options, refer to the [Seata Spring configuration reference](https://github.com/seata/seata/blob/develop/script/client/spring/application.yml).

```
seata:
registry:
type: zk
zk:
cluster: default
server-addr: 127.0.0.1:2181
session-timeout: 6000
connect-timeout: 2000
```

After configuring the client, start the application and wait for a moment. Once the following logs appear, the Seata service is operational.

```
register TM success. client version:1.0.0, server version:1.0.0,channel:[id: 0xa4675e28, L:/127.0.0.1:8238 - R:/127.0.0.1:8091]
register RM success. client version:1.0.0, server version:1.0.0,channel:[id: 0x408192d3, L:/127.0.0.1:8237 - R:/127.0.0.1:8091]
register success, cost 94 ms, version:1.0.0,role:RMROLE,channel:[id: 0x408192d3, L:/127.0.0.1:8237 - R:/127.0.0.1:8091]
register success, cost 94 ms, version:1.0.0,role:TMROLE,channel:[id: 0xa4675e28, L:/127.0.0.
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,126 @@ title: Zookeeper Registry Center
keywords: [Seata, Zookeeper, Registry Center]
description: Zookeeper Registry Center.
---
# ZooKeeper Registry Center

# Zookeeper Registry
ZooKeeper serves as a critical registry center implementation within the Seata component.

Welcome to claim and supplement this document.
This document is based on Seata 1.1.0, demonstrating how to register Seata with ZooKeeper using a file as the configuration center.

It is recommended to use ZooKeeper version 3.4.13 or above. The following example uses ZooKeeper version 3.4.14.

## Prerequisites

Before registering **Seata** with ZooKeeper, ensure that the ZooKeeper service is running. If you are unfamiliar with basic ZooKeeper usage, you can refer to the [ZooKeeper official documentation](https://zookeeper.apache.org/doc/r3.4.14/index.html).

## Quick Start

Integrating Seata with ZooKeeper involves simple steps, roughly categorized as "Adding Maven Dependencies" and "Configuring the Registry Center."

### Server-side Registry Center Configuration

Download [Seata 1.1.0 release](https://github.com/seata/seata/releases/tag/v1.1.0) and extract the files.

Modify the corresponding configuration in `/conf/registry.conf`. For other configuration options, refer to the [Seata configuration reference](https://github.com/seata/seata/blob/develop/script/client/conf/registry.conf).

```
registry {
type = "zk"

zk {
# Cluster name registered on ZooKeeper, default is "default"
cluster = "default"
serverAddr = "127.0.0.1:2181"
sessionTimeout = 6000
connectTimeout = 2000
}
}
```

Execute `/bin/seata-server.bat` (Windows) or `/bin/seata-server.sh` (Unix) to start Seata. The service will run on the local port 8091. Open the ZooKeeper command-line client and enter `ls /registry/zk/default`, check if the node address is listed, indicating successful registration (as shown below).

```
[zk: localhost:2181(CONNECTED) 1] ls /registry/zk/default
[127.0.0.1:8091]
```

### Client-side Maven Dependency

**For a Spring Boot project, add the following dependencies to your `pom.xml` file.**

It is recommended to use the latest version of Seata. Refer to the [version compatibility](https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明) between `spring-cloud-starter-alibaba-seata` and the corresponding microservices version.

```xml
<!-- Seata -->
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>${seata.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>
<version>${alibaba.cloud.version}</version>
<exclusions>
<exclusion>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- ZooKeeper client dependency -->
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>0.11</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.5.9</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
```

### Client-side Configuration

Add the following configuration to `application.yml`. For other configuration options, refer to the [Seata Spring configuration reference](https://github.com/seata/seata/blob/develop/script/client/spring/application.yml).

```
seata:
registry:
type: zk
zk:
cluster: default
server-addr: 127.0.0.1:2181
session-timeout: 6000
connect-timeout: 2000
username:
password:
```

After configuring the client, start the application and wait for a moment. Once the following logs appear, the Seata service is operational.

```
register TM success. client version:1.1.0, server version:1.1.0,channel:[id: 0xa4675e28, L:/127.0.0.1:8238 - R:/127.0.0.1:8091]
register RM success. client version:1.1.0, server version:1.1.0,channel:[id: 0x408192d3, L:/127.0.0.1:8237 - R:/127.0.0.1:8091]
register success, cost 94 ms, version:1.1.0,role:RMROLE,channel:[id: 0x408192d3, L:/127.0.0.1:8237 - R:/127.0.0.1:8091]
register success, cost 94 ms, version:1.1.0,role:TMROLE,channel:[id: 0xa4675e28, L:/127.0.0.
```
Loading
Loading