Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Centralized Configuration using Consul and Spri...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Eko Kurniawan Khannedy
February 12, 2018
Technology
750
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Centralized Configuration using Consul and Spring Cloud
Centralized Configuration using Consul and Spring Cloud
Eko Kurniawan Khannedy
February 12, 2018
More Decks by Eko Kurniawan Khannedy
See All by Eko Kurniawan Khannedy
Monolith to Event-Driven Microservices
khannedy
1
280
Refactoring
khannedy
0
380
Multi-Datacenter Kafka at Blibli.com
khannedy
2
1.6k
QA Tools - Research and Development
khannedy
0
320
Reactive Puzzle
khannedy
0
230
Event-Driven Architecture
khannedy
1
2.1k
Resilience Engineering with Hystrix and Spring
khannedy
1
600
Mocking for Unit Test using Mockito
khannedy
1
370
Validation Best Practice
khannedy
2
1.3k
Other Decks in Technology
See All in Technology
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
360
QAエンジニアがSoutherを使ってみたの〜10分でわかるSouther〜
mhlyc
0
110
Browser Spec: Testing Hotwire with Ruby
takahashim
1
170
価値について
gree_tech
PRO
0
150
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
390
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
140
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
2
390
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
160
顧客価値を追いかけたら、プライシングにたどり着いた
sansantech
PRO
2
730
Refining Active Record
shugo
0
200
Kiro Crewで「みのるん式」仕事術やってみた
minorun365
PRO
3
1.1k
企画を Software Factory-ready にする——開発が高速になったとき、PdMの仕事はどう変わったか
yachibit
1
170
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Embracing the Ebb and Flow
colly
88
5.2k
Designing Powerful Visuals for Engaging Learning
tmiket
1
610
Optimizing for Happiness
mojombo
378
71k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
Six Lessons from altMBA
skipperchong
29
4.5k
Between Models and Reality
mayunak
4
500
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.9k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
570
Facilitating Awesome Meetings
lara
57
7.2k
Transcript
CENTRALIZED CONFIGURATION USING CONSUL AND SPRING CLOUD
CENTRALIZED CONFIGURATION EKO KURNIAWAN KHANNEDY ▸ Principal R&D Engineer at
Blibli.com ▸ Part of R&D Team at Blibli.com ▸
[email protected]
CENTRALIZED CONFIGURATION AGENDA ▸ Consul ▸ Spring Cloud ▸ Demo
CONSUL CENTRALIZED CONFIGURATION
None
CENTRALIZED CONFIGURATION WHAT IS CONSUL? ▸ Service Discovery (via DNS
or HTTP) ▸ Failure Detection (health checking) ▸ Key-Value Storage (for dynamic configuration) ▸ Multi Datacenter
CENTRALIZED CONFIGURATION CONSUL CLUSTER ARCHITECTURE ▸ Datacenter ▸ Agent, a
the long running daemon on every member of the Consul cluster ▸ Server, an agent with an expanded set of responsibilities ▸ Client, an agent that forwards all RPCs to a server
CENTRALIZED CONFIGURATION SETUP CONSUL CLUSTER IP Address Role 192.0.0.1 Bootstrap
Consul Server 192.0.0.2 Consul Server 192.0.0.3 Consul Server
CENTRALIZED CONFIGURATION SETUP CONSUL SERVER 1 (BOOTSTRAP) { “bootstrap”: true,
“server”: true, “datacenter”: “blibli", “data_dir”: “/opt/var/consul”, “log_level”: “INFO”, “bind_addr” : “192.0.0.1”, “client_addr” : “192.0.0.1” }
CENTRALIZED CONFIGURATION SETUP CONSUL SERVER 2 { “bootstrap”: false, “server”:
true, “datacenter”: “blibli", “data_dir”: “/opt/var/consul”, “log_level”: “INFO”, “bind_addr” : “192.0.0.2”, “client_addr” : “192.0.0.2”, “start_join” : [ “192.0.0.1”, “192.0.0.3” ] }
CENTRALIZED CONFIGURATION SETUP CONSUL SERVER 3 { “bootstrap”: false, “server”:
true, “datacenter”: “blibli", “data_dir”: “/opt/var/consul”, “log_level”: “INFO”, “bind_addr” : “192.0.0.3”, “client_addr” : “192.0.0.3”, “start_join” : [ “192.0.0.1”, “192.0.0.2” ] }
CENTRALIZED CONFIGURATION SETUP CONSUL CLIENT { “server”: false, “datacenter”: “blibli",
“data_dir”: “/opt/var/consul”, “log_level”: “INFO”, “bind_addr” : “192.0.1.1”, “client_addr” : “192.0.1.1”, “start_join” : [ “192.0.0.1”, “192.0.0.2”, “192.0.0.3” ] }
CENTRALIZED CONFIGURATION START CONSUL AGENT consul agent -ui -config-dir /opt/consul/config
▸ All consul configuration saved as json file in a directory. ▸ Consul automatically read all json file in config directory.
CENTRALIZED CONFIGURATION
SPRING CLOUD CENTRALIZED CONFIGURATION
CENTRALIZED CONFIGURATION ADD CONSUL DEPENDENCY <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-consul-config</artifactId> </dependency>
CENTRALIZED CONFIGURATION ADD CONSUL CONFIGURATION (BOOTSTRAP.PROPERTIES) spring.application.name=blibli-demo spring.cloud.consul.config.fail-fast=true spring.cloud.consul.host=localhost spring.cloud.consul.port=8500
DEMO
CENTRALIZED CONFIGURATION REFERENCES ▸ https://www.consul.io/ ▸ https://cloud.spring.io/spring-cloud-config/ ▸ https://cloud.spring.io/spring-cloud-consul/ ▸
https://spring.io/guides/gs/centralized-configuration/