From c01ac876b992290a3d1936839f2e3207c8d23347 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 6 Dec 2023 22:50:03 +0800 Subject: [PATCH 1/4] rename the init.h2.sql to avoid loading wrong files in quick start mode (#5034) ## What's the purpose of this PR rename the init.h2.sql to avoid loading wrong files in quick start mode ## Which issue(s) this PR fixes: Fixes #5033 ## Brief changelog add database prefix to the init.h2.sql files. --- .../ctrip/framework/apollo/biz/service/BizDBPropertySource.java | 2 +- .../main/resources/jpa/{init.h2.sql => configdb.init.h2.sql} | 0 .../framework/apollo/portal/service/PortalDBPropertySource.java | 2 +- .../main/resources/jpa/{init.h2.sql => portaldb.init.h2.sql} | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename apollo-configservice/src/main/resources/jpa/{init.h2.sql => configdb.init.h2.sql} (100%) rename apollo-portal/src/main/resources/jpa/{init.h2.sql => portaldb.init.h2.sql} (100%) diff --git a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/BizDBPropertySource.java b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/BizDBPropertySource.java index 17128cd51bf..43190b06edb 100644 --- a/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/BizDBPropertySource.java +++ b/apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/BizDBPropertySource.java @@ -67,7 +67,7 @@ public BizDBPropertySource(final ServerConfigRepository serverConfigRepository, @PostConstruct public void runSqlScript() throws Exception { if (env.acceptsProfiles(Profiles.of("h2"))) { - Resource resource = new ClassPathResource("jpa/init.h2.sql"); + Resource resource = new ClassPathResource("jpa/configdb.init.h2.sql"); if (resource.exists()) { DatabasePopulatorUtils.execute(new ResourceDatabasePopulator(resource), dataSource); } diff --git a/apollo-configservice/src/main/resources/jpa/init.h2.sql b/apollo-configservice/src/main/resources/jpa/configdb.init.h2.sql similarity index 100% rename from apollo-configservice/src/main/resources/jpa/init.h2.sql rename to apollo-configservice/src/main/resources/jpa/configdb.init.h2.sql diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalDBPropertySource.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalDBPropertySource.java index b5431bcb1e6..664e6b37e5b 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalDBPropertySource.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/PortalDBPropertySource.java @@ -63,7 +63,7 @@ public PortalDBPropertySource(final ServerConfigRepository serverConfigRepositor @PostConstruct public void runSqlScript() throws Exception { if (env.acceptsProfiles(Profiles.of("h2"))) { - Resource resource = new ClassPathResource("jpa/init.h2.sql"); + Resource resource = new ClassPathResource("jpa/portaldb.init.h2.sql"); if (resource.exists()) { DatabasePopulatorUtils.execute(new ResourceDatabasePopulator(resource), dataSource); } diff --git a/apollo-portal/src/main/resources/jpa/init.h2.sql b/apollo-portal/src/main/resources/jpa/portaldb.init.h2.sql similarity index 100% rename from apollo-portal/src/main/resources/jpa/init.h2.sql rename to apollo-portal/src/main/resources/jpa/portaldb.init.h2.sql From 01b02325d1def997c1b80831c0e0ac4c262e1390 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Fri, 8 Dec 2023 08:42:06 +0800 Subject: [PATCH 2/4] upgrade apollo-java version to 2.2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index badd45cb17a..fa01532d798 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 2.2.0-SNAPSHOT 1.8 UTF-8 - 2.2.0-SNAPSHOT + 2.2.0 2.7.11 2021.0.5 From 06fcb2afa2e362a37820333176f96e867661ec96 Mon Sep 17 00:00:00 2001 From: nobodyiam Date: Sun, 10 Dec 2023 18:24:21 +0800 Subject: [PATCH 3/4] some misc fix --- .../src/main/resources/apollo-adminservice.conf | 4 ++-- .../src/main/resources/apollo-configservice.conf | 4 ++-- apollo-portal/src/assembly/assembly-descriptor.xml | 1 + apollo-portal/src/main/resources/apollo-portal.conf | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apollo-adminservice/src/main/resources/apollo-adminservice.conf b/apollo-adminservice/src/main/resources/apollo-adminservice.conf index 563cd74ccf4..f5c2eeaf51c 100644 --- a/apollo-adminservice/src/main/resources/apollo-adminservice.conf +++ b/apollo-adminservice/src/main/resources/apollo-adminservice.conf @@ -2,7 +2,7 @@ MODE=service PID_FOLDER=. # console appender log file folder LOG_FOLDER=/opt/logs/ -# console appender file name -LOG_FILENAME=console.log +# console appender log file name +LOG_FILENAME=apollo-adminservice.console.log # write application logs only to file appender export LOG_APPENDERS=FILE \ No newline at end of file diff --git a/apollo-configservice/src/main/resources/apollo-configservice.conf b/apollo-configservice/src/main/resources/apollo-configservice.conf index a84d9189626..90d87652755 100644 --- a/apollo-configservice/src/main/resources/apollo-configservice.conf +++ b/apollo-configservice/src/main/resources/apollo-configservice.conf @@ -1,8 +1,8 @@ MODE=service PID_FOLDER=. # console appender log file folder -LOG_FOLDER=/opt/logs/100003171/ +LOG_FOLDER=/opt/logs/ # console appender log file name -LOG_FILENAME=console.log +LOG_FILENAME=apollo-configservice.console.log # write application logs only to file appender export LOG_APPENDERS=FILE \ No newline at end of file diff --git a/apollo-portal/src/assembly/assembly-descriptor.xml b/apollo-portal/src/assembly/assembly-descriptor.xml index b2c1aae3c17..992df9247b1 100644 --- a/apollo-portal/src/assembly/assembly-descriptor.xml +++ b/apollo-portal/src/assembly/assembly-descriptor.xml @@ -48,6 +48,7 @@ application-github.properties apollo-env.properties + application.properties diff --git a/apollo-portal/src/main/resources/apollo-portal.conf b/apollo-portal/src/main/resources/apollo-portal.conf index 19d4b8ea0be..2a2dd96e564 100644 --- a/apollo-portal/src/main/resources/apollo-portal.conf +++ b/apollo-portal/src/main/resources/apollo-portal.conf @@ -1,8 +1,8 @@ MODE=service PID_FOLDER=. # console appender log file folder -LOG_FOLDER=/opt/logs/100003173/ +LOG_FOLDER=/opt/logs/ # console appender log file name -LOG_FILENAME=console.log +LOG_FILENAME=apollo-portal.console.log # write application logs only to file appender export LOG_APPENDERS=FILE \ No newline at end of file From ee1517be717283ae5bbb990fd2c5a809bd841b4b Mon Sep 17 00:00:00 2001 From: Jason Song Date: Sun, 10 Dec 2023 19:06:26 +0800 Subject: [PATCH 4/4] bump version to 2.2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa01532d798..ebe65d5eb4c 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ - 2.2.0-SNAPSHOT + 2.2.0 1.8 UTF-8 2.2.0