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 Spri...
Search
Eko Kurniawan Khannedy
February 12, 2018
Technology
2
710
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
260
Refactoring
khannedy
0
340
Multi-Datacenter Kafka at Blibli.com
khannedy
2
1.5k
QA Tools - Research and Development
khannedy
0
280
Reactive Puzzle
khannedy
0
200
Event-Driven Architecture
khannedy
1
2k
Resilience Engineering with Hystrix and Spring
khannedy
1
560
Mocking for Unit Test using Mockito
khannedy
1
340
Validation Best Practice
khannedy
2
1.3k
Other Decks in Technology
See All in Technology
OSSで50の競合と戦うためにやったこと
yamadashy
3
990
NLPコロキウム20251022_超効率化への挑戦: LLM 1bit量子化のロードマップ
yumaichikawa
3
490
AI時代の開発を加速する組織づくり - ブログでは書けなかったリアル
hiro8ma
1
320
Observability — Extending Into Incident Response
nari_ex
1
440
20251027_マルチエージェントとは
almondo_event
1
440
.NET 10のBlazorの期待の新機能
htkym
0
110
個人でデジタル庁の デザインシステムをVue.jsで 作っている話
nishiharatsubasa
3
5.1k
ソースを読む時の思考プロセスの例-MkDocs
sat
PRO
1
200
Biz職でもDifyでできる! 「触らないAIワークフロー」を実現する方法
igarashikana
7
3.4k
ストレージエンジニアの仕事と、近年の計算機について / 第58回 情報科学若手の会
pfn
PRO
3
850
Retrospectiveを振り返ろう
nakasho
0
110
20251027_findyさん_音声エージェントLT
almondo_event
2
440
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Build your cross-platform service in a week with App Engine
jlugia
233
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
A designer walks into a library…
pauljervisheath
209
24k
The World Runs on Bad Software
bkeepers
PRO
72
11k
YesSQL, Process and Tooling at Scale
rocio
173
15k
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 ▸ eko.k.khannedy@gdn-commerce.com
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/