Commit 42598d3a authored by duanledexianxianxian's avatar duanledexianxianxian 😁

add config file

parent da3c5bbe
Pipeline #99 failed
......@@ -24,6 +24,15 @@ springboot与spring cloud兼容版本
9200-9299: 服务消费方端口
9300-9399:统一配置中心
### 问题
1.Eureka控制台出现
EMERGENCY! EUREKA MAY BE INCORRECTLY CLAIMING INSTANCES ARE UP WHEN THEY'RE NOT. RENEWALS ARE LESSER THAN THRESHOLD AND HENCE THE INSTANCES ARE NOT BEING EXPIRED JUST TO BE SAFE.
说明Eureka已经进入了保护模式。
### 参考
1. https://windmt.com/2018/04/14/spring-cloud-1-services-governance/
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-cloud-hello-world</artifactId>
<groupId>com.duanledexian.spring.cloud</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hello-config-server</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.duanledexian.spring.cloud.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
/**
* 配置服务中心
* <p>@EnableConfigServer 激活对配置中心的支持</p>
*
* @author Administrator
* @version 1.0.0
*/
@SpringBootApplication
@EnableConfigServer
public class SpringConfigApplication {
/**
* The entry point of application.
*
* @param args the input arguments
*/
public static void main(String[] args) {
SpringApplication.run(SpringConfigApplication.class, args);
}
}
server:
# 服务器端口
port: 9300
spring:
application:
name: config-server
cloud:
config:
server:
git:
# 配置git仓库的地址
uri: http://platform.kuopu.net:9999/gitlab/duanledexianxianxian/spring-cloud-learn
# git仓库地址下的相对地址,可以配置多个,用,分割。
search-paths: spring-cloud-hello-world/config-repo
skip-ssl-validation: false
......@@ -17,6 +17,7 @@
<module>hello-consumer</module>
<module>hello-consumer-ribbon</module>
<module>hello-consumer-feign</module>
<module>hello-config-server</module>
</modules>
<dependencies>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment