SlideShare uma empresa Scribd logo
1 de 37
CONFIGURATION
MANAGEMENT
SPRING-CLOUD
FROM SPIKE
IMPLEMENT WAYS
• Spring-Cloud-Config
• Spring-Cloud-Config + MySQL
• Spring-Cloud-Config + MySQL Standalone
WHAT IS IT ?
SPRING-CLOUD-CONFIG
• Spring Cloud Config provides server and client-side support
for externalized configuration in a distributed system.
• With the Config Server you have a central place to manage
external properties for applications across all environments.
• The concepts on both client and server map identically to
the Spring Environment and PropertySource abstractions,
so they fit very well with Spring applications, but can be
used with any application running in any language.
• As an application moves through the deployment pipeline
from dev to test and into production you can manage the
configuration between those environments and be certain
that applications have everything they need to run when
they migrate.
• The default implementation of the server storage backend
uses git so it easily supports labelled versions of
configuration environments, as well as being accessible to
a wide range of tooling for managing the content.
• It is easy to add alternative implementations and plug them
in with Spring configuration.
SPRING-CLOUD-CONFIG
FIRST WAY
• Spring-cloud-config-server
• Spring-cloud-config-client
• GIT repository
SPRING-CLOUD-CONFIG
FIRST WAY
• For Server
• Create project as a spring-boot
SPRING-CLOUD-CONFIG
FIRST WAY
• Add library spring-cloud-
config-server
• Set Git-URI
• Add annotation
@EnableConfigServer
• Run application
SPRING-CLOUD-CONFIG
FIRST WAY
• file on Git repository
keep as plain files
• file name is {project-
name}-{envi}.properties
• If no set envi that means
use “default”
SPRING-CLOUD-CONFIG
FIRST WAY
• curl localhost:8888/foo/development
SPRING-CLOUD-CONFIG
FIRST WAY
The HTTP service has resources in the form.
• /{application}/{profile}[/{label}]
/foo/development
/ppc-service/alpha
• /{application}-{profile}.yml
• /{label}/{application}-{profile}.yml
• /{application}-{profile}.properties
• /{label}/{application}-{profile}.properties
SPRING-CLOUD-CONFIG
FIRST WAY
• {application} maps to "spring.application.name" on the client side;
• {profile} maps to "spring.profiles.active" on the client (comma
separated list);
• {label} which is a server side feature labelling a "versioned" set of
config files.It is an optional git label (defaults to "master".)
SPRING-CLOUD-CONFIG
FIRST WAY
SPRING-CLOUD-CONFIG
FIRST WAY
• For Client
• Create project as a spring-boot
SPRING-CLOUD-CONFIG
FIRST WAY
• Add library spring-cloud-
client-config
• Add library actuator
• Set spring-project-name
• Set spring-config-server
SPRING-CLOUD-CONFIG
FIRST WAY
• Should run with Active
profiles (It will be set as
environment)
• Or set
“spring.profiles.active” in
properties file
• Or run ‘mvn spring-boot:run
-Drun.jvmArguments=“-
Dspring.profiles.active=pro
duction" ‘
SPRING-CLOUD-CONFIG
FIRST WAY
Refreshing
• The class below shows how you
can use the 'Actuator' to update
running clients with a new
configuration.
• Use @RefreshScope when we
need to change properties on the
fly
• Can’t use @RefreshScope with
@Configuration , They will
conflicted
• Use @Component instead
@Configuration for Bean creation
FIRST WAY
SPRING-CLOUD-CONFIG
SPRING-CLOUD-CONFIG
FIRST WAY
• POST /refresh to client for
getting pull configuration
• Can auto refresh configuration
by scheduling
SPRING-CLOUD-CONFIG
FIRST WAY
Pro
- Can track the history of config with git repository (when, who, where)
- It already have module for management environment
- Zero down time
- Easy to setup
Con
- May be found human error editing the config with wrong
environment
- If this server have config many projects or many keyword then It’s
hard to find them
- Single point of failure
SPRING-CLOUD-CONFIG + MYSQL
SECOND WAY
• Spring-boot as a server
• Spring-cloud-config-client
• MySQL
SPRING-CLOUD-CONFIG + MYSQL
SECOND WAY
• For Server
• Create project as a spring-boot
• Connect with Database
SPRING-CLOUD-CONFIG + MYSQL
SECOND WAY
• Make API Response like spring-config-server
SPRING-CLOUD-CONFIG + MYSQL
SECOND WAY
• Prototype Database
SPRING-CLOUD-CONFIG + MYSQL
SECOND WAY
• For Client
• Create project as a spring-boot
• Add library spring-cloud-config
• Set spring-project-name
• Set spring-config-server
SPRING-CLOUD-CONFIG + MYSQL
SECOND WAY
Pro
- Easy to searching the configuration with SQL script
- Use SQL (Most developers can use SQL)
- No zero down time while changing config
Con
- Single point of failure
- It’s must strict the pattern same spring cloud
- supported only spring properties (can’t keep JSON type)
- Developer should coding the client-lib (Can resolved it with spring cloud)
- When accident configuration changed It need DBA to find the root cause
- Need admin report to changing configuration
SPRING-CLOUD-CONFIG + MYSQL (STNLN)
THIRD WAY
• Spring-cloud-config-client + server
• MySQL
SPRING-CLOUD-CONFIG + MYSQL (STNLN)
THIRD WAY
• Create project as a spring-boot
• Connect with Database
SPRING-CLOUD-CONFIG + MYSQL (STNLN)
THIRD WAY
• Add library spring-cloud-
client-config
• Add library actuator
• Set spring-project-name
• Set spring-config-server :
Itself URI
SPRING-CLOUD-CONFIG + MYSQL (STNLN)
THIRD WAY
• Make API Response like spring-config-server
SPRING-CLOUD-CONFIG + MYSQL (STNLN)
THIRD WAY
Pro
- Config each application
- Use SQL (Most developers can use SQL)
- No zero down time while changing config
Con
- Detour calling method update config
- Application push effort to find the configuration from database
- Need same table fix in database for each applications
- When accident configuration changed It need DBA to find the root cause
- Need admin report to changing configuration
WHY NOT
CAN ALL CONFIGS ARE EXTERNAL?
• Try to find a victim project
• Set config server
• Set name of application
• delete spring.datasource.url
WHY NOT
CAN ALL CONFIGS ARE EXTERNAL?
• Add spring.datasource.url in
Database for server
• Run!
• Client will get data from server
first
• If key is required,and
you didn’t set then application
will be got error same key in
properties is not found
• Can’t change database.url on
the fly(need restart)
YES
CAN ALMOST KEYS GET FROM SERVER?
• Remain keys at least
• Some keys can not load from
server
• Some keys use as bootstrap
YES
CAN ALMOST KEYS GET FROM SERVER?
• Add keys into database
CAN REMOVE BUILT-IN CONFIG?
YES
HAVE TO IMPLEMENT MORE
• Security (access server)
• Encryption password
• Web admin
• Board cast config to client
REFERENCE
• https://cloud.spring.io/spring-cloud-config/spring-cloud-config.html
• https://github.com/ehdez73/minionize-the-world
• http://www.javaworld.com/article/2927920/cloud-computing/build-
self-healing-distributed-systems-with-spring-cloud.html
• http://nobodyiam.com/2016/04/02/dive-into-spring-cloud-config/

