programing

시작할 때 Spring Cloud Config Server가 PropertySource를 찾을 수 없음

css3 2023. 8. 13. 09:53

시작할 때 Spring Cloud Config Server가 PropertySource를 찾을 수 없음

Spring Cloud Config Server를 시작할 때 다음 오류가 발생합니다.

Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/configserver/default/master":Connection refused; nested exception is java.net.ConnectException: Connection refused

그러나 브라우저에서 해당 URL을 누르면 해당 URL이 존재하고 구성 서버가 작동합니다.무슨 일입니까?

application.yml

server:
  port: 8888
management:
  context-path: /admin
logging:
  level:
    com.netflix.discovery: 'OFF'
    org.springframework.cloud: 'DEBUG'
spring:
  cloud:
    config:
      server:
        git:
          uri: file:/home/dev/configs     

bootstrap.yml

spring:
  application:
    name: configserver

구성 서버가 구성 클라이언트가 아닌 경우 설정해야 합니다.spring.cloud.config.enabled=false로그 입력을 방지하기 위해 사용됩니다(하지만 해롭지는 않습니다.

이 오류는 서비스 중 하나가 클라우드 구성 서버에 연결할 수 없을 때 표시됩니다.잘 되게 하기 위해서요.STS 또는 Eclipse 환경을 사용하고 있다고 가정합니다. 클라우드 구성 서버 애플리케이션을 실행한 다음 클라우드 구성에 저장된 다른 서비스를 실행하십시오.두 서비스를 계속 실행하는 것이 매우 중요합니다.주의해야 할 다른 주의 사항은 다음과 같습니다. 응용 프로그램의 application.properties 파일의 이름을 bootstrap.properties'로 바꾸고 포트를 다른 서비스에서 사용해서는 안 됩니다.

구성 서버가 git 저장소에서 구성을 가져올 수 없는 경우가 있습니다.

Git 자격 증명 확인:

잘못된 Git 자격 증명일 수 있습니다.

OR

Git 사용자에게 적절한 권한이 없을 수 있습니다(게스트 계정).

enter image description here

eureka.client.serviceUrl.defaultZone 및 spring.cloud.config.bootstrapyml 파일의 구성

언급URL : https://stackoverflow.com/questions/28375416/spring-cloud-config-server-cant-locate-propertysource-on-startup