consul

How do I separate stages of multi-machine cluster provisioning?

守給你的承諾、 提交于 2019-12-08 07:16:37
问题 Let's say I have 4 Vagrant boxes. 3 are variations of the same configuration, say, Consul, and one has a completely different configuration, say a database. I need to run a provisioning step with slight variations on the three similarly configured Consul VMs. Then, I need to run a provisioning step against 1 of those Vault VMs. Only after this provisioning step run on 1 of the VMs can I successfully run the next provisioning step, with slight variations, on the three similarly configured

how to define HTTP health check in a consul container for a service on the same host?

久未见 提交于 2019-12-08 06:19:11
问题 We are using a consul agent on a host that also runs a service. (RabbitMQ) To verify that the service is ready we have defined a curl based health check. however, we are using the registrator to inject this check using env variable. SERVICE_CHECK_SCRIPT=curl hostname :15672/.... problem is, we've also told the consul-agent that its hostname is the same as the host. (We must have this feature since we want to see the correct hostname registered with the consul cluster. When the consul agent

Consul deregister 'failing' services

∥☆過路亽.° 提交于 2019-12-08 02:23:40
问题 I have consul running on Consul v0.5.2 version & services running in Mesos. Services keep moving from 1 server to another. Is there way to deregister services in consul that are in 'failing' state? I am able to get the list of services in failing state using this curl curl http://localhost:8500/v1/health/state/critical Issue that we are seeing is over a period of time in consul UI we have stale data & making the whole UI unusable 回答1: Consul by default do not deregister unhealthy services

Does my docker images need its own consul client instances?

女生的网名这么多〃 提交于 2019-12-07 22:39:09
问题 I've got a dockerized application split in several containers (a few frontend and backend servers, load balancer, mysql, elasticsearch, etc.). The configuration of the load balancer needs to know which containers are up and so I'm registering services with Consul service discovery. But I'm not quite sure if it's a good idea to run a consul agent on every docker container instead of using the docker host to supervise all the running docker containers and register them via Consul's HTTP-API. Is

docker reverse proxy DNS/networking issues

安稳与你 提交于 2019-12-07 14:50:15
问题 I'll try to explain and draw this out What I want to achieve: Sorry for the crappy paint diagram. Right now, it works perfectly if I hit it from the 10.10.10.0 network. The problem is DNS resolves jenkins.network.com to the 10.10.10.0 network. I want to go back through the proxy though as that has SSL termination to get to the sonarqube server. Is there a good way to accomplish this to keep the services behind the proxy? Do I need to create a second DNS server with the docker network on it?

Need for service discovery for docker engine swarm mode

Deadly 提交于 2019-12-07 11:37:24
问题 I'm confused about docker swarm. As far as I know, the old way to run a swarm was to run manager and workers in containers, before docker engine provided native support for swarm mode. Documentation for the old, containerized swarm explained how to setup service discovery using consul, etcd or zookeeper. Service discovery is necessary, as services are ran at random ports to avoid collisions, right? Documentation for the docker engine swarm mode doesn't explain how to setup service discovery.

CenOS 7.1安装Docker、Docker-compose

拥有回忆 提交于 2019-12-07 04:24:11
关闭centos7自带的firewall防火墙 关闭firewall systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 安装iptables防火墙 yum install iptables-services #安装 systemctl restart iptables.service #最后重启防火墙使配置生效 systemctl enable iptables.service #设置防火墙开机启动 安装docker yum install docker-io 安装docker-compose 最新版本(2016-04-19) curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s-uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose docker-compose template文件:docker-compose.yml #简单的web服务器,可以用 docker-compose scale web

consul consul-template nginx keepalived 搭建高可用负载均衡(支持TCP和http)

泪湿孤枕 提交于 2019-12-06 23:56:40
consul consul-template nginx keepalived 搭建高可用负载均衡 搭建准备 两台windows服务器 IP分别为192.168.103.151和192.168.103.152 两台linux服务器(centos7) IP分别为192.168.103.150和192.168.103.153 (这里使用VMware虚拟机搭建该方案) 思路   两台windows作为集群中的server提供实际的业务处理功能,在linux上使用nginx作为负载均衡器反向代理,同时两台linux做主备,使用虚拟IP对外提供服务(主备之间只有一台机器对外提供服务),当主nginx意外宕机,或者主机的nginx服务挂掉,备机自动抢占虚拟ip改为由备机提供服务,当主机一切正常时,再抢回虚拟ip。   四台机器之间通过consul搭建集群,两台windows机器作为集群中的server,consul为集群中的client提供服务发现的功能,提供健康检查功能,两台linux机器,使用consultemlate动态更新nginx的配置文件。 架构图如下: 现在开始搭建windows集群 1.安装consul 下载地址: https://www.consul.io/downloads.html 新建consul配置文件 config.json { "services": [ {

企业分布式微服务云SpringCloud SpringBoot mybatis (十四)服务注册(consul)

自作多情 提交于 2019-12-06 21:06:33
这篇文章主要介绍 spring cloud consul 组件,它是一个提供服务发现和配置的工具。consul具有分布式、高可用、高扩展性。 一、consul 简介 consul 具有以下性质: 服务发现:consul通过http 方式注册服务,并且服务与服务之间相互感应。 服务健康监测 key/value 存储 多数据中心 consul可运行在mac windows linux 等机器上。 二、consul安装 linux $ mkdir -p $GOPATH/src/github.com/hashicorp && cd $! $ git clone https://github.com/hashicorp/consul.git $ cd consul $ make bootstrap $ make bootstrap windows下安装: 见consul怎么在windows下安装 三、构建工程 构建一个consul-miya的springboot工程,导入依赖pring-cloud-starter-consul-discovery,其依赖文件: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3

优化Spring Cloud微服务注册架构详解 一点课堂(多岸学院)

元气小坏坏 提交于 2019-12-06 21:06:14
1、什么是服务注册中心? 先回顾一下什么叫做服务注册中心? 顾名思义,假设你有一个分布式系统,里面包含了多个服务,部署在不同的机器上,然后这些不同机器上的服务之间要互相调用。 举个现实点的例子吧,比如电商系统里的订单服务需要调用库存服务,如下图所示。 现在的问题在于,订单服务在192.168.31.154这台机器上,库存服务在192.137.1.33这台机器上。 现在订单服务是想要调用库存服务,但是他并不知道库存服务在哪台机器上啊!毕竟人家都是在不同机器上的。 所以这个时候就需要服务注册中心出场了,这个时候你的系统架构中需要引入独立部署在一台机器上的服务注册中心,如下图所示。 然后订单服务、库存服务之类的兄弟,都需要配置上服务注册中心部署在哪台机器上,比如192.168.31.45这台机器。 接着订单服务、库存服务他们自己启动的时候,就得发送请求到到服务注册中心上去进行服务注册。 也就是说,得告诉服务注册中心,自己是哪个服务,然后自己部署在哪台机器上。 然后服务注册中心会把大家注册上来的信息放在注册表里,如下图。 接着订单服务假如想要调用库存服务,那么就找服务注册中心问问:能不能告诉我库存服务部署在哪台机器上? 服务注册中心是知道这个信息的,所以就会告诉订单服务:库存服务部署在192.1371.133这台机器上,你就给这台机器发送请求吧。 然后