SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Consul
by Hashicorp
Agenda
● Consul - overview
● Components
● Architecture
● REST endpoints
● REST for kv storage
● Libraries
● Demo of Consul and Consul Pusher
Consul is like combining the features of a DNS server plus
Consistent Key/Value Store like etcd plus features of ZooKeeper
for service discovery, and health monitoring like Nagios but all
rolled up into a consistent system.
Essentially, Consul is all the bits you need to have a coherent
domain service model available to provide service discovery, health
and replicated config, service topology and health status. Consul
also provides a nice REST interface and Web UI to see your service
topology and distributed service config.
Consul
▷ Service Discovery - give ability for services to register themselves and to
discover other services via a DNS or HTTP interface. Register external
services such as SaaS providers as well.
▷ Health Checking - can provide health checks associated with a given
service ("is the webserver returning 200 OK"), or with the local node ("is
memory utilization below 90%"). This information can be used by an operator
to monitor cluster health, and it is used by the service discovery components
to route traffic away from unhealthy hosts.
▷ Multi Datacenter - scales to multiple datacenters out of the box with no
complicated configuration This means users of Consul do not have to worry
about building additional layers of abstraction to grow to multiple regions.
▷ Key/Value Storage - hierarchical key/value store for any number of
purposes, including dynamic configuration, feature flagging, coordination,
leader election, and more. The simple HTTP API makes it easy to use.
Components
Architecture
Architecture #2
Agent - long running daemon on every member of the Consul cluster.
The agent is able to run in either client or server mode.
Server nodes are responsible for running the consensus protocol and
storing the cluster state. The client nodes are mostly stateless and rely
heavily on the server nodes.
All agents can run the DNS or HTTP interfaces, and are responsible
for running checks and keeping services in sync. The agent maintains
membership information, registers services, runs checks, responds to
queries, and more. The agent must run on every node that is part of a
Consul cluster.
▷ Client - agent that forwards all RPCs to a server.
▷ Server - agent with an expanded set of responsibilities like
maintaining cluster state, responding to RPC queries, forwarding
queries to leaders or remote data centers.
REST endpoints
■ kv - key value
■ agent - api for dealing with agent
■ catalog - dealing with data center catalog
■ health - show health checks
■ sessions - group operations and manage consistent view
■ events - fire fast gossip based events
■ acl - setup access control lists and security for Consul
■ status - check status
Each endpoint provides operations which either take JSON, request params and
deliver JSON responses.
REST for kv storage
Manages updates, deletes, fetches of individual keys or key prefixes.
▷ curl http://localhost:8500/v1/kv/dev?recurse => fetches all keys recursively
▷ curl http://localhost:8500/v1/kv/dev/db.username => fetches single key (#1)
Output #1
[{
"CreateIndex": 316,
"ModifyIndex": 316,
"LockIndex": 0,
"Key": "dev/db.username",
"Flags": 0,
"Value": "QlRfQ01T"
}]
CreateIndex - internal index value that represents when the entry was created
ModifyIndex - last index that modified this key.
LockIndex - how many times this key has successfully been acquired in a lock.
Key - full path of the entry.
Flags - unsigned integer that can be attached to each entry. Clients can choose to use this however makes sense
for their application.
Value - Base64-encoded blob of data. Note that values cannot be larger than 512kB.
Libraries
1. https://github.com/kdlan/jconsul
Has support for Spring and fallback strategy to file when key
does not exist in Consul, but it is not maintained since April 2015
2. http://www.cfg4j.org
Has fallback strategy in case of failure. Moreover it has
ReloadStrategy and PeriodicalReloadStrategy. Still maintained and
developed. Probably some effort needed to make it work within
Spring, but not huge.
3. https://github.com/Magnetme/consultant
Good library with minimal set of available settings options.
Demo of Consul Pusher
Consul Pusher from https://github.com/cfg4j/cfg4j-pusher which is a Spring Boot
app that pushes values from configuration files (YAML, properties, etc.) to Consul
KVs
I extended above project and pushed on GitHub by adding :
➢ Extract profile from file name (#1) or path otherwise (#2)
Ad.1. /projectName/properties/dev/database.properties
/projectName/properties/qa/database.properties
Ad.2. /projectName/properties/dev.properties
/projectName/properties/qa.properties
➢ Command line input using Apache Commons CLI
java -jar consul-pusher.jar -profile dev -key db.driver.class -value org.h2.Driver
PS. Need a change property in app called mode (file -> interactive)
GitHub => https://github.com/GarciaPL/ConsulPusher
Demo of Consul
docker run -d -p 8400:8400 -p 8500:8500 -p 8600:53/udp --name alfa -h alfa
-v /tmp/consul:/data progrium/consul -data-dir="/tmp/consul"
-server -bootstrap-expect 3 -ui-dir /ui
JOIN_IP="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' alfa)"
docker run -d --name bravo -h bravo progrium/consul -data-dir="/tmp/consul"
-server -join $JOIN_IP
docker run -d --name charlie -h charlie progrium/consul -data-dir="/tmp/consul"
-server -join $JOIN_IP
1) -data-dir used for persistence of KV’s, /ui used for enabling Web UI
2) -bootstrap-expect 3 specifies amount of servers needed for starting electing leader
3) Alfa will expose ports like 8400 (RPC), 8500 (HTTP) and 8600 (DNS)
Thanks!
Any questions ?
Thank you http://www.slidescarnival.com for layout!
References :
1. https://www.consul.io/intro/index.html
2. https://www.consul.io/docs/agent/http/kv.html
3. https://hub.docker.com/r/progrium/consul/
4. http://www.mammatustech.com/Microservice-Servi
ce-Discovery-with-Consul
5. https://launchpad.net/~bcandrea/+archive/ubuntu/
consul
6. https://imaginea.gitbooks.io/consul-devops-handbo
ok/content/
7. https://github.com/cfg4j/cfg4j-pusher
8. https://github.com/GarciaPL/ConsulPusher