Mais conteúdo relacionado

Mais procurados

Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training Patrick Schroeder
 
Introduction to Spring Cloud
Introduction to Spring Cloud           Introduction to Spring Cloud
Introduction to Spring Cloud VMware Tanzu
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationWebStackAcademy
 
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introductionJonathan Holloway
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...Yevgeniy Brikman
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)
Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)
Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)Adin Ermie
 
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)Amazon Web Services Korea
 

Mais procurados (20)

Spring Boot
Spring BootSpring Boot
Spring Boot
 
Angular 2 Essential Training
Angular 2 Essential Training Angular 2 Essential Training
Angular 2 Essential Training
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Introduction to Spring Cloud
Introduction to Spring Cloud           Introduction to Spring Cloud
Introduction to Spring Cloud
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and Authorization
 
Spring boot
Spring bootSpring boot
Spring boot
 
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
오토스케일링 제대로 활용하기 (김일호) - AWS 웨비나 시리즈 2015
 
Angular
AngularAngular
Angular
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Spring boot - an introduction
Spring boot - an introductionSpring boot - an introduction
Spring boot - an introduction
 
(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)
Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)
Infrastructure-as-Code (IaC) Using Terraform (Intermediate Edition)
 
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)
마이크로 서비스를 위한 AWS Cloud Map & App Mesh - Saeho Kim (AWS Solutions Architect)
 
Spring boot
Spring bootSpring boot
Spring boot
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
Java Spring
Java SpringJava Spring
Java Spring
 

Semelhante a Spring Cloud Config

Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...Nikhil Hiremath
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSharon James
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administratorsSharon James
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01Scott Miao
 
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueCloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueShapeBlue
 
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode DeployDeploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode DeployIBM DevOps
 
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode DeployDeploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode DeployClaudia Ring
 
AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo  AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo Amazon Web Services
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksAmazon Web Services
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudAndrew Coleman
 
Spring Cloud: API gateway upgrade & configuration in the cloud
Spring Cloud: API gateway upgrade & configuration in the cloudSpring Cloud: API gateway upgrade & configuration in the cloud
Spring Cloud: API gateway upgrade & configuration in the cloudOrkhan Gasimov
 
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...Databricks
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileWASdev Community
 
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon DrangeHåkon Eriksen Drange
 
