Skip to content

Commit

Permalink
Merge pull request #303 from nacos-group/develop
Browse files Browse the repository at this point in the history
0.4.8
  • Loading branch information
paderlol committed Jul 30, 2022
2 parents f99398c + 0ffdca3 commit 384a9cc
Show file tree
Hide file tree
Showing 26 changed files with 911 additions and 576 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ target
node_modules
test/derby.log
/console-fe
.flattened-pom.xml
31 changes: 8 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Function

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

## Architecture

Expand Down Expand Up @@ -44,12 +44,6 @@ Info | +------------+ ^
- NacosCluster target will dedup the synchronization information from Nacos.








## Quick Start:
- Swagger API: http://127.0.0.1:8083/swagger-ui.html#/
- Web Console: http://127.0.0.1:8083/
Expand Down Expand Up @@ -84,7 +78,7 @@ 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.2.x+: downloads, settings.
- Maven 3.5.2+: [downloads](https://maven.apache.org/download.cgi), [settings](https://maven.apache.org/settings.html).
- MySql 5.6.+

## Download & Build From Release
Expand All @@ -96,7 +90,7 @@ There are two ways to get NacosSync.

``` xml

cd nacosSync/
cd nacos-sync/
mvn clean package -U

```
Expand All @@ -105,15 +99,15 @@ The path to the target file:

``` xml

nacos-sync/nacossync-distribution/target/nacosSync.0.3.8.zip
nacos-sync/nacossync-distribution/target/nacos-sync-0.4.8.tar.gz

```

After extracting the installation package, the directory structure:

``` xml

nacosSync
nacos-sync
├── LICENSE
├── NOTICE
├── bin
Expand All @@ -124,15 +118,15 @@ nacosSync
│   ├── application.properties
│   └── logback-spring.xml
├── logs
└── nacosSync-server.jar
└── 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.
- 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.

Expand Down Expand Up @@ -163,13 +157,4 @@ sh startup.sh start

http://127.0.0.1:8083/#/serviceSync

```









```
5 changes: 2 additions & 3 deletions nacossync-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>nacossync-parent</artifactId>
<groupId>com.alibaba.nacossync</groupId>
<version>0.4.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -27,5 +27,4 @@
<artifactId>junit</artifactId>
</dependency>
</dependencies>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Layout extends React.Component {
<Header />
<Row className="layout">
<Col fixedSpan="9" className="nav-bar">
<h1 className="title">Nacos-Sync 3.0</h1>
<h1 className="title">Nacos-Sync 0.4.8</h1>
<Menu />
</Col>
<Col className="main-panel">{this.props.children}</Col>
Expand Down
8 changes: 4 additions & 4 deletions nacossync-distribution/bin/shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

pid=`ps ax | grep -i 'nacosSync' |grep java | grep -v grep | awk '{print $1}'`
pid=`ps ax | grep -i 'nacos-sync' |grep java | grep -v grep | awk '{print $1}'`
if [ -z "$pid" ] ; then
echo "No nacosSync running."
echo "no nacos-sync running."
exit -1;
fi

echo "The nacosSync(${pid}) is running..."
echo "the nacos-sync(${pid}) is running..."

kill ${pid}

echo "Send shutdown request to nacosSync(${pid}) OK"
echo "Send shutdown request to nacos-sync(${pid}) OK"
2 changes: 1 addition & 1 deletion nacossync-distribution/bin/startup.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java -jar ../nacosSync-server.jar -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m --spring.config.location=../conf/application.properties
java -jar ../nacos-sync-server.jar -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m --spring.config.location=../conf/application.properties
20 changes: 10 additions & 10 deletions nacossync-distribution/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,24 @@ export BASE_DIR=`cd $(dirname $0)/..; pwd`


JAVA_OPT="${JAVA_OPT} -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m"
JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/nacossync_java_heapdump.hprof"
JAVA_OPT="${JAVA_OPT} -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/nacos-sync-java-heapdump.hprof"
JAVA_OPT="${JAVA_OPT} -XX:-UseLargePages"
JAVA_OPT="${JAVA_OPT} -Dspring.config.location=${BASE_DIR}/conf/application.properties"
JAVA_OPT="${JAVA_OPT} -DnacosSync.home=${BASE_DIR}"

JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([0-9]*).*$/\1/p')
if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then
JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${BASE_DIR}/logs/nacossync_gc.log:time,tags:filecount=10,filesize=102400"
JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${BASE_DIR}/logs/nacos-sync-gc.log:time,tags:filecount=10,filesize=102400"
else
JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/nacossync_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/nacos-sync-gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
fi

JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/nacosSync-server.jar"
JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/nacos-sync-server.jar"
JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/logback-spring.xml"

echo "=============JAVA_HOME:"$JAVA_HOME
echo "=============BASE_DIR:"$BASE_DIR
echo "=============JAVA:"$JAVA
echo "JAVA_HOME:"$JAVA_HOME
echo "BASE_DIR:"$BASE_DIR
echo "JAVA:"$JAVA


if [ ! -d "${BASE_DIR}/logs" ]; then
Expand All @@ -78,9 +78,9 @@ usage(){

start(){

echo "$JAVA ${JAVA_OPT}" > ${BASE_DIR}/logs/nacossync_start.out 2>&1 &
nohup $JAVA ${JAVA_OPT} >> ${BASE_DIR}/logs/nacossync_start.out 2>&1 &
echo "nacossync is starting,you can check the ${BASE_DIR}/logs/nacossync_start.out"
echo "$JAVA ${JAVA_OPT}" > ${BASE_DIR}/logs/nacos-sync-start.out 2>&1 &
nohup $JAVA ${JAVA_OPT} >> ${BASE_DIR}/logs/nacos-sync-start.out 2>&1 &
echo "nacos-sync is starting,you can check the ${BASE_DIR}/logs/nacos-sync-start.out"

}

Expand Down
6 changes: 3 additions & 3 deletions nacossync-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<parent>
<artifactId>nacossync-parent</artifactId>
<groupId>com.alibaba.nacossync</groupId>
<version>0.4.7</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<artifactId>nacossync-distribution</artifactId>

<build>
<finalName>nacosSync.${parent.version}</finalName>
<finalName>nacos-sync-${project.version}</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -35,4 +35,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
6 changes: 3 additions & 3 deletions nacossync-distribution/release-nacossync.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<id>bin</id>
<includeBaseDirectory>true</includeBaseDirectory>
<!-- file name after unzip -->
<baseDirectory>nacosSync</baseDirectory>
<baseDirectory>nacos-sync</baseDirectory>
<formats>
<format>dir</format>
<format>tar.gz</format>
Expand Down Expand Up @@ -60,9 +60,9 @@
<destName>NOTICE</destName>
</file>
<file>
<source>../nacossync-worker/target/nacosSync-server.${parent.version}.jar</source>
<source>../nacossync-worker/target/nacos-sync-server-${project.version}.jar</source>
<outputDirectory></outputDirectory>
<destName>nacosSync-server.jar</destName>
<destName>nacos-sync-server.jar</destName>
</file>
</files>
</assembly>
19 changes: 3 additions & 16 deletions nacossync-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,27 @@
<parent>
<artifactId>nacossync-parent</artifactId>
<groupId>com.alibaba.nacossync</groupId>
<version>0.4.7</version>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

<artifactId>nacossync-test</artifactId>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>

</dependency>

<dependency>
<groupId>com.alibaba.nacossync</groupId>
<groupId>${project.groupId}</groupId>
<artifactId>nacossync-worker</artifactId>
<version>0.4.7</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
Expand All @@ -57,25 +49,20 @@
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
<version>1.7.17</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<parallel>methods</parallel>
<useUnlimitedThreads>true</useUnlimitedThreads>
</configuration>
</plugin>
</plugins>
</build>


</project>
</project>
Loading

0 comments on commit 384a9cc

Please sign in to comment.