问题标签 [consul]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2908 浏览

dns - 如何在 Route53 上设置 Consul 托管区域?

我正在尝试设置 Route53,以便与 consul 集群位于同一 VPC 上的实例可以访问 .consul 端点。

出于实验目的,我使用 BIND(私有 IP 172.31.56.55)设置了 DNS 转发设置的三个服务器节点之一,作为此处建议的名称服务器,并添加了allow-query { any; }listen-on port 53 { any; };

我有一个“领事”。具有以下 SOA、NS 和 A(粘合)记录的托管区域:SOA:

NS:

ns1.consul 答:

如果我在 dig 命令中指定 @ns1.consul ,它可以工作,但如果我把它排除在外,它就不会。我错过了什么/配置错误?

0 投票
1 回答
3375 浏览

spring - Zuul 和 Consul 集成问题

我在使用 Zuul 和 Consul 服务发现设置 Spring Cloud 应用程序时遇到问题。我在本地安装并运行了 Consul 服务器代理:

当我使用注释运行 Spring Boot 应用程序时,@EnableZuulProxy出现以下错误:

资料来源:

构建.gradle

应用程序.yml

引导程序.yml

ZuulApplication.java

注意:当我注释掉@EnableZuulProxy注释时,我的服务运行没有问题,并且在 Consul 中正确注册。

我不知道该怎么做。也许有一些不好的依赖问题?

提前致谢。

0 投票
1 回答
884 浏览

spring-mvc - Spring Cloud 和 Consul:HttpClientErrorException:404 NOT_FOUND

我正在开发基于 Spring cloud consul 的 2 个应用程序。第一个称为 Hello1 并公开一个简单的 hello world Web 服务。第二个叫Hello2,尝试调用第一个应用暴露的web服务。这 2 个应用程序使用 consul 作为服务发现。

对于 Hello2,我有以下代码:

配置文件(yml):

对于 Hello1 应用程序:

}

配置文件(yml):

这是我的依赖项:

但是,当我调用 hello 2 应用程序http://localhost:1234/hello2时,它给了我以下错误:

0 投票
1 回答
6115 浏览

spring-boot - 微服务:Spring云应用中的Zuul & consul

我正在尝试使用 Zuul 和 Consul 创建一个 Spring 云微服务应用程序。

我的项目中有 2 个组件:

  1. 使用 Zuul 的 api-gateway 微服务

  2. Hello world 微服务(一个简单的 hello world Rest Webservice)

这是API网关的代码:

pom.xml

应用程序.yml

引导程序.yml

这是hello微服务的代码:

bootstrap.yml:spring:应用程序:名称:微服务示例配置文件:活动:本机

但是,当我启动 api-gateway 时,出现以下异常:

0 投票
0 回答
717 浏览

spring-cloud - 微服务:Zuul & consul 需要认证

我正在尝试使用 Zuul 和 Consul 创建一个 Spring 云微服务应用程序。

我的项目中有 2 个组件:

  1. 使用 Zuul 的 api-gateway 微服务

  2. Hello world 微服务(一个简单的 hello world Rest Webservice)

这是API网关的代码:

pom.xml

应用程序.yml

引导程序.yml

这是hello微服务的代码:

bootstrap.yml:spring:应用程序:名称:微服务示例配置文件:活动:本机

但是,当我测试我的服务时,浏览器需要身份验证。

在此处输入图像描述

0 投票
0 回答
754 浏览

spring-cloud - Spring cloude: Zuul & consul

我正在尝试使用 Zuul 和 Consul 创建一个 Spring 云微服务应用程序。

我的项目中有 2 个组件:

  1. 使用 Zuul 的 api-gateway 微服务

  2. Hello world 微服务(一个简单的 hello world Rest Webservice)

这是API网关的代码:

pom.xml

应用程序.yml

引导程序.yml

这是hello微服务的代码:

bootstrap.yml:spring:应用程序:名称:微服务示例配置文件:活动:本机

但是,当我测试我的服务时,浏览器会显示以下消息:

在此处输入图像描述

这是边缘服务器应用程序的堆栈跟踪:

0 投票
1 回答
521 浏览

spring-cloud - 微服务:启用 https 时,领事无法检查服务的健康状况

我正在尝试在基于 Spring Cloud 的微服务应用程序中使用 Consul。但是当我在 tomcat 服务器中启用 HTTPS 时,consul 无法检查服务的运行状况(因为他们尝试使用 http 检查运行状况)。我收到了这个错误:

0 投票
1 回答
521 浏览

c# - How to keep track of the services registered in SOA service registry & discovery

I have been working on the SOA POC since last few days. For service discovery & registry, we are considering Consul. Once we have registered the services in consul, how we should keep track of running status of the registered services? We are implementing things on .net platform where some wcf services are hosted on the different appdomains, some in separate console process. We can keep track of the services in two ways.

  1. Listening the ports using socket connection with heartbeats .
  2. Handling the appdomain unload & console exit events.

A. Is there any other way to handle this scenario?

B. How we can get notification when console application process gets terminated ? procss might be killed,closed etc. How we can gracefully remove the service registry entry from Consul central repository?

C. Listening all the ports with certain heartbeat is efficient way as it will keep threads busy all the times?

Any help is most appreciated?

0 投票
0 回答
328 浏览

dns - 无法从其他节点连接到 Consul DNS

我在 192.168.1.191 和 192.168.1.198 的代理上设置了 Consul Master。

我尝试dig在 Consul Master 中使用命令,它可以工作:

为什么?Consul 似乎无法处理来自其他节点的请求。任何帮助将不胜感激。

dig但是,当我在 Consul Agent 中尝试命令时,我收到了一条超时消息:

以下是 Consul Master 上 TCPDump 命令的输出:

0 投票
1 回答
3309 浏览

nginx - Docker 中的 NGINX 和 Consul 模板

我在使用 EC2、AWS、Docker、Consul-Template、Consul 和 NGINX 进行一致的服务发现时遇到问题。

我有多个服务,每个服务都在它自己的 EC2 实例上运行。在这些实例上,我运行以下容器(按此顺序):

  • cAdvisor(监控)
  • 节点导出器(监控)
  • Consul(以代理模式运行)
  • 登记员
  • 我的服务
  • 同时运行 nginx 和 consul-template 的自定义容器

自定义容器具有以下 Dockerfile:

app.conf 文件如下所示:

一切似乎都可以正常启动,但是在启动后的某个时间点(我尚未确定),consul-template 似乎返回特定服务没有可用的服务器。这意味着该upstream服务的部分不包含服务器,我最终在日志中得到了这个:

此后,NGINX 将不再接受请求。

我确定我遗漏了一些明显的东西,但我已经把自己绑在关于事件顺序等的心理上。我认为可能发生的是 NGINX 崩溃,但由于 consul-template 仍在运行,Docker 容器不重新启动。我实际上并不关心容器本身是否重新启动,或者只是 NGINX 重新启动。

有人可以帮忙吗?