Consul Dynamic Infrastructure

No comments

Consul – Dynamic Infrastructure

Consul is a distributed service mesh to create dynamic infrastructure and manage service configurations across any runtime platform. The project is hosted at Github under the Mozilla Public License, version 2.0.

Consul provides several key features:

  • Service Discover
  • Health Checking
  • Service Segmentation
  • Multi-Datacenter

It aims to shift from static infrastructure to dynamic infrastructure changes the approach to networking from host-based to service-based.

Consul has service discovery, registration and health check process that can be more useful to create service-based networking. These features allow services to scale up/down and handle failure without load balancer.

It uses LAN and WAN gossip protocols to manage membership and broadcast messages to the cluster. Also RPC uses to allow a client to make a request of a server.

Pre-Requirements:

  • 3 Server (1 bootstrap and 2 server)
  • Consul Binaries
  • Application user to perform installation

Step 1: Download binaries

You can access all consul configuration parameters from that link. Also download latest binaries from Consul page which suitable for your operating system

Step 2: Extract and manage permissions

I extracted consul binaries under “/appdata/consulv1” directory. You need to perform these steps at all servers that you will add Cluster.(1 bootstrap and 2 Server)

Step 3: Create configuration file for bootstrap and server.

It is important to set this flag for only one server in datacenter. In a datacenter there must be only one bootstrap server.

It is optional to change service ports. I only want to show that you can manage ports on Consul. If you don’t want to change default ports then remove ports from configuration file.

 

Step 4: Create service configuration file

I added service configuration file for RHEL7-Centos and Fedora. If you have run on another platform you should create a service file to start and stop Consul.


I added a basic python code to show how to check consul servers’ health and register an existing service to the consul.

 

Follow me

Abdurrahim

I'm a System Engineer with extensive experience and administration skills and works for Interbank Card Center Of Turkey.I provide hardware and software support for the following Unix/Linux and Windows platforms.(Oracle Solaris,HP-UX, Linux, IBM-AIX, Windows Servers)
Follow me

Latest posts by Abdurrahim (see all)

facebooktwittergoogle_pluslinkedinby feather

No comments yet.

You must be logged in to post a comment.