Más contenido relacionado

La actualidad más candente

Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
Docker, Inc.
 
Spring Cloud and Netflix Components
Spring Cloud and Netflix ComponentsSpring Cloud and Netflix Components
Spring Cloud and Netflix Components
Dharshan Sastry B N
 

La actualidad más candente (20)

Microservices with docker swarm and consul
Microservices with docker swarm and consulMicroservices with docker swarm and consul
Microservices with docker swarm and consul
 
2019 hashiconf consul-templaterb
2019 hashiconf consul-templaterb2019 hashiconf consul-templaterb
2019 hashiconf consul-templaterb
 
Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
 
Spring Cloud and Netflix Components
Spring Cloud and Netflix ComponentsSpring Cloud and Netflix Components
Spring Cloud and Netflix Components
 
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
Microservices + Events + Docker = A Perfect Trio by Docker Captain Chris Rich...
 
Architecting for Microservices Part 2
Architecting for Microservices Part 2Architecting for Microservices Part 2
Architecting for Microservices Part 2
 
Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1Spring Cloud and Netflix OSS overview v1
Spring Cloud and Netflix OSS overview v1
 
Service Discovery Like a Pro
Service Discovery Like a ProService Discovery Like a Pro
Service Discovery Like a Pro
 
2019 hashiconf seattle_consul_ioc
2019 hashiconf seattle_consul_ioc2019 hashiconf seattle_consul_ioc
2019 hashiconf seattle_consul_ioc
 
Spring cloud Service-Discovery
Spring cloud Service-DiscoverySpring cloud Service-Discovery
Spring cloud Service-Discovery
 
Building Microservices with Spring Cloud and Netflix OSS
Building Microservices with Spring Cloud and Netflix OSSBuilding Microservices with Spring Cloud and Netflix OSS
Building Microservices with Spring Cloud and Netflix OSS
 
Building a Cloud Native Service - Docker Meetup Santa Clara (July 20, 2017)
Building a Cloud Native Service - Docker Meetup Santa Clara (July 20, 2017)Building a Cloud Native Service - Docker Meetup Santa Clara (July 20, 2017)
Building a Cloud Native Service - Docker Meetup Santa Clara (July 20, 2017)
 
New Features of Kubernetes v1.2.0 beta
New Features of Kubernetes v1.2.0 betaNew Features of Kubernetes v1.2.0 beta
New Features of Kubernetes v1.2.0 beta
 
Container Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and KubernetesContainer Orchestration with Docker Swarm and Kubernetes
Container Orchestration with Docker Swarm and Kubernetes
 
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSSMicroservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
 
2019 Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
2019  Lightning Talk: Discovery, Consul and Inversion of Control for the infr...2019  Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
2019 Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
 
fabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShiftfabric8 ... and Docker, Kubernetes & OpenShift
fabric8 ... and Docker, Kubernetes & OpenShift
 
Know your app: Add metrics to Java with Micrometer | DevNation Tech Talk
Know your app: Add metrics to Java with Micrometer | DevNation Tech TalkKnow your app: Add metrics to Java with Micrometer | DevNation Tech Talk
Know your app: Add metrics to Java with Micrometer | DevNation Tech Talk
 
