Updated on 2025-08-29 GMT+08:00

Deploying the Nacos Sync Component

Procedure

  1. Obtain the Nacos Sync deployment package.

    Download nacos-sync-0.4.8.tar.gz.

  2. Create the database and table required by Nacos Sync.

    1. Create a database instance. For details, see Buying an RDS for MySQL DB Instance.
    2. Connect to the MySQL instance. For details, see Instance Connection.
    3. Create a database. Set the name to nacos_sync and the character set to utf8mb4. For details, see Creating a Database.
    4. Decompress the nacos-sync-0.4.8.tar.gz package to obtain the nacosSync.sql file in the nacos-sync/bin/ directory and execute the file. For details, see Executing SQL Statements. After the execution, three tables are generated.
      cluster #Cluster information
      task #Synchronization task information
      system_config #System configuration information

  3. Deploy Nacos Sync on the ECS.

    1. Log in to the ECS. For details, see Logging In to a Linux ECS.
    2. Upload the obtained package to the /tmp/ directory on the ECS.
    3. In the directory where the compressed package is stored, decompress the package to the current folder.

      cd /tmp/

      tar -zxvf nacos-sync-0.4.8.tar.gz

    4. Modify the database information in the application.properties configuration file.

      cd nacos-sync/conf

      vi application.properties

      Change the database connection information in the file to the database information created in 2 and save the file.
      spring.datasource.url=jdbc:mysql://127.0.0.1:3306/nacos_sync?characterEncoding=utf8   # Change the value to the IP address of the requested database and the information about the self-created database.
      spring.datasource.username=root   # Database username.
      spring.datasource.password=xxxxxx   # Database password.
    5. Start the Nacos Sync service.

      cd ..

      cd bin/

      sh startup.sh start

      The log path is nacos-sync/logs. You can check whether any exception information exists.

      You can modify the JAVA_OPT parameter in the startup.sh file to customize the JVM heap memory size.

    6. Access the Nacos Sync service address.

      The access link is in the format of IP address+port number. The IP address is the EIP bound to the ECS, and the port number is the port number configured in the application.properties file.