Category : consul

Order This article mainly studies spring cloud’s ConsulServiceRegistry. ServiceRegistry spring-cloud-commons-2.1.2.RELEASE-sources.jar! /org/springframework/cloud/client/serviceregistry/ServiceRegistry.java public interface ServiceRegistry<R extends Registration> { /** * Registers the registration. A registration typically has information about an * instance, such as its hostname and port. * @param registration registration meta data */ void register(R registration); /** * Deregisters the registration. * @param registration ..

Read more

Consul server configuration The greatest advantage brought by microservices is to divide the whole large project into different services and run them on different servers to realize decoupling and distributed processing. Although microservices have many advantages, they also have some disadvantages. Everything has two sides. Operation and maintenance in micro-services will be a big problem. ..

Read more

docker-compose version: ‘2’ services: node-1: image: shcoder/alpine-consul hostname: node-1 ports: – 8500:8500 environment: – CONSUL_NODE_NAME=node-1 – CONSUL_BOOTSTRAP_EXPECT=3 – CONSUL_SERVER=true – CONSUL_CLUSTER_IPS=node-2,node-3 – CONSUL_ENCRYPT=q7Gsg6LSdrtWFvBpw7vmdA== node-2: image: shcoder/alpine-consul hostname: node-2 environment: – CONSUL_NODE_NAME=node-2 – CONSUL_BOOTSTRAP_EXPECT=3 – CONSUL_SERVER=true – CONSUL_CLUSTER_IPS=node-1,node-3 – CONSUL_ENCRYPT=q7Gsg6LSdrtWFvBpw7vmdA== node-3: image: shcoder/alpine-consul hostname: node-3 environment: – CONSUL_NODE_NAME=node-3 – CONSUL_BOOTSTRAP_EXPECT=3 – CONSUL_SERVER=true – CONSUL_CLUSTER_IPS=node-1,node-2 – CONSUL_ENCRYPT=q7Gsg6LSdrtWFvBpw7vmdA== ..

Read more