SlideShare a Scribd company logo
1 of 17
Download to read offline
Getting Started with Consul
Ramit Surana @ramitsurana /in/ramitsurana
Agenda
• Introduction
• Consul Architecture
• Raft Algorithm
• Comparisons
• Setup
• How to use it ?
• Bootstrapping and DNS
• Jespen Testing
• Consul on AWS
Introduction
• Tool for discovering and
configuring a variety of different
services in your infrastructure.
• Built on Golang.
• 3 basic ports:
8400 - RPC
8500 - HTTP
8600 - DNS
Features
• Service Discovery − Using either DNS or HTTP, applications can easily find the
services they depend upon.
• Health Check Status − It can provide any number of health checks. It is used
by the service discovery components to route traffic away from unhealthy
hosts.
• Key/Value Store − It can make use of Consul's hierarchical key/value store for
any number of purposes, including dynamic configuration, feature flagging,
coordination, leader election, etc.
• Multi Datacenter Deployment − Consul supports multiple datacenters. It is
used for building additional layers of abstraction to grow to multiple regions.
• Web UI − Consul provides its users a beautiful web interface using which it can
be easy to use and manage all of the features in consul.
Consul Architecture
Raft Algorithm
Comparison between etcd, zookeeper & consul
Setup
• Download consul from https://www.consul.io/downloads.html
• Extract binary package from the downloaded folder.
$ cd Downloads
$ chmod +x consul
$ sudo mv consul /usr/bin/
Consul-Template
• Daemon that queries the Consul instance and updates any number of
specified templates on the file system.
• Download & Extract from https://releases.hashicorp.com/consul-
template/.
$ cd Downloads
$ chmod +x consul-template
$ sudo mv consul-template /usr/share/bin/
Consul-UI
• Divided into three important parts, which are −
ACL − Set of Rules to easily lock your clusters easily
Datacenter − Enables you to easily manage datacenters and work out with your cluster.
Nodes − Quick update on the nodes that Consul cluster is using
$ mkdir /opt/consul-ui
$ cd /opt/consul-ui
$ wget https://releases.hashicorp.com/consul/0.7.2/consul_0.7.2_web_ui.zip
$ unzip consul_0.7.2_web_ui.zip
$ sudo consul agent -dev -ui -data-dir /tmp/consul
How to use it ?
• //Running Consul
$ sudo consul agent –dev –data-dir=/tmp/consul
• // Listing members
$ consul members
• // Joining Nodes
$ consul join <Node1><Node2>
• // Using Docker
$ docker run –p 8400:8400–p 8500:8500–p 8600:53/udp-h node1 progrium/consul -
server -bootstrap
How to use it ?
• //Running Consul UI
$ docker run –p 8400:8400–p 8500:8500–p 8600:53/udp-h node1 progrium/consul -
server –bootstrap –ui-dir /ui
• // Digging
$ dig @127.0.0.1-p 8600 web.service.consul
• // Monitor
$ consul monitor
• // Watch
$ consul watch –type=service –service=consul
How to use it ?
• //Registering External Services on Consul
$ sudo curl -X PUT -d '{"Datacenter": "dc1", "Node": "amazon",
"Address": "www.amazon.com",
"Service": {"Service": "shop", "Port": 80}}'
http://127.0.0.1:8500/v1/catalog/register
• // Removing External Service
$ curl -X PUT -d '{"Datacenter": "dc1", "Node": "amazon"}'
http://127.0.0.1:8500/v1/catalog/deregister
• // Info
$ sudo consul info
Bootstrapping & DNS
• Bootstrapping can be divided into 2 parts:
Automatic Bootstrapping - Automatically configured to detect, identify and join
nodes.
Manual Bootstrapping – Manual addition of Nodes using below cmd
$ consul join <Node B Address> <Node C Address>
• DNS is served from port 53. The DNS forwarding can be done using BIND,
dnsmasq and iptables.
• Consul DNS interface makes the port information for a service available via
the SRV records.
• If Dnsmasq is installed - $ dig web.service.consul
Jespen Testing
• Tool written to test the partial tolerance and networking in any system.
• Written in Clojure.
• Tests the system by creating some random operations on the system.
• For demo, Jepsen testing requires a huge level of cluster formation
with database systems and hence is out of scope for demo
Consul on AWS
• URL: https://aws.amazon.com/quickstart/archit
ecture/consul/
• create the following components −
• A VPC with public and private subnets across
three Availability Zones.
• A Seed Consul server and a Seed client along
with two Auto Scaling groups.
• You can choose to create 3, 5, or 7 servers. The
number of clients is set to three by default, but
it is user-configurable.
• Dnsmasq, which is installed and configured for
Consul as part of the installation.
• A Consul cluster
using bootstrap_expect option.
Thank You :)

More Related Content

What's hot

What's hot (20)

CloudMonkey
CloudMonkeyCloudMonkey
CloudMonkey
 
KubeConEU - NATS Deep Dive
KubeConEU - NATS Deep DiveKubeConEU - NATS Deep Dive
KubeConEU - NATS Deep Dive
 
