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
700
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
330
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
1.9k
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
Claude Codeは仕様駆動の夢を見ない
gotalab555
23
7.1k
工業高校で学習したとあるエンジニアのキャリアの話
shirayanagiryuji
0
120
ウォンテッドリーのアラート設計と Datadog 移行での知見
donkomura
0
130
Amazon GuardDuty での脅威検出:脅威検出の実例から学ぶ
kintotechdev
0
130
Amazon Qで2Dゲームを作成してみた
siromi
0
170
Amazon Bedrock AgentCoreのフロントエンドを探す旅 (Next.js編)
kmiya84377
1
160
Delegate authentication and a lot more to Keycloak with OpenID Connect
ahus1
0
240
AI時代の大規模データ活用とセキュリティ戦略
ken5scal
1
200
Kiro と Q Dev で 同じゲームを作らせてみた
r3_yamauchi
PRO
1
120
アカデミーキャンプ 2025 SuuuuuuMMeR「燃えろ!!ロボコン」 / Academy Camp 2025 SuuuuuuMMeR "Burn the Spirit, Robocon!!" DAY 1
ks91
PRO
0
150
Exadata Database Service on Dedicated Infrastructure セキュリティ、ネットワーク、および管理について
oracle4engineer
PRO
1
320
Rethinking Incident Response: Context-Aware AI in Practice - Incident Buddy Edition -
rrreeeyyy
0
110
Featured
See All Featured
Site-Speed That Sticks
csswizardry
10
770
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
Six Lessons from altMBA
skipperchong
28
4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.3k
What's in a price? How to price your products and services
michaelherold
246
12k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
The Cost Of JavaScript in 2023
addyosmani
53
8.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Statistics for Hackers
jakevdp
799
220k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
Unsuck your backbone
ammeep
671
58k
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/