Priming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the CloudPriming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the CloudMatt Callanan
 
Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)ThirdWaveInsights
 
Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015Chef
 
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James BroadheadMongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James BroadheadMongoDB
 
MLflow Model Serving
MLflow Model ServingMLflow Model Serving
MLflow Model ServingDatabricks
 
MLflow Model Serving - DAIS 2021
MLflow Model Serving - DAIS 2021MLflow Model Serving - DAIS 2021
MLflow Model Serving - DAIS 2021amesar0
 

Semelhante a Spring Cloud Config (20)

Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
 
Sa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administratorsSa106 – practical solutions for connections administrators
Sa106 – practical solutions for connections administrators
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01
 
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlueCloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
CloudStack Tooling Ecosystem – Kiran Chavala, ShapeBlue
 
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode DeployDeploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
 
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode DeployDeploying to and Configuring WebSphere Application Server with UrbanCode Deploy
Deploying to and Configuring WebSphere Application Server with UrbanCode Deploy
 
AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo  AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo
 
Configuration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech TalksConfiguration Management in the Cloud - AWS Online Tech Talks
Configuration Management in the Cloud - AWS Online Tech Talks
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the Cloud
 
Spring Cloud: API gateway upgrade & configuration in the cloud
Spring Cloud: API gateway upgrade & configuration in the cloudSpring Cloud: API gateway upgrade & configuration in the cloud
Spring Cloud: API gateway upgrade & configuration in the cloud
 
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...
Serverless Machine Learning on Modern Hardware Using Apache Spark with Patric...
 
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty ProfileAAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
AAI-3218 Production Deployment Best Practices for WebSphere Liberty Profile
 
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
2016-02-09 - Breakfast Seminar - Redpill Linpro - Chef at Aptoma - Håkon Drange
 
Priming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the CloudPriming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the Cloud
 
Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients (ChefConf 2015)
 
Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015Serve Meals, Not Ingredients - ChefConf 2015
Serve Meals, Not Ingredients - ChefConf 2015
 
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James BroadheadMongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James Broadhead
 
MLflow Model Serving
MLflow Model ServingMLflow Model Serving
MLflow Model Serving
 
MLflow Model Serving - DAIS 2021
MLflow Model Serving - DAIS 2021MLflow Model Serving - DAIS 2021
MLflow Model Serving - DAIS 2021
 