Ansible
AnsibleAnsible
Ansible
 
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
 
Pub/Sub Messaging
Pub/Sub MessagingPub/Sub Messaging
Pub/Sub Messaging
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 
Consul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for Microservices
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Role Based Access Controls (RBAC) for SSH and Kubernetes Access with Teleport
Role Based Access Controls (RBAC) for SSH and Kubernetes Access with TeleportRole Based Access Controls (RBAC) for SSH and Kubernetes Access with Teleport
Role Based Access Controls (RBAC) for SSH and Kubernetes Access with Teleport
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To Jenkins
 
Prometheus - basics
Prometheus - basicsPrometheus - basics
Prometheus - basics
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Easy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQPEasy enterprise application integration with RabbitMQ and AMQP
Easy enterprise application integration with RabbitMQ and AMQP
 
Keycloak on Docker.pdf
Keycloak on Docker.pdfKeycloak on Docker.pdf
Keycloak on Docker.pdf
 
Microservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring CloudMicroservice With Spring Boot and Spring Cloud
Microservice With Spring Boot and Spring Cloud
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Prometheus 101
Prometheus 101Prometheus 101
Prometheus 101
 
NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 

Similar to Getting Started with Consul

BSides SG Practical Red Teaming Workshop
BSides SG Practical Red Teaming WorkshopBSides SG Practical Red Teaming Workshop
BSides SG Practical Red Teaming Workshop
Ajay Choudhary
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Tony Erwin
 
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster NodesWSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2
 

Similar to Getting Started with Consul (20)

Consul and docker swarm cluster
Consul and docker swarm clusterConsul and docker swarm cluster
Consul and docker swarm cluster
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
 
Consul and Consul Pusher
Consul and Consul PusherConsul and Consul Pusher
Consul and Consul Pusher
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
 
Monitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECSMonitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECS
 
BSides SG Practical Red Teaming Workshop
BSides SG Practical Red Teaming WorkshopBSides SG Practical Red Teaming Workshop
BSides SG Practical Red Teaming Workshop
 
HPC in the Cloud
HPC in the CloudHPC in the Cloud
HPC in the Cloud
 
Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...
Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...
Azure: Docker Container orchestration, PaaS ( Service Farbic ) and High avail...
 
How Easy to Automate Application Deployment on AWS
How Easy to Automate Application Deployment on AWSHow Easy to Automate Application Deployment on AWS
How Easy to Automate Application Deployment on AWS
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
 
Cloud inventory analytics Maestro server
Cloud inventory analytics   Maestro serverCloud inventory analytics   Maestro server
Cloud inventory analytics Maestro server
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 
Service Discovery with Consul - Arunvel Arunachalam
Service Discovery with Consul  - Arunvel Arunachalam Service Discovery with Consul  - Arunvel Arunachalam
Service Discovery with Consul - Arunvel Arunachalam
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
 
TechBeats #2
TechBeats #2TechBeats #2
TechBeats #2
 
Deploying couchbaseserverazure cihanbiyikoglu_microsoft
Deploying couchbaseserverazure cihanbiyikoglu_microsoftDeploying couchbaseserverazure cihanbiyikoglu_microsoft
Deploying couchbaseserverazure cihanbiyikoglu_microsoft
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster NodesWSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
WSO2 Dep Sync for Artifact Synchronization of Cluster Nodes
 

More from Ramit Surana

More from Ramit Surana (18)

Using Serverless Architectures to build and provision modern infrastructures​
Using Serverless Architectures to build and provision modern infrastructures​Using Serverless Architectures to build and provision modern infrastructures​
Using Serverless Architectures to build and provision modern infrastructures​
 
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
DEPLOYING WORDPRESS BLOG USING DOCKER COMPOSE & ANSIBLE ON AWS​
 
Introducing Vault
Introducing VaultIntroducing Vault
Introducing Vault
 
Building Digital Transaction Systems in the new Banking World
Building Digital Transaction Systems in the new Banking WorldBuilding Digital Transaction Systems in the new Banking World
Building Digital Transaction Systems in the new Banking World
 
Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016
 
Dependency management in golang
Dependency management in golangDependency management in golang
Dependency management in golang
 
Building Big Architectures
Building Big ArchitecturesBuilding Big Architectures
Building Big Architectures
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with Kubernetes
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOps
 
CoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux ContainersCoreOS: The Inside and Outside of Linux Containers
CoreOS: The Inside and Outside of Linux Containers
 
Introducing Docker Swarm - the orchestration tool by Docker
Introducing Docker Swarm - the orchestration tool by DockerIntroducing Docker Swarm - the orchestration tool by Docker
Introducing Docker Swarm - the orchestration tool by Docker
 
A brief study on Kubernetes and its components
A brief study on Kubernetes and its componentsA brief study on Kubernetes and its components
A brief study on Kubernetes and its components
 
Sysdig - Introducing a new definition of Monitoring
Sysdig - Introducing a new definition of MonitoringSysdig - Introducing a new definition of Monitoring
Sysdig - Introducing a new definition of Monitoring
 
Introducing Puppet - The faster speed of Automation
Introducing Puppet - The faster speed of AutomationIntroducing Puppet - The faster speed of Automation
Introducing Puppet - The faster speed of Automation
 
Introducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomenessIntroducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomeness
 
Canister
Canister Canister
Canister
 
Exploring Openstack Swift(Object Storage) and Swiftstack
Exploring Openstack Swift(Object Storage) and Swiftstack Exploring Openstack Swift(Object Storage) and Swiftstack
Exploring Openstack Swift(Object Storage) and Swiftstack
 

Recently uploaded

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Getting Started with Consul

  • 1. Getting Started with Consul Ramit Surana @ramitsurana /in/ramitsurana
  • 2. Agenda • Introduction • Consul Architecture • Raft Algorithm • Comparisons • Setup • How to use it ? • Bootstrapping and DNS • Jespen Testing • Consul on AWS
  • 3. Introduction • Tool for discovering and configuring a variety of different services in your infrastructure. • Built on Golang. • 3 basic ports: 8400 - RPC 8500 - HTTP 8600 - DNS
  • 4. Features • Service Discovery − Using either DNS or HTTP, applications can easily find the services they depend upon. • Health Check Status − It can provide any number of health checks. It is used by the service discovery components to route traffic away from unhealthy hosts. • Key/Value Store − It can make use of Consul's hierarchical key/value store for any number of purposes, including dynamic configuration, feature flagging, coordination, leader election, etc. • Multi Datacenter Deployment − Consul supports multiple datacenters. It is used for building additional layers of abstraction to grow to multiple regions. • Web UI − Consul provides its users a beautiful web interface using which it can be easy to use and manage all of the features in consul.
  • 7. Comparison between etcd, zookeeper & consul
  • 8. Setup • Download consul from https://www.consul.io/downloads.html • Extract binary package from the downloaded folder. $ cd Downloads $ chmod +x consul $ sudo mv consul /usr/bin/
  • 9. Consul-Template • Daemon that queries the Consul instance and updates any number of specified templates on the file system. • Download & Extract from https://releases.hashicorp.com/consul- template/. $ cd Downloads $ chmod +x consul-template $ sudo mv consul-template /usr/share/bin/
  • 10. Consul-UI • Divided into three important parts, which are − ACL − Set of Rules to easily lock your clusters easily Datacenter − Enables you to easily manage datacenters and work out with your cluster. Nodes − Quick update on the nodes that Consul cluster is using $ mkdir /opt/consul-ui $ cd /opt/consul-ui $ wget https://releases.hashicorp.com/consul/0.7.2/consul_0.7.2_web_ui.zip $ unzip consul_0.7.2_web_ui.zip $ sudo consul agent -dev -ui -data-dir /tmp/consul
  • 11. How to use it ? • //Running Consul $ sudo consul agent –dev –data-dir=/tmp/consul • // Listing members $ consul members • // Joining Nodes $ consul join <Node1><Node2> • // Using Docker $ docker run –p 8400:8400–p 8500:8500–p 8600:53/udp-h node1 progrium/consul - server -bootstrap
  • 12. How to use it ? • //Running Consul UI $ docker run –p 8400:8400–p 8500:8500–p 8600:53/udp-h node1 progrium/consul - server –bootstrap –ui-dir /ui • // Digging $ dig @127.0.0.1-p 8600 web.service.consul • // Monitor $ consul monitor • // Watch $ consul watch –type=service –service=consul
  • 13. How to use it ? • //Registering External Services on Consul $ sudo curl -X PUT -d '{"Datacenter": "dc1", "Node": "amazon", "Address": "www.amazon.com", "Service": {"Service": "shop", "Port": 80}}' http://127.0.0.1:8500/v1/catalog/register • // Removing External Service $ curl -X PUT -d '{"Datacenter": "dc1", "Node": "amazon"}' http://127.0.0.1:8500/v1/catalog/deregister • // Info $ sudo consul info
  • 14. Bootstrapping & DNS • Bootstrapping can be divided into 2 parts: Automatic Bootstrapping - Automatically configured to detect, identify and join nodes. Manual Bootstrapping – Manual addition of Nodes using below cmd $ consul join <Node B Address> <Node C Address> • DNS is served from port 53. The DNS forwarding can be done using BIND, dnsmasq and iptables. • Consul DNS interface makes the port information for a service available via the SRV records. • If Dnsmasq is installed - $ dig web.service.consul
  • 15. Jespen Testing • Tool written to test the partial tolerance and networking in any system. • Written in Clojure. • Tests the system by creating some random operations on the system. • For demo, Jepsen testing requires a huge level of cluster formation with database systems and hence is out of scope for demo
  • 16. Consul on AWS • URL: https://aws.amazon.com/quickstart/archit ecture/consul/ • create the following components − • A VPC with public and private subnets across three Availability Zones. • A Seed Consul server and a Seed client along with two Auto Scaling groups. • You can choose to create 3, 5, or 7 servers. The number of clients is set to three by default, but it is user-configurable. • Dnsmasq, which is installed and configured for Consul as part of the installation. • A Consul cluster using bootstrap_expect option.