![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
基于SpringBoot和Consul的微服务系列
BoyWorldSkills
IT道路上前进的足迹
展开
-
(1) Consul高可用安装
1. 下载路径 https://www.consul.io/downloads.html 压缩包: consul_1.2.3_linux_amd64.zip2. 环境大网IP 小网IP node名称 10.40.66.143 172.20.80.193 consul-s-1 10.40.66.145 172.20.80.195 co...原创 2018-10-11 19:17:41 · 688 阅读 · 0 评论 -
(2) Consul集群统一网关访问(网关单点)
1. 只考虑三个Server(未使用consul client)2. 启动网关docker run --name consul_nginx -p 80:80 -v /home/nginx/nginx-single.conf:/etc/nginx/nginx.conf -d nginx:v1配置文件nginx-single.conf:worker_processes 1;ev...原创 2018-10-11 19:23:19 · 2107 阅读 · 0 评论 -
(3) Consul 主要端口和API
一、API 注册服务 curl http://10.40.66.144:8500/v1/agent/service/register -X PUT -i -H "Content-Type:application/json" -d '{"ID": "userServiceId", "Name": "userService","Tags": ["primary",原创 2018-10-11 19:36:42 · 6001 阅读 · 0 评论 -
(4) SpringBoot 服务注册 (Consul)
1. 依赖1)提供健康检查,度量等接口,比如/info,/health等<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId></dependency&...原创 2018-10-08 17:24:43 · 2271 阅读 · 0 评论 -
(5) SpringBoot 无效服务删除代码
package com.ethan.example.client.controller;import com.ecwid.consul.v1.ConsulClient;import com.ecwid.consul.v1.Response;import com.ecwid.consul.v1.agent.model.Member;import com.ecwid.consul.v1.a...原创 2018-10-08 17:32:57 · 434 阅读 · 0 评论 -
(6) SpringBoot 服务发现(RestTemplate)
1. 依赖1)负载均衡包spring-cloud-starter-ribbon<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-ribbon</artifactId></de...原创 2018-10-08 17:39:49 · 491 阅读 · 0 评论 -
(7) SpringBoot 服务发现(Feign)
Feign和RestTemplate的服务注册相同1. Feign依赖包spring-cloud-starter-ribbon<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-feign<...原创 2018-10-08 18:38:08 · 582 阅读 · 0 评论