Commit 4a5285c6 authored by houg's avatar houg

注册中心

parent 3a9ab31a
...@@ -15,9 +15,15 @@ public class TestController { ...@@ -15,9 +15,15 @@ public class TestController {
@ApolloConfig @ApolloConfig
private Config config; private Config config;
@RequestMapping(path = "/get/{key}", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(path = "/get/{key}", method = {RequestMethod.GET, RequestMethod.POST})
public String get(@PathVariable("key") String key) { public String get(@PathVariable("key") String key) {
return config.getProperty(key, config.getSourceType().name()); return config.getProperty(key, config.getSourceType().name());
} }
@RequestMapping(path = "/value", method = {RequestMethod.GET, RequestMethod.POST})
public String value() {
return null;
}
} }
dev.meta=http://132.232.68.227:8080 dev.meta=http://122.112.233.76:8888
fat.meta=http://172.21.28.19:8080 fat.meta=http://172.21.28.19:8080
uat.meta=http://192.168.1.38:8082 uat.meta=http://192.168.1.38:8082
pro.meta=http://192.168.1.38:8083 pro.meta=http://192.168.1.38:8083
\ No newline at end of file
...@@ -2,7 +2,14 @@ spring.application.name=eureka-server ...@@ -2,7 +2,14 @@ spring.application.name=eureka-server
server.port=8761 server.port=8761
app.id=evonate-newretail-eureka app.id=evonate-newretail-eureka
apollo.meta=http://192.168.1.38:8080 #apollo.meta= http://122.112.233.76:8888
#spring.profiles.active = apollo-env.properties spring.profiles.active = apollo-env.properties
#表示是否将自己注册到Eureka Server上,默认为true
eureka.client.registerWithEureka=false
#表示是否从Eureka Server上获取注册信息,默认为true
eureka.client.fetchRegistry=false
eureka.instance.hostname=localhost
eureka.client.serviceUrl.defaultZone=http://localhost:${server.port}/eureka/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment