consul

立足于SpringCloud.H + consul-discovery服务注册(18)

喜你入骨 提交于 2020-01-06 18:54:21
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 《SpringCloud.H心法总纲》 1、consul启动 下载连接: https://www.consul.io/downloads.html 执行命令,开启consul consul agent -dev 打开火狐浏览器,QQ浏览器等浏览器会出现以下问题,所以请使用火狐浏览器 使用火狐浏览器则正常,如下 2、创建子模块consul-provider <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-discovery</artifactId> </dependency> pom文件继承父工程daddy,修改为 <parent> <groupId>com.springcloud</groupId> <artifactId>daddy</artifactId> <version>0.0.1-SNAPSHOT<

Dynamic Scalable and adaptive architecture

混江龙づ霸主 提交于 2020-01-02 07:42:10
问题 I am a PhD student in Cloud Computing, I plan to use the microservices based architecture with consul and zeromq for my research project. I had few questions that I am finding hard to understand. Can someone help me out in sharing their experience. We have microservices based on dockers, We have zeromq and we have consul. Can you mention how we could combine all the three together to have a dynamic adaptive environment? Though I understand as to what zeromq, docker and consul is individually,

java.lang.IllegalStateException: No instances available for student-service at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient

被刻印的时光 ゝ 提交于 2020-01-01 19:39:10
问题 I am running the Spring Cloud Consule example from link:: https://howtodoinjava.com/spring/spring-cloud/consul-service-registration-discovery/ . When I am running the http://localhost:8098/getSchoolDetails/abcschool I am getting the below error, it seems that client is unable to recognized the student-service . java.lang.IllegalStateException: No instances available for student-service at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.execute(RibbonLoadBalancerClient.java

consul 使用方式

邮差的信 提交于 2020-01-01 13:37:23
1.在配置文件配置好的情况下,在运行 consul agent -server -datacenter=([xacl.json].[acl_datacenter]) -bootstrap -data-dir (consul运行时生成运行文件的路径,通常是 ./data,且如果更换了配置文件需要提前删除该目录下的文件) -config-file (配置文件的路径,通常是./conf) -ui-dir (consul可视化的UI,非必需 ./dist目前使用老桂的ui) -node=n1 -bind 本机IP 以上语句运行后,会出现 则表示成功。以上目录的即使是在cmd里在根目录上执行,也需要写./。注意不需要运行 consul agent -dev,这个命令似乎是启动一个空的agent,作为演示使用。 2.打开localhost:8500。可以看到已运行的服务。    来源: https://www.cnblogs.com/bournexxl/p/9100728.html

Consul .netcore

牧云@^-^@ 提交于 2020-01-01 13:36:49
0)基本概念 consul常用于服务发现 【微服务】 web_Api \ \ ->注册服务 raft选举leader -----------------------------------------------------------------—— 【Server1】<----------------------> 【Server2】 | | \ / \ / 【Server3】 -----------------------------------------------------------------—— \ \->发现服务 1)下载 https://www.consul.io/ 注意系统版本 2)设置环境变量 拷贝.exe对应的文件路径 放到环境变量path中 3)cmd中启动服务 -dev 表示默认 consul agent -dev 建立集群使用 同一服务器下解决端口占用问题时只能用相同端口注册一个服务 方式一、 pc-1 【ip:192.168.109.1】 consul agent -server -ui -bootstrap-expect=2 -data-dir=e:\consul -node=consul-1 -client=0.0.0.0 -bind=192.168.109.1 -datacenter=dc1 pc-2 【ip:192.168.109

Consul service discovery with DNS on Nodejs

时光毁灭记忆、已成空白 提交于 2020-01-01 06:25:28
问题 TL;DR Hi all, I'm trying to call nodejs backend microservices from a nodejs frontend written in Express, through Consul DNS interface but I am having errors. I am using the nodejs dns api to set the dns for the sole node application in order to make subsequent dns.resolve() calls to the local Consul DNS interface. Target I would like to be able to make an http request to my backend service without the need to wire its IPs and ports in my client code. Neither I want to write a custom code to

