consul

Not able to load logback.xml from Consul

守給你的承諾、 提交于 2019-12-11 19:50:05
问题 The issue goes like this I have all my configuration for the project in Consul KV store The configuration includes application.yml, logback.xml and few other configurations needed by my project. Using bootstrap.yml for Spring Cloud Consul configuration which contains logging.config for with the URI of the configuration URI is as follow for logging.config - http://CONSUL_SERVER_IP:CONSUL_SERVER_PORT/v1/kv/CONSUL_CONFIG_PREFIX/logback.xml?raw Also tried passing below as argument/VM argument

Spring入门——SpringCloud(一)

耗尽温柔 提交于 2019-12-11 19:35:36
在看SpringCloud之前我们先来了解一下什么是 微服务 微服务 维基百科上这样说 微服务 (Microservices) 是一种 软件架构风格 ,它是以专注于单一责任与功能的小型功能区块为基础,利用模块化的方式组合出复杂的大型应用程序,微服务是一种以业务功能为主的服务设计概念,每一个服务都具有自主运行的业务功能,对外开放不受语言限制的 API (最常用的是 HTTP),应用程序则是由一个或多个微服务组成。 也就是说 我们将我们的服务拆分成更小 每个服务相互独立 只需暴露接口,两者毫不相干,只通过接口进行调用。 当我们用上微服务之后,我们只需关心每个业务的接口之间的调用即可。 每个服务都是独立的组件,可复用,可替换,降低耦合,易维护。常见的微服务架构有 dubbo、Kubernetes、SpringCloud SpringCloud SpringCloud是Spring的子项目 SpringCloud整合了市面流行的技术:集成了配置管理,服务发现,智能路由,负载均衡,熔断器,控制总线,集群状态等等功能。 主要组件有 SpringCloudNetflix SpringCloudNetflix: 与Netflix的各种OSS组件集成( Eureka , Hystrix , , Archaius等) 。 这个组件下集成了Spring的核心功能 Netflix Eureka(服务中心)

Unable to create Http Health Check from config file Consul

穿精又带淫゛_ 提交于 2019-12-11 17:55:41
问题 I have been trying to create a http health check for a REST service using the config file. While loading the consul, it read the service details from the config file and that is reflected in 8500 Web UI. But it did not add the health check details for that service. No error is displayed too when the health check is along with the service definition (Case 1). But it notified an error when tried to give the health check config seperatly. (Case 2) However I can able to successfully add a http

Cant access consul webui docker compose

﹥>﹥吖頭↗ 提交于 2019-12-11 16:59:57
问题 Im trying to standup consul dev webui for traning purposes using docker compose. While consul claims to be running, when I try to visit localhost:8500/ui, the site is unreachable. My docker compose file: version: "3" services: cs1: image: consul:1.4.2 ports: - "8500:8500" command: "agent -dev -ui" The response from the console is cs1_1_6d8d914aa536 | ==> Starting Consul agent... cs1_1_6d8d914aa536 | ==> Consul agent running! cs1_1_6d8d914aa536 | Version: 'v1.4.2' cs1_1_6d8d914aa536 | Node ID:

Consul 快速入门

别来无恙 提交于 2019-12-11 15:13:15
Consul是什么 Consul是一个服务网格(微服务间的 TCP/IP,负责服务之间的网络调用、限流、熔断和监控)解决方案,它是一个一个分布式的,高度可用的系统,而且开发使用都很简便。它提供了一个功能齐全的控制平面,主要特点是:服务发现、健康检查、键值存储、安全服务通信、多数据中心。 安装Consul 这里提供两台Centos:consul1,consul2 安装方式: [root@consul2 ~]# wget https://releases.hashicorp.com/consul/1.2.2/consul_1.2.2_linux_amd64.zip [root@consul2 ~]# unzip consul_1.2.2_linux_amd64.zip [root@consul2 ~]# ./consul Usage: consul [--version] [--help] <command> [<args>] # consul1 同上 运行Agent 安装Consul后必须运行Agent,可以选择服务器或客户端模式。每个数据中心至少有一个服务器(推荐3~5个服务器集群)。 简单起见,先启动一个Agent的开发模式: # Agent的开发模式 [root@consul2 ~]# ./consul agent -dev ==> Starting Consul agent.

micro-service: Zuul & consul require authentification

本秂侑毒 提交于 2019-12-11 10:33:44
问题 I'm trying to create a Spring cloud microservice application using Zuul and Consul. I have 2 components in my project: api-gateway microservice using Zuul Hello world microservice (a simple hello world Rest Webservice) Here is the code of The api-gateway: @SpringBootApplication @EnableZuulProxy @EnableDiscoveryClient public class ZuulApplication { public static void main(String[] args) { SpringApplication.run(ZuulApplication.class, args); } } The pom.xml <parent> <groupId>org.springframework

Application startup and shutdown based on authenticated user activity

拜拜、爱过 提交于 2019-12-11 10:09:47
问题 There are applications and services in enterprises that do not need to run all the time and that have a limited user base (say a handful of people). These applications can be shut down and started either based on scheduling or even better user activity. So, we are talking about on-demand service (say wrapped by a container) and node start-up and shut down. Now, first to mention that the reason why I mention authenticated user activity is because is makes sense to startup and shutdown on that

Cannot link Consul and Spring Boot app in Docker

痴心易碎 提交于 2019-12-11 04:41:55
问题 I have a Spring Boot app with the following config: spring: thymeleaf: cache: false cloud: consul: host: consul port: 8500 discovery: prefer-ip-address: true instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}} that I want to run with docker-compose(Docker 1.11.2, docker-compose 1.7.1): consul: image: progrium/consul:latest container_name: consul hostname: consulhost ports: - "8400:8400" - "8500:8500" - "8600:53" command: "-server -bootstrap-expect 1 -ui

Issue when joining serf nodes located in different Docker containers

六眼飞鱼酱① 提交于 2019-12-10 23:16:01
问题 Context: Host is AWS-EC2 / Ubuntu 14.04.5 with Docker version 17.05.0-ce. Containers are built from publicly available repo image cbhihe/serf-alpine-bash . All containers are located on the same EC2 instance and share the same default bridge network with net-interface "docker0". Trying to join nodes serfDC1 (id d4fd90692e18) and serfDC2 (id 6353e7f6134d), by passing cmds from the host's shell: $ docker exec serfDC1 serf agent -node=Node1 -bind=0.0.0.0:7946 ==> Starting Serf agent… ==>

SpringCloud War包部署无法注册到Consul的解决方案(亲测成功)

与世无争的帅哥 提交于 2019-12-10 17:53:00
最近在搭建SpringCloud+Consul的项目,在网上查看blog找了很久,花了差不多2天时间才解决SpringCloud的服务无法注册到Consul的方法。主要原因是SpringCloud的服务在Springboot项目中没有启动。这个是问题的根源。接下我们开始填坑吧。 我的Springboot版本为:2.0.3.RELEASE,SpringCloud版本为Finchley.RELEASE。网上其他blog说springboot的版本为2.1.3.RELEASE也是可以的。如果version为2.1.3.RELEASE, spring-cloud.version也要为Finchley.SR1。tomcat版本为8.5.38和9.0.29都可以运行项目打成的war包。 一、安装consul 1.1、访问 Consul 官网 ,根据操作系统类型,选择下载 Consul 的最新版本。我这里选择windows版本。 下载下来是一个zip压缩包,解压之后,是一个exe可执行文件。 1.2、制作一个启动文件:consul_start.bat,内容如下: title consul echo start.............................. d: cd D:\appsoftware\consul_1.6.2_windows_amd64 consul agent