https://github.com/v5tech/spring-cloud-consul-example
https://github.com/v5tech/spring-cloud-consul-example
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/v5tech/spring-cloud-consul-example
- Owner: v5tech
- Created: 2016-10-26T16:33:35.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-26T16:34:02.000Z (about 9 years ago)
- Last Synced: 2024-10-11T18:13:38.007Z (about 1 year ago)
- Language: Java
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spring-cloud-consul-example
使用`consul`注册服务
### 1. 启动`consul`
```
consul agent -dev -ui
```
### 2. 启动`server`
```
mvn -f server/pom.xml spring-boot:run
mvn -f server/pom.xml spring-boot:run
mvn -f server/pom.xml spring-boot:run
```
启动三个服务端,客户端会轮询调用这三个服务,注意观察服务端控制台输出
### 3. 启动`client`
```
mvn -f client/pom.xml spring-boot:run
```
### 4. 客户端服务调用
http://localhost:8080/int
客户端负载均衡轮询调用之前步骤中启动的三个服务端程序,注意观察服务端控制台输出
### 5. consul ui
http://localhost:8500/ui
`consul`注册服务控制台