基于docker安装consul集群

依然范特西╮ 提交于 2019-12-31 20:43:56
基于docker安装consul集群 如下是以获取本地配置文件为例() (1)从docker中拉取consul镜像 sudo docker pull consul (2)添加配置文件(分别在对应的主机上执行) mkdir -p /data/consul/config/server1 mkdir -p /data/consul/config/server2 mkdir -p /data/consul/config/server3 Acl.json (acl相当于需要密码认证,安全性相对来说比较高,生产环境不对外开放,可以不用配置) Server.json (启动参数配置,启动consul会调用此配置) 配置文件参考如下: (3)启动节点 sudo docker run -d --net=host --name consul_server_1 -v /data/consul/:/consul -v /data/consul/consul_server:/consul_server consul agent -config-dir=/consul/config/server1 sudo docker run -d --net=host --name consul_server_2 -v /data/consul/:/consul -v /data/consul/consul_server

How to access externally to consul UI

送分小仙女□ 提交于 2019-12-30 00:04:12
问题 How can I access to consul UI externally? I want to access consul UI writing <ANY_MASTER_OR_SLAVE_NODE_IP>:8500 I have try doing a ssh tunnel to acces: ssh -N -f -L 8500:localhost:8500 root@172.16.8.194 Then if I access http://localhost:8500 It works, but it is not what I want. I need to access externally, without ssh tunnel. My config.json file is the next: { "bind_addr":"172.16.8.216", "server": false, "datacenter": "nyc2", "data_dir": "/var/consul", "ui_dir": "/home/ikerlan/dist", "log

Centos 7 Docker、docker-compose、Registrator、Consul、Consul Template和Nginx实现高可扩展的Web框架

蹲街弑〆低调 提交于 2019-12-29 01:43:51
安装所需软件 Docker Docker-compose 配置docker-compose.yml文件内容如下: #load balancer will automatically update the config using consul-template lb: image: yeasy/nginx-consul-template:latest hostname: lb volumes: - /usr/soft/consul/logapi.conf:/etc/consul-templates/nginx.conf links: - consulserver:consul ports: - "80:80" consulserver: image: gliderlabs/consul-server:latest hostname: consulserver ports: - "8300:8300" - "8301:8301" - "8301:8301/udp" - "192.168.190.131:8302:8302" - "192.168.190.131:8302:8302/udp" - "192.168.190.131:8400:8400" - "192.168.190.131:8500:8500" - "53:53/udp" - "53:53" command: -data

使用Apache Mesos和Consul实现服务的注册发现

只谈情不闲聊 提交于 2019-12-29 01:43:33
为保证基于Docker应用程序和服务都具有高性能和可用性,设计出一种具有服务发现,高可用性和容错能力的解决方案非常重要。   我们使用 Apache Mesos 和 Mesosphere的 Marathon实现Docker的任务调度和应用部署,Mesos能够帮助完成高可用性 高容错性。   作为服务编排注册和发现, Consul 不仅能够作为一个key/value存储,而且能够支持错误侦测以及多数据中心支持。   注册定义是当有Docker容器启动或停止时,其他Docker容器应该能获知,使用 Apache Consul 实现注册或注销Docker容器的微服务名称以及发布端口。 Consul-template 是一个独立的应用,能够查询Consul并且更新文件系统上的一个文件模板,正如你看到一样,使用Consul/Consul-template实现注册的捆绑能够帮助完成动态服务的注册和发现,以及配置文件的更新,我们可以使用这些工具与Haproxy联合一起为所有服务请求提供一个通用的代理网关。 安装步骤   假设 Consul为3个或5个服务器集群工作,每个服务器节点包括所有mesos 主从服务器和haproxy等都必须有一个Consul代理网关安装和运行。   安装Consul 服务器和代理节点的步骤: wget https://dl.bintray.com/mitchellh