Fork me on GitHub

使用Consul实现服务发现:instance-id自定义

TIPS 本文基于Spring Cloud Hoxton,理论支持Spring Cloud所有版本。 本文探讨如何自定义微服务注册到Consul的InstanceId。 Consul把InstanceId作为唯一标识,而Spring Cloud Consul默认的InstanceId是 ${spring.application.name}-${server.port} 。 这样导致的问题是:某个微服务即使有多个实例,只要端口相...

用git2consul从Git同步配置到Consul

TIPS 当且仅当 spring.cloud.consul.config.format=files 时,才可用git2consul管理配置,其他格式无法使用。 单机版Consul的配置是不持久化的,一旦重启就会丢失,而开发过程中,重启Consul可能比较频繁。要想解决这个问题,可将配置存储到Git仓库,并使用git2consul将配置同步到Consul中,以下是步骤。 安装Node.js下载Node.js前往 https://nodejs.org/en/downlo...

安装Consul集群

TIPS 本文基于Consul 1.5.3,理论适用于Consul 1.6及更低版本。 安装单机版Consul详见:《安装单机版Consul》 知识预热Consul常用命令 命令 解释 示例 agent 运行一个consul agent consul agent -dev join 将agent加入到consul集群 consul join IP members 列出consul cluster集群中的members consul member...

安装单机版Consul

TIPS 本文基于Consul 1.5.3,理论适用于Consul 1.6及更低版本。 下载Consul 下载最新稳定版:https://www.consul.io/downloads.html 下载指定版本:https://releases.hashicorp.com/consul/ 百度盘加速器(Consul 1.5.3) 12链接: https://pan.baidu.com/s/1Kyw5_duxW2TvEqb17YV9WQ 提取码: kfjt 复制这段...

Spring Cloud生态的配置服务器最全对比贴

本文从社区活跃度、产品特点、成功案例、产品缺点等维度,全方位对比Spring Cloud Config、Apollo、Nacos、Disconf、Spring Cloud Consul、Spring Cloud Zookeeper等几款Spring Cloud生态的配置服务器,帮助你选择合适的配置服务器。 一、Spring Cloud ConfigGitHub地址https://github.com/spring-cloud/spring-cloud-config ,S...