Commit 73dba8ec8b4a85ceb1afcc36567255e2d5363ce8
1 parent
930d2106
注册class-service到gateway服务
Showing
3 changed files
with
5 additions
and
3 deletions
class-service.yml
discovery.yml
| ... | ... | @@ -23,7 +23,7 @@ eureka: |
| 23 | 23 | registerWithEureka: false |
| 24 | 24 | fetchRegistry: false |
| 25 | 25 | serviceUrl: |
| 26 | - defaultZone: http://discovery:${server.port}/eureka/ | |
| 26 | + defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ | |
| 27 | 27 | |
| 28 | 28 | --- |
| 29 | 29 | |
| ... | ... | @@ -49,4 +49,4 @@ eureka: |
| 49 | 49 | registerWithEureka: false |
| 50 | 50 | fetchRegistry: false |
| 51 | 51 | serviceUrl: |
| 52 | - defaultZone: http://discovery:${server.port}/eureka/ | |
| 53 | 52 | \ No newline at end of file |
| 53 | + defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ | |
| 54 | 54 | \ No newline at end of file | ... | ... |
gateway.yml
| ... | ... | @@ -20,6 +20,8 @@ zuul: |
| 20 | 20 | routes: |
| 21 | 21 | users: |
| 22 | 22 | url: http://user-service:16100 |
| 23 | + classes: | |
| 24 | + url: http://class-service:16200 | |
| 23 | 25 | |
| 24 | 26 | #这个配置为true则取发现服务的注册地址(服务地址存储在DomainExtractingServerList,由EurekaRibbonClientConfiguration.ribbonServerList()创建) |
| 25 | 27 | #为false取本地配置文件的配置地址(服务地址存储在ConfigurationBasedServerList中,由RibbonClientConfiguration.ribbonServerList()创建) | ... | ... |