@ -6,9 +6,9 @@ This project demonstrates how to use Spring Cloud Alibaba Nacos related Starters
[Nacos](https://github.com/alibaba/Nacos) It is Alibaba's open source dynamic service discovery, configuration management and service management platform that is easier to build cloud-native applications.
## Nacos Server 2.3.2 is properly configured and started
## Nacos Server 2.4.2 is properly configured and started
In Nacos 2.3.2, functions related to user authentication are added. When starting Nacos Server for the first time, it needs to be configured correctly to avoid the problem of startup failure.
In Nacos 2.4.2, functions related to user authentication are added. When starting Nacos Server for the first time, it needs to be configured correctly to avoid the problem of startup failure.
### Download Nacos Server
@ -49,7 +49,7 @@ db.pool.config.minimumIdle=2
#### Turn on authentication
**Note: If it is not enabled, login failure exception will occur in 2.3.2!**
**Note: If it is not enabled, login failure exception will occur in 2.4.2!**
```properties
### The auth system to use, currently only 'nacos' and 'ldap' is supported:
Authentication is required when using the Open api interface in nacos server 2.3.2: For more details, please refer to: [Nacos api authentication](https://nacos.io/zh-cn/docs/auth.html)
Authentication is required when using the Open api interface in nacos server 2.4.2: For more details, please refer to: [Nacos api authentication](https://nacos.io/zh-cn/docs/auth.html)
1. Obtain accessToken: Use username and password to log in to the nacos server:
#### Import the database tables required by the seata-server db schema
Initializing [global_table、branch_table、lock_table、distributed_lock](https://github.com/seata/seata/blob/2.0.0/script/server/db/mysql.sql) in the database
Initializing [global_table、branch_table、lock_table、distributed_lock](https://github.com/seata/seata/blob/2.1.0/script/server/db/mysql.sql) in the database
```sql
-- -------------------------------- The script used when storeMode is 'db' --------------------------------
@ -162,9 +162,9 @@ CREATE TABLE `account_tbl` (
### 2. Configure Nacos
> Spring Cloud Alibaba is adapted with Nacos 2.3.2. In this example, Nacos 2.3.2 is used as the configuration center component of Seata.
> Spring Cloud Alibaba is adapted with Nacos 2.4.2. In this example, Nacos 2.4.2 is used as the configuration center component of Seata.
Create Nacos configuration for Seata: data-id: `seata.properties`, Group: `SEATA_GROUP` (default grouping for seata 2.0.0), import
Create Nacos configuration for Seata: data-id: `seata.properties`, Group: `SEATA_GROUP` (default grouping for seata 2.1.0), import
Add the following configuration items required in the application example to the `seata.properties` configuration file: [事务群组配置](https://seata.io/zh-cn/docs/user/configurations.html)
@ -181,11 +181,11 @@ Add the following configuration items required in the application example to the
Modify `seata-server-2.0.0\conf\application.yml` the following configuration items in the configuration file:
Modify `seata-server-2.1.0\conf\application.yml` the following configuration items in the configuration file:
- Comment `group: SEATA_GROUP`
- Add Nacos username and password
@ -220,7 +220,7 @@ seata:
```
> **Notice**
> Nacos 2.3.2 enables authentication. Configuration `username` and `password` properties are required, otherwise login fails. For more Nacos 2.3.2 related configurations, refer to `nacos-example`.
> Nacos 2.4.2 enables authentication. Configuration `username` and `password` properties are required, otherwise login fails. For more Nacos 2.4.2 related configurations, refer to `nacos-example`.
> **The Nacos service registration group when seata-server is started must be consistent with the group in the sample application, otherwise an error that seata-server cannot be found will occur!**
> For more information about the configuration of Seata-server with Nacos as the configuration center, please refer to https://seata.io/zh-cn/docs/ops/deploy-by-docker-compose/#nacos-db.