Skip to content

Consul #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>

<dependency>
Expand Down
21 changes: 10 additions & 11 deletions config-repo/application.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
eureka:
instance:
hostname: registry
prefer-ip-address: true
client:
service-url:
defaultZone: http://user:${REGISTRY_SERVER_PASSWORD:password}@registry:8761/eureka/

hystrix:
command:
default:
Expand All @@ -19,6 +11,13 @@ ribbon:
ConnectTimeout: 5000

spring:
cloud:
consul:
discovery:
prefer-ip-address: true
instance-id: ${spring.application.name}:${server.port}:${random.value}
host: registry
port: 8500
rabbitmq:
host: rabbitmq
sleuth:
Expand All @@ -30,9 +29,9 @@ spring:
skip-pattern: "^org.*HystrixStreamTask$"

authserver:
hostname: auth-service
port: 5000
contextPath: /uaa
hostname: auth-service
port: 5000
contextPath: /uaa

security:
oauth2:
Expand Down
12 changes: 5 additions & 7 deletions config-repo/auth-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ management:
enabled: false
context-path: /mgmt

eureka:
instance:
health-check-url-path: ${server.context-path}${management.context-path}/health
status-page-url-path: ${server.context-path}${management.context-path}/info
metadata-map:
management.context-path: ${server.context-path}${management.context-path}

spring:
cloud:
consul:
discovery:
health-check-path: ${server.context-path}${management.context-path}/health
tags: management.context-path=${server.context-path}${management.context-path}
datasource:
url: jdbc:h2:mem:user
driver-class-name: org.h2.Driver
Expand Down
10 changes: 5 additions & 5 deletions config-repo/svca-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ server:

name: zhangxd

eureka:
instance:
metadata-map:
user.name: ${security.user.name}
user.password: ${security.user.password}
spring:
cloud:
consul:
discovery:
tags: user.name=${security.user.name}, user.password=${security.user.password}

security:
user:
Expand Down
10 changes: 5 additions & 5 deletions config-repo/svcb-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ server:

msg: Hello

eureka:
instance:
metadata-map:
user.name: ${security.user.name}
user.password: ${security.user.password}
spring:
cloud:
consul:
discovery:
tags: user.name=${security.user.name}, user.password=${security.user.password}

security:
user:
Expand Down
2 changes: 1 addition & 1 deletion config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
18 changes: 7 additions & 11 deletions config/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
server:
port: 8888

eureka:
instance:
hostname: registry
prefer-ip-address: true
metadata-map:
user.name: ${security.user.name}
user.password: ${security.user.password}
client:
service-url:
defaultZone: http://user:${REGISTRY_SERVER_PASSWORD:password}@registry:8761/eureka/

spring:
cloud:
consul:
discovery:
prefer-ip-address: true
tags: user.name=${security.user.name}, user.password=${security.user.password}
host: registry
port: 8500
config:
server:
git:
uri: https://github.com/zhangxd1989/spring-boot-cloud
search-paths: config-repo
default-label: consul
rabbitmq:
host: rabbitmq

Expand Down
14 changes: 8 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
version: '2'
services:
rabbitmq:
image: rabbitmq:3-management
restart: always
ports:
- 15673:15672
image: rabbitmq:3-management
restart: always
ports:
- "15673:15672"
registry:
image: spring-boot-cloud/registry
image: consul
ports:
- "8761:8761"
- "8400:8400"
- "8500:8500"
- "8600:8600"
config:
image: spring-boot-cloud/config
ports:
Expand Down
2 changes: 1 addition & 1 deletion gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
Expand Down
6 changes: 5 additions & 1 deletion monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-turbine-stream</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</exclusion>
<exclusion>
<artifactId>netty-transport-native-epoll</artifactId>
<groupId>io.netty</groupId>
Expand All @@ -56,7 +60,7 @@
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
20 changes: 9 additions & 11 deletions monitor/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ turbine:
stream:
port: 8041

eureka:
instance:
hostname: registry
prefer-ip-address: true
metadata-map:
user.name: ${security.user.name}
user.password: ${security.user.password}
client:
service-url:
defaultZone: http://user:${REGISTRY_SERVER_PASSWORD:password}@registry:8761/eureka/

spring:
cloud:
consul:
discovery:
prefer-ip-address: true
tags: user.name=${security.user.name}, user.password=${security.user.password}
host: registry
port: 8500
rabbitmq:
host: rabbitmq
boot:
Expand All @@ -30,6 +26,8 @@ spring:
turbine:
clusters: default
location: http://monitor:${turbine.stream.port}
discovery:
ignored-services: consul

security:
user:
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

<modules>
<module>config</module>
<module>registry</module>
<module>gateway</module>
<module>monitor</module>
<module>auth-service</module>
Expand All @@ -33,7 +32,7 @@
<java.version>1.8</java.version>
<docker.plugin.version>0.4.13</docker.plugin.version>
<docker.image.prefix>spring-boot-cloud</docker.image.prefix>
<spring.cloud.version>Dalston.RELEASE</spring.cloud.version>
<spring.cloud.version>Dalston.SR1</spring.cloud.version>
<spring-boot-admin.version>1.5.0</spring-boot-admin.version>
</properties>

Expand Down
6 changes: 0 additions & 6 deletions registry/Dockerfile

This file was deleted.

42 changes: 0 additions & 42 deletions registry/pom.xml

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions registry/src/main/resources/application.yml

This file was deleted.

3 changes: 0 additions & 3 deletions registry/src/main/resources/bootstrap.yml

This file was deleted.

49 changes: 0 additions & 49 deletions registry/src/test/java/cn/zhangxd/registry/ApplicationTests.java

This file was deleted.

2 changes: 1 addition & 1 deletion svca-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>

<dependency>
Expand Down
Loading