Setup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes FederationSetup Hybrid Clusters Using Kubernetes Federation
Setup Hybrid Clusters Using Kubernetes Federation
 
Events and metrics the Lifeblood of Webops
Events and metrics the Lifeblood of WebopsEvents and metrics the Lifeblood of Webops
Events and metrics the Lifeblood of Webops
 

Destacado

Destacado (10)

Packer by HashiCorp
Packer by HashiCorpPacker by HashiCorp
Packer by HashiCorp
 
Mutation testing
Mutation testingMutation testing
Mutation testing
 
Owner - Java properties reinvented.
Owner - Java properties reinvented.Owner - Java properties reinvented.
Owner - Java properties reinvented.
 
How to write your database: the story about Event Store
How to write your database: the story about Event StoreHow to write your database: the story about Event Store
How to write your database: the story about Event Store
 
A Introduction of Packer
A Introduction of PackerA Introduction of Packer
A Introduction of Packer
 
CQRS and Event Sourcing with MongoDB and PHP
CQRS and Event Sourcing with MongoDB and PHPCQRS and Event Sourcing with MongoDB and PHP
CQRS and Event Sourcing with MongoDB and PHP
 
Angular 2 interview questions and answers
Angular 2 interview questions and answersAngular 2 interview questions and answers
Angular 2 interview questions and answers
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps begins
 
Microservices and SOA
Microservices and SOAMicroservices and SOA
Microservices and SOA
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
 

Similar a Consul and Consul Pusher

Similar a Consul and Consul Pusher (20)

Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
 
Kubernetes acomprehensiveoverview
Kubernetes acomprehensiveoverviewKubernetes acomprehensiveoverview
Kubernetes acomprehensiveoverview
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
 
