title | keywords | description | |||
---|---|---|---|---|---|
Nacos Registry Center |
|
Nacos Registry Center. |
Nacos is an important registry implementation in the Seata component.
Before integrating nacos-client
into your Seata project, make sure that the Nacos service is already running in the background. If you are not familiar with the basic usage of Nacos, you can refer to the Nacos Quick Start guide. It is recommended to use Nacos version 1.2.0
or above.
The steps to integrate Nacos registry into Seata are very simple and can be roughly divided into "adding Maven dependencies" and "configuring the registry".
First, you need to add the Maven dependency for nacos-client
to your project's pom.xml
file. It is recommended to use Seata 1.4.0+
:
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
<version>latest version</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
<version>1.2.0 or above</version>
</dependency>
Add the corresponding configuration to application.yml, and refer to other configuration options:
seata:
registry:
type: nacos
nacos:
application: seata-server
server-addr: 127.0.0.1:8848
group : "SEATA_GROUP"
namespace: ""
username: "nacos"
password: "nacos"
Add the corresponding configuration to registry.conf, and refer to other configuration options:
registry {
type = "nacos"
nacos {
application = "seata-server"
serverAddr = "127.0.0.1:8848"
group = "SEATA_GROUP"
namespace = ""
cluster = "default"
username = ""
password = ""
}
}
After that, when you start the Seata-Server, you will see the server's service appearing in the registry list on the Nacos console. Once the client is configured, you can start the application to experience the Seata service.
Tips: Make sure that the client and server are registered in the same namespace and group, otherwise the service will not be found.