From 44a2e1430759388b5de1fed1fb1b624723d0406e Mon Sep 17 00:00:00 2001 From: Yiming Liu Date: Thu, 24 Mar 2016 14:59:41 +0800 Subject: [PATCH] Update default port --- .../src/main/resources/application.yml | 4 +- .../src/main/resources/bootstrap.yml | 2 +- .../src/main/resources/application.properties | 3 +- apollo-configservice/pom.xml | 62 ++++++++++++++----- .../com/ctrip/apollo/ServerApplication.java | 9 ++- .../src/main/resources/application.yml | 4 +- .../src/main/resources/bootstrap.yml | 3 +- .../ctrip/apollo/core/MetaDomainConsts.java | 24 ++++--- .../src/main/resources/application.yml | 7 ++- 9 files changed, 85 insertions(+), 33 deletions(-) diff --git a/apollo-adminservice/src/main/resources/application.yml b/apollo-adminservice/src/main/resources/application.yml index 4063c807f..dc8ace4b4 100644 --- a/apollo-adminservice/src/main/resources/application.yml +++ b/apollo-adminservice/src/main/resources/application.yml @@ -3,12 +3,12 @@ spring: name: apollo-adminservice server: - port: ${port:23646} + port: ${port:8090} logging: level: org.springframework.cloud: 'DEBUG' - file: /opt/logs/apollo-adminservice.log + file: /opt/logs/${ctrip.appid}/apollo-adminservice.log ctrip: appid: 100003172 diff --git a/apollo-adminservice/src/main/resources/bootstrap.yml b/apollo-adminservice/src/main/resources/bootstrap.yml index 336b8b648..1db163b32 100644 --- a/apollo-adminservice/src/main/resources/bootstrap.yml +++ b/apollo-adminservice/src/main/resources/bootstrap.yml @@ -3,6 +3,6 @@ eureka: hostname: ${hostname:localhost} client: serviceUrl: - defaultZone: http://${eureka.instance.hostname}/eureka/ + defaultZone: http://${eureka.instance.hostname}:8080/eureka/ healthcheck: enabled: true \ No newline at end of file diff --git a/apollo-biz/src/main/resources/application.properties b/apollo-biz/src/main/resources/application.properties index 9008c7c62..8eb955559 100644 --- a/apollo-biz/src/main/resources/application.properties +++ b/apollo-biz/src/main/resources/application.properties @@ -2,4 +2,5 @@ spring.datasource.url = jdbc:h2:mem:~/fxapolloconfigdb;mode=mysql spring.datasource.username = sa spring.datasource.password = spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.EJB3NamingStrategy -spring.h2.console.enabled = true \ No newline at end of file +spring.h2.console.enabled = true +spring.h2.console.settings.web-allow-others=true \ No newline at end of file diff --git a/apollo-configservice/pom.xml b/apollo-configservice/pom.xml index 85986283d..e97efc360 100644 --- a/apollo-configservice/pom.xml +++ b/apollo-configservice/pom.xml @@ -11,34 +11,68 @@ apollo-configservice Apollo ConfigService - + com.ctrip.apollo apollo-biz - - - - org.springframework.data - spring-data-redis - - - redis.clients - jedis - - - + + + + + org.springframework.cloud spring-cloud-starter-eureka-server + + + + spring-cloud-starter-archaius + + org.springframework.cloud + + + spring-cloud-starter-ribbon + org.springframework.cloud + + + ribbon-eureka + com.netflix.ribbon + + + aws-java-sdk-core + com.amazonaws + + + aws-java-sdk-ec2 + com.amazonaws + + + aws-java-sdk-autoscaling + com.amazonaws + + + aws-java-sdk-sts + com.amazonaws + + + aws-java-sdk-route53 + com.amazonaws + + - + org.springframework.boot spring-boot-maven-plugin + + true + diff --git a/apollo-configservice/src/main/java/com/ctrip/apollo/ServerApplication.java b/apollo-configservice/src/main/java/com/ctrip/apollo/ServerApplication.java index 0a09ab01e..82b626df3 100644 --- a/apollo-configservice/src/main/java/com/ctrip/apollo/ServerApplication.java +++ b/apollo-configservice/src/main/java/com/ctrip/apollo/ServerApplication.java @@ -7,13 +7,16 @@ import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * Spring boot application entry point + * * @author Jason Song(song_s@ctrip.com) */ @SpringBootApplication @EnableEurekaServer @EnableEurekaClient public class ServerApplication { - public static void main(String[] args) { - new SpringApplicationBuilder(ServerApplication.class).web(true).run(args); - } + + public static void main(String[] args) { + new SpringApplicationBuilder(ServerApplication.class).web(true).run(args); + } + } diff --git a/apollo-configservice/src/main/resources/application.yml b/apollo-configservice/src/main/resources/application.yml index 34033d340..405fe3057 100644 --- a/apollo-configservice/src/main/resources/application.yml +++ b/apollo-configservice/src/main/resources/application.yml @@ -3,12 +3,12 @@ spring: name: apollo-configservice server: - port: ${port:2756} + port: ${port:8080} logging: level: org.springframework.cloud: 'DEBUG' - file: /opt/logs/apollo-configservice.log + file: /opt/logs/${ctrip.appid}/apollo-configservice.log ctrip: appid: 100003171 \ No newline at end of file diff --git a/apollo-configservice/src/main/resources/bootstrap.yml b/apollo-configservice/src/main/resources/bootstrap.yml index 336b8b648..64d2862ba 100644 --- a/apollo-configservice/src/main/resources/bootstrap.yml +++ b/apollo-configservice/src/main/resources/bootstrap.yml @@ -1,8 +1,9 @@ eureka: instance: hostname: ${hostname:localhost} + preferIpAddress: true client: serviceUrl: - defaultZone: http://${eureka.instance.hostname}/eureka/ + defaultZone: http://${eureka.instance.hostname}:8080/eureka/ healthcheck: enabled: true \ No newline at end of file diff --git a/apollo-core/src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java b/apollo-core/src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java index 60c1edf32..9750fdbfa 100644 --- a/apollo-core/src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java +++ b/apollo-core/src/main/java/com/ctrip/apollo/core/MetaDomainConsts.java @@ -7,21 +7,29 @@ import com.ctrip.apollo.Apollo.Env; public class MetaDomainConsts { - public static final String LOCAL = "http://localhost"; + public static final String DEFAULT_PORT = "8080"; - public static final String DEV = "http://ws.meta.apollo.fx.dev.nt.ctripcorp.com"; + public static final String LOCAL = "http://localhost" + "/" + DEFAULT_PORT; - public static final String FAT = "http://ws.meta.apollo.fx.fat.nt.ctripcorp.com";; + public static final String DEV = + "http://ws.meta.apollo.fx.dev.nt.ctripcorp.com" + "/" + DEFAULT_PORT; - public static final String FWS = "http://ws.meta.apollo.fx.fws.nt.ctripcorp.com"; + public static final String FAT = + "http://ws.meta.apollo.fx.fat.nt.ctripcorp.com" + "/" + DEFAULT_PORT; - public static final String UAT = "http://ws.meta.apollo.fx.uat.nt.ctripcorp.com"; + public static final String FWS = + "http://ws.meta.apollo.fx.fws.nt.ctripcorp.com" + "/" + DEFAULT_PORT; - public static final String LPT = "http://ws.meta.apollo.fx.lpt.nt.ctripcorp.com"; + public static final String UAT = + "http://ws.meta.apollo.fx.uat.nt.ctripcorp.com" + "/" + DEFAULT_PORT; - public static final String TOOLS = "http://ws.meta.apollo.fx.tools.ctripcorp.com"; + public static final String LPT = + "http://ws.meta.apollo.fx.lpt.nt.ctripcorp.com" + "/" + DEFAULT_PORT; - public static final String PRD = "http://ws.meta.apollo.fx.ctripcorp.com"; + public static final String TOOLS = + "http://ws.meta.apollo.fx.tools.ctripcorp.com" + "/" + DEFAULT_PORT; + + public static final String PRD = "http://ws.meta.apollo.fx.ctripcorp.com" + "/" + DEFAULT_PORT; private static Map domains = new HashMap<>(); diff --git a/apollo-portal/src/main/resources/application.yml b/apollo-portal/src/main/resources/application.yml index cb9e9397f..a403f2895 100644 --- a/apollo-portal/src/main/resources/application.yml +++ b/apollo-portal/src/main/resources/application.yml @@ -5,9 +5,14 @@ spring: application: name: apollo-portal datasource: - url: jdbc:h2:file:~/fxapolloportaldb + url: jdbc:h2:mem:~/fxapolloportaldb username: sa password: sa +logging: + level: + org.springframework.cloud: 'DEBUG' + file: /opt/logs/${ctrip.appid}/apollo-adminservice.log + ctrip: appid: 100003173 \ No newline at end of file -- GitLab