• Stars
    star
    292
  • Rank 141,456 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Service Sync component

Nacos Sync

Example

Function

  • Console: provide API and console for management
  • Worker: provide the service registration synchronization.

Architecture

Architecture Topology

            +-------------+
     +----> |NacosClusterA|
     |      +-------------+               +-------------+
     |                                    |NacosClusterB|
Pull |                                    +--+----------+
Info |      +------------+                   ^
     |      |ZooKeeper   |                   |
     |      +--+---------+                   | Push Info
     |         ^ Pull Info                   |
     |         |                             |
     |        ++-----------------------------+--+
     <--------+  NacosSync1, NacosSync2,....    |
              +---+-------------------------+---+
                  |                         |
                  |                         |
                  |                         |
                  |       +---------+       |
                  +-----> |NacosSync| <-----+
                          |Database |
                          +---------+

Architecture HighLights

  • All registration information will be stored in NacosSync DB.
  • Multiple NacosSync instances will perform the same job.
    • Multiple NacosSync instances ensure high availability.
    • Multiple NacosSync instances performing the same job ensure the simplicity.
    • NacosCluster target will dedup the synchronization information from Nacos.

Quick Start:

NacosSync Migration User Guide

Support migration type

Source Target Support Note
Nacos Nacos Yes Only supports the same version of Nacos migration,especially the version of 0.8 migrates to 1.0 or above.
Nacos Zookeeper Yes Only support registery center of Dubbo
Nacos Consul Yes Only support registery center of Spring Cloud
Nacos Eureka Yes Only support registery center of Spring Cloud
Zookeeper Nacos Yes Only support registery center of Dubbo
Consul Nacos Yes Only support registery center of Spring Cloud
Eureka Nacos Yes Only support registery center of Spring Cloud

Manual Goal

  • Start the NacosSync service
  • Use a simple example to demonstrate how to migrate a Dubbo client registered in the Zookeeper Registry to the Nacos Registry

Prerequisites

Before you begin, install the following:

  • 64bit OS: Linux/Unix/Mac/Windows supported, Linux/Unix/Mac recommended.
  • 64bit JDK 1.8+: downloads, JAVA_HOME settings.
  • Maven 3.5.2+: downloads, settings.
  • MySql 5.6.+

Download & Build From Release

There are two ways to get NacosSync.

  • Download run package
  • Download source code from Github
cd nacos-sync/
mvn clean package -U

The path to the target file:

nacos-sync/nacossync-distribution/target/nacos-sync-0.4.8.tar.gz

After extracting the installation package, the directory structure:

nacos-sync
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ NOTICE
โ”œโ”€โ”€ bin
โ”‚ย ย  โ”œโ”€โ”€ nacosSync.sql
โ”‚ย ย  โ”œโ”€โ”€ shutdown.sh
โ”‚ย ย  โ””โ”€โ”€ startup.sh
โ”œโ”€โ”€ conf
โ”‚ย ย  โ”œโ”€โ”€ application.properties
โ”‚ย ย  โ””โ”€โ”€ logback-spring.xml
โ”œโ”€โ”€ logs
โ””โ”€โ”€ nacos-sync-server.jar

Initialize The DB

The default is Mysql database, which can support other relational databases

  • Build db schema, the default schema name nacos_sync.
  • Tables do not need to be created separately, which is conducive to hibernate's automatic table creation function.
  • If the automatic table creation fails, you can build the table nacosSync.sql, the table statement is in the bin folder.

DB Configuration

In the bin folder, application.properties:

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/nacos_sync?characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=root

Start Server

$ nacosSync/bin:
sh startup.sh  start

Admin Console

http://127.0.0.1:8083/#/serviceSync

More Repositories

1

nacos-docker

This project contains a Docker image meant to facilitate the deployment of Nacos .
Shell
1,405
star
2

nacos-sdk-go

Nacos client in Golang
Go
1,119
star
3

nacos-examples

Nacos Examples
Java
953
star
4

r-nacos

Nacos server re-implemented in Rust.
Rust
812
star
5

nacos-spring-boot-project

Nacos ECO Project for Spring Boot
Java
785
star
6

nacos-spring-project

Nacos ECO Project for Spring Framework
Java
755
star
7

nacos-k8s

This project contains a Nacos Docker image meant to facilitate the deployment of Nacos on Kubernetes using StatefulSets.
Go
595
star
8

nacos-sdk-csharp

This nacos csharp sdk
C#
420
star
9

nacos-sdk-python

nacos python sdk
Python
362
star
10

nacos-sdk-nodejs

nacos node.js sdk client
TypeScript
291
star
11

nacos-sdk-cpp

C++ client for Nacos
C++
125
star
12

nacos-sdk-rust

nacos client for rust
Rust
117
star
13

grpc-java-registry-nacos

gRPC Nacos registry integration
Java
97
star
14

nacos-group.github.io

nacos-group.github.io
MDX
97
star
15

nacos-plugin

A collection of Nacos plug-ins, providing Nacos with pluggable plug-in capabilities, support for user customization and high scalability
Java
91
star
16

nacos-coredns-plugin

Nacos DNS-F Client Based On CoreDNS
Go
83
star
17

nacos-template

nacos-template include PPT template and knote
70
star
18

nginx-nacos-upstream

nginx nacos module. subscribe service and configuration from nacos instead of modifying and reloading nginx.conf
C
61
star
19

nacos-confd

Go
40
star
20

nacos-istio

Nacos integrate with Istio as a MCP server
Go
38
star
21

nacos-controller

nacos k8s controller
Go
25
star
22

dubbo-registry-nacos

Dubbo Registry support for Nacos
14
star
23

nacos-k8s-sync

A component for sync services between Nacos and Kubernetes.
Go
12
star
24

nacos-sdk-lua

Lua
12
star
25

nacos-activity

The documents presented in nacos activities
11
star
26

nacos-sdk-php

PHP
11
star
27

nacos-ctl

The controller command sdk for nacos
Java
7
star
28

logback-adapter

Java
5
star
29

acm2nacos-spring-cloud-example

Java
4
star
30

nacos-tutorial

Nacos ็Ÿฅ่กŒๅฎž้ชŒไป“ๅบ“
2
star
31

acm2nacos-java-example

Java
2
star
32

apollo-2-nacos-migration

Apollo่ฟ็งปๅˆฐNacos็š„่„šๆœฌๅทฅ็จ‹
Java
1
star
33

nacos-logo

The logo files for nacos
1
star