(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview(Draft) Kubernetes - A Comprehensive Overview
(Draft) Kubernetes - A Comprehensive Overview
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Consul and docker swarm cluster
Consul and docker swarm clusterConsul and docker swarm cluster
Consul and docker swarm cluster
 
Kubernetes PPT.pptx
Kubernetes PPT.pptxKubernetes PPT.pptx
Kubernetes PPT.pptx
 
08 - kubernetes.pptx
08 - kubernetes.pptx08 - kubernetes.pptx
08 - kubernetes.pptx
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Container Orchestration using kubernetes
Container Orchestration using kubernetesContainer Orchestration using kubernetes
Container Orchestration using kubernetes
 
Chef
ChefChef
Chef
 
Streaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit LogStreaming Processing with a Distributed Commit Log
Streaming Processing with a Distributed Commit Log
 
MidSem
MidSemMidSem
MidSem
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
 
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-orsCharacterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
Characterizing and contrasting kuhn tey-ner awr-kuh-streyt-ors
 
KrakenD API Gateway
KrakenD API GatewayKrakenD API Gateway
KrakenD API Gateway
 
Confluent Tech Talk Korea
Confluent Tech Talk KoreaConfluent Tech Talk Korea
Confluent Tech Talk Korea
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with A...
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Consul and Consul Pusher

  • 2. Agenda ● Consul - overview ● Components ● Architecture ● REST endpoints ● REST for kv storage ● Libraries ● Demo of Consul and Consul Pusher
  • 3. Consul is like combining the features of a DNS server plus Consistent Key/Value Store like etcd plus features of ZooKeeper for service discovery, and health monitoring like Nagios but all rolled up into a consistent system. Essentially, Consul is all the bits you need to have a coherent domain service model available to provide service discovery, health and replicated config, service topology and health status. Consul also provides a nice REST interface and Web UI to see your service topology and distributed service config. Consul
  • 4. ▷ Service Discovery - give ability for services to register themselves and to discover other services via a DNS or HTTP interface. Register external services such as SaaS providers as well. ▷ Health Checking - can provide health checks associated with a given service ("is the webserver returning 200 OK"), or with the local node ("is memory utilization below 90%"). This information can be used by an operator to monitor cluster health, and it is used by the service discovery components to route traffic away from unhealthy hosts. ▷ Multi Datacenter - scales to multiple datacenters out of the box with no complicated configuration This means users of Consul do not have to worry about building additional layers of abstraction to grow to multiple regions. ▷ Key/Value Storage - hierarchical key/value store for any number of purposes, including dynamic configuration, feature flagging, coordination, leader election, and more. The simple HTTP API makes it easy to use. Components
  • 6. Architecture #2 Agent - long running daemon on every member of the Consul cluster. The agent is able to run in either client or server mode. Server nodes are responsible for running the consensus protocol and storing the cluster state. The client nodes are mostly stateless and rely heavily on the server nodes. All agents can run the DNS or HTTP interfaces, and are responsible for running checks and keeping services in sync. The agent maintains membership information, registers services, runs checks, responds to queries, and more. The agent must run on every node that is part of a Consul cluster. ▷ Client - agent that forwards all RPCs to a server. ▷ Server - agent with an expanded set of responsibilities like maintaining cluster state, responding to RPC queries, forwarding queries to leaders or remote data centers.
  • 7. REST endpoints ■ kv - key value ■ agent - api for dealing with agent ■ catalog - dealing with data center catalog ■ health - show health checks ■ sessions - group operations and manage consistent view ■ events - fire fast gossip based events ■ acl - setup access control lists and security for Consul ■ status - check status Each endpoint provides operations which either take JSON, request params and deliver JSON responses.
  • 8. REST for kv storage Manages updates, deletes, fetches of individual keys or key prefixes. ▷ curl http://localhost:8500/v1/kv/dev?recurse => fetches all keys recursively ▷ curl http://localhost:8500/v1/kv/dev/db.username => fetches single key (#1) Output #1 [{ "CreateIndex": 316, "ModifyIndex": 316, "LockIndex": 0, "Key": "dev/db.username", "Flags": 0, "Value": "QlRfQ01T" }] CreateIndex - internal index value that represents when the entry was created ModifyIndex - last index that modified this key. LockIndex - how many times this key has successfully been acquired in a lock. Key - full path of the entry. Flags - unsigned integer that can be attached to each entry. Clients can choose to use this however makes sense for their application. Value - Base64-encoded blob of data. Note that values cannot be larger than 512kB.
  • 9. Libraries 1. https://github.com/kdlan/jconsul Has support for Spring and fallback strategy to file when key does not exist in Consul, but it is not maintained since April 2015 2. http://www.cfg4j.org Has fallback strategy in case of failure. Moreover it has ReloadStrategy and PeriodicalReloadStrategy. Still maintained and developed. Probably some effort needed to make it work within Spring, but not huge. 3. https://github.com/Magnetme/consultant Good library with minimal set of available settings options.
  • 10. Demo of Consul Pusher Consul Pusher from https://github.com/cfg4j/cfg4j-pusher which is a Spring Boot app that pushes values from configuration files (YAML, properties, etc.) to Consul KVs I extended above project and pushed on GitHub by adding : ➢ Extract profile from file name (#1) or path otherwise (#2) Ad.1. /projectName/properties/dev/database.properties /projectName/properties/qa/database.properties Ad.2. /projectName/properties/dev.properties /projectName/properties/qa.properties ➢ Command line input using Apache Commons CLI java -jar consul-pusher.jar -profile dev -key db.driver.class -value org.h2.Driver PS. Need a change property in app called mode (file -> interactive) GitHub => https://github.com/GarciaPL/ConsulPusher
  • 11. Demo of Consul docker run -d -p 8400:8400 -p 8500:8500 -p 8600:53/udp --name alfa -h alfa -v /tmp/consul:/data progrium/consul -data-dir="/tmp/consul" -server -bootstrap-expect 3 -ui-dir /ui JOIN_IP="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' alfa)" docker run -d --name bravo -h bravo progrium/consul -data-dir="/tmp/consul" -server -join $JOIN_IP docker run -d --name charlie -h charlie progrium/consul -data-dir="/tmp/consul" -server -join $JOIN_IP 1) -data-dir used for persistence of KV’s, /ui used for enabling Web UI 2) -bootstrap-expect 3 specifies amount of servers needed for starting electing leader 3) Alfa will expose ports like 8400 (RPC), 8500 (HTTP) and 8600 (DNS)
  • 12. Thanks! Any questions ? Thank you http://www.slidescarnival.com for layout! References : 1. https://www.consul.io/intro/index.html 2. https://www.consul.io/docs/agent/http/kv.html 3. https://hub.docker.com/r/progrium/consul/ 4. http://www.mammatustech.com/Microservice-Servi ce-Discovery-with-Consul 5. https://launchpad.net/~bcandrea/+archive/ubuntu/ consul 6. https://imaginea.gitbooks.io/consul-devops-handbo ok/content/ 7. https://github.com/cfg4j/cfg4j-pusher 8. https://github.com/GarciaPL/ConsulPusher