Último

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Último (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

Spring Cloud Config

  • 2. FROM SPIKE IMPLEMENT WAYS • Spring-Cloud-Config • Spring-Cloud-Config + MySQL • Spring-Cloud-Config + MySQL Standalone
  • 3. WHAT IS IT ? SPRING-CLOUD-CONFIG • Spring Cloud Config provides server and client-side support for externalized configuration in a distributed system. • With the Config Server you have a central place to manage external properties for applications across all environments. • The concepts on both client and server map identically to the Spring Environment and PropertySource abstractions, so they fit very well with Spring applications, but can be used with any application running in any language. • As an application moves through the deployment pipeline from dev to test and into production you can manage the configuration between those environments and be certain that applications have everything they need to run when they migrate. • The default implementation of the server storage backend uses git so it easily supports labelled versions of configuration environments, as well as being accessible to a wide range of tooling for managing the content. • It is easy to add alternative implementations and plug them in with Spring configuration.
  • 4. SPRING-CLOUD-CONFIG FIRST WAY • Spring-cloud-config-server • Spring-cloud-config-client • GIT repository
  • 5. SPRING-CLOUD-CONFIG FIRST WAY • For Server • Create project as a spring-boot
  • 6. SPRING-CLOUD-CONFIG FIRST WAY • Add library spring-cloud- config-server • Set Git-URI • Add annotation @EnableConfigServer • Run application
  • 7. SPRING-CLOUD-CONFIG FIRST WAY • file on Git repository keep as plain files • file name is {project- name}-{envi}.properties • If no set envi that means use “default”
  • 8. SPRING-CLOUD-CONFIG FIRST WAY • curl localhost:8888/foo/development
  • 9. SPRING-CLOUD-CONFIG FIRST WAY The HTTP service has resources in the form. • /{application}/{profile}[/{label}] /foo/development /ppc-service/alpha • /{application}-{profile}.yml • /{label}/{application}-{profile}.yml • /{application}-{profile}.properties • /{label}/{application}-{profile}.properties
  • 10. SPRING-CLOUD-CONFIG FIRST WAY • {application} maps to "spring.application.name" on the client side; • {profile} maps to "spring.profiles.active" on the client (comma separated list); • {label} which is a server side feature labelling a "versioned" set of config files.It is an optional git label (defaults to "master".)
  • 12. SPRING-CLOUD-CONFIG FIRST WAY • For Client • Create project as a spring-boot
  • 13. SPRING-CLOUD-CONFIG FIRST WAY • Add library spring-cloud- client-config • Add library actuator • Set spring-project-name • Set spring-config-server
  • 14. SPRING-CLOUD-CONFIG FIRST WAY • Should run with Active profiles (It will be set as environment) • Or set “spring.profiles.active” in properties file • Or run ‘mvn spring-boot:run -Drun.jvmArguments=“- Dspring.profiles.active=pro duction" ‘
  • 15. SPRING-CLOUD-CONFIG FIRST WAY Refreshing • The class below shows how you can use the 'Actuator' to update running clients with a new configuration. • Use @RefreshScope when we need to change properties on the fly • Can’t use @RefreshScope with @Configuration , They will conflicted • Use @Component instead @Configuration for Bean creation
  • 17. SPRING-CLOUD-CONFIG FIRST WAY • POST /refresh to client for getting pull configuration • Can auto refresh configuration by scheduling
  • 18. SPRING-CLOUD-CONFIG FIRST WAY Pro - Can track the history of config with git repository (when, who, where) - It already have module for management environment - Zero down time - Easy to setup Con - May be found human error editing the config with wrong environment - If this server have config many projects or many keyword then It’s hard to find them - Single point of failure
  • 19. SPRING-CLOUD-CONFIG + MYSQL SECOND WAY • Spring-boot as a server • Spring-cloud-config-client • MySQL
  • 20. SPRING-CLOUD-CONFIG + MYSQL SECOND WAY • For Server • Create project as a spring-boot • Connect with Database
  • 21. SPRING-CLOUD-CONFIG + MYSQL SECOND WAY • Make API Response like spring-config-server
  • 22. SPRING-CLOUD-CONFIG + MYSQL SECOND WAY • Prototype Database
  • 23. SPRING-CLOUD-CONFIG + MYSQL SECOND WAY • For Client • Create project as a spring-boot • Add library spring-cloud-config • Set spring-project-name • Set spring-config-server
  • 24. SPRING-CLOUD-CONFIG + MYSQL SECOND WAY Pro - Easy to searching the configuration with SQL script - Use SQL (Most developers can use SQL) - No zero down time while changing config Con - Single point of failure - It’s must strict the pattern same spring cloud - supported only spring properties (can’t keep JSON type) - Developer should coding the client-lib (Can resolved it with spring cloud) - When accident configuration changed It need DBA to find the root cause - Need admin report to changing configuration
  • 25. SPRING-CLOUD-CONFIG + MYSQL (STNLN) THIRD WAY • Spring-cloud-config-client + server • MySQL
  • 26. SPRING-CLOUD-CONFIG + MYSQL (STNLN) THIRD WAY • Create project as a spring-boot • Connect with Database
  • 27. SPRING-CLOUD-CONFIG + MYSQL (STNLN) THIRD WAY • Add library spring-cloud- client-config • Add library actuator • Set spring-project-name • Set spring-config-server : Itself URI
  • 28. SPRING-CLOUD-CONFIG + MYSQL (STNLN) THIRD WAY • Make API Response like spring-config-server
  • 29. SPRING-CLOUD-CONFIG + MYSQL (STNLN) THIRD WAY Pro - Config each application - Use SQL (Most developers can use SQL) - No zero down time while changing config Con - Detour calling method update config - Application push effort to find the configuration from database - Need same table fix in database for each applications - When accident configuration changed It need DBA to find the root cause - Need admin report to changing configuration
  • 30. WHY NOT CAN ALL CONFIGS ARE EXTERNAL? • Try to find a victim project • Set config server • Set name of application • delete spring.datasource.url
  • 31. WHY NOT CAN ALL CONFIGS ARE EXTERNAL? • Add spring.datasource.url in Database for server • Run! • Client will get data from server first • If key is required,and you didn’t set then application will be got error same key in properties is not found • Can’t change database.url on the fly(need restart)
  • 32.
  • 33. YES CAN ALMOST KEYS GET FROM SERVER? • Remain keys at least • Some keys can not load from server • Some keys use as bootstrap
  • 34. YES CAN ALMOST KEYS GET FROM SERVER? • Add keys into database
  • 35. CAN REMOVE BUILT-IN CONFIG? YES
  • 36. HAVE TO IMPLEMENT MORE • Security (access server) • Encryption password • Web admin • Board cast config to client
  • 37. REFERENCE • https://cloud.spring.io/spring-cloud-config/spring-cloud-config.html • https://github.com/ehdez73/minionize-the-world • http://www.javaworld.com/article/2927920/cloud-computing/build- self-healing-distributed-systems-with-spring-cloud.html • http://nobodyiam.com/2016/04/02/dive-into-spring-cloud-config/