Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Centralized Configuration using Consul and Spring Cloud
Search
Eko Kurniawan Khannedy
February 12, 2018
Technology
2
570
Centralized Configuration using Consul and Spring Cloud
Centralized Configuration using Consul and Spring Cloud
Eko Kurniawan Khannedy
February 12, 2018
Tweet
Share
More Decks by Eko Kurniawan Khannedy
See All by Eko Kurniawan Khannedy
Monolith to Event-Driven Microservices
khannedy
1
220
Refactoring
khannedy
0
290
Multi-Datacenter Kafka at Blibli.com
khannedy
2
1.5k
QA Tools - Research and Development
khannedy
0
260
Reactive Puzzle
khannedy
0
190
Event-Driven Architecture
khannedy
1
1.7k
Resilience Engineering with Hystrix and Spring
khannedy
1
540
Mocking for Unit Test using Mockito
khannedy
1
310
Validation Best Practice
khannedy
2
1.2k
Other Decks in Technology
See All in Technology
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
2.1k
ServiceNow Knowledge Learning Rise up
manarobot
0
210
家族アルバム みてねにおけるGrafana活用術 / Grafana Meetup Japan Vol.1 LT
isaoshimizu
1
820
Postman v10リリース後を振り返る / Looking back at Postman v10 after release
yokawasa
1
160
非同期推論システムによるコスト削減と信頼性向上
koki_nishihara
0
270
Cracking the KubeCon CfP
inductor
2
250
JSON攻略法.pdf
miyakemito
8
5.1k
APIファーストなプロダクトマネジメントの実践 〜SaaSus Platformでの例〜 / "Practicing API-First Product Management - An Example with SaaSus Platform
oztick139
0
110
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
4
16k
Google Cloud Next '24 Recap(Cloud Run/k8s)
mokocm
0
250
Python と Snowflake はズッ友だょ!~ Snowflake の Python 関連機能をふりかえる ~
__allllllllez__
1
120
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
570
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
331
56k
Optimising Largest Contentful Paint
csswizardry
8
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
17
6.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
320
23k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
659
120k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
79
43k
Statistics for Hackers
jakevdp
789
220k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
19
1.7k
Faster Mobile Websites
deanohume
299
30k
Web Components: a chance to create the future
zenorocha
305
41k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
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/