通过配置服务器读取属性时,SCDF尝试连接到localhost:8888

时间:2020-06-19 17:59:55

标签: java spring-boot kubernetes spring-cloud-dataflow spring-cloud-config-server

我正在openshift平台上运行定制的SCDF服务器。我使用配置服务器从配置库读取属性。 SCDF可以使用适当的域名(例如“ wwww.config-server-properties.com”)连接到配置服务器,并读取属性。但是,一旦服务器启动,scdf就会再次开始在localhost:8888重复寻找配置资源。 我尝试在scdf的deployment.yaml和自定义构建的scdf项目中切换scdf.cloud.config.server.enabled属性。我不知道scdf实际是指localhost:8888的地方。下面是详细信息。

Logs:
```
 INFO 1 --- [           main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://config-server-batchadmin.dvos.capella.edu 
 INFO 1 --- [           main] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=batchAdmin, profiles=[kubernetes], label=null, version=bc0cbea28354151cd8a3a43213cbeaf6c6e0ff7a, state=null
 INFO 1 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-configClient'}, BootstrapPropertySource {name='bootstrapProperties-https://gitlab.capella.edu/courseroom/sei-configsecrets.git/src/main/resources/batchAdmin.properties' }]
 INFO 1 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-secrets.spring-cloud-dataflow-server.batchadmin'}]
[main] INFO  edu.capella.batchadmin.CustomDataflowServerApplication.logStartupProfileInfo - The following profiles are active: kubernetes
[main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate.multipleStoresDetected - Multiple Spring Data modules found, entering strict repository configuration mode!
[main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn - Bootstrapping Spring Data Map repositories in DEFAULT mode.
[main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn - Finished Spring Data repository scanning in 516ms. Found 1 Map repository interbatches.
[main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate.multipleStoresDetected - Multiple Spring Data modules found, entering strict repository configuration mode!

REPETITIVE CALLS
****************
[http-nio-80-exec-4] INFO  org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment - Fetching config from server at : http://localhost:8888 
[http-nio-80-exec-4] INFO  org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment - Connect Timeout Exception on Url - http://localhost:8888 . Will be trying the next url if available
[http-nio-80-exec-4] WARN  org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate - Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/batchAdmin/kubernetes":  Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
[http-nio-80-exec-7] INFO  org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment - Fetching config from server at : http://localhost:8888 
[http-nio-80-exec-4] INFO  org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment - Connect Timeout Exception on Url - http://localhost:8888 . Will be trying the next url if available
[http-nio-80-exec-4] WARN  org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate - Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/batchAdmin/kubernetes":  Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
```

scdf-deployment.yaml - config client
------------------------------------
```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: scdf-server
  labels:
    app: scdf-server
spec:
  selector:
    matchLabels:
      app: scdf-server
  replicas: 1
  template:
    metadata:
      labels:
        app: scdf-server
    spec:
      containers:
      - name: scdf-server
        image: docker-registry.default.svc:5000/batchadmin/scdf-server
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        resources:
          limits:
            cpu: 1.0
            memory: 2048Mi
          requests:
            cpu: 0.5
            memory: 1024Mi
        env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        - name: SERVER_PORT
          value: '80'
        - name: SPRING_CLOUD_CONFIG_ENABLED
          value: 'true'
        - name: SPRING_CLOUD_KUBERNETES_CONFIG_ENABLE_API
          value: 'false'
      serviceAccountName: scdf-sa
```
bootstrap.properties - client
----------------------------
```
spring.cloud.config.name=batchAdmin
spring.cloud.config.uri=http://config-server-batchadmin.example.edu
#spring.cloud.config.label=master
#spring.cloud.config.enabled=false
```
application.properties - server
-------------------------------
spring.cloud.config.server.git.uri=https://gitlab.example.com/config/configsecrets.git
spring.cloud.config.server.git.username=username
spring.cloud.config.server.git.password=password
spring.cloud.config.server.git.skip-ssl-validation=true
spring.cloud.config.server.git.search-paths=src/main/resources

deployment.yaml - server
------------------------
```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: config-server
  labels:
    app: config-server
spec:
  selector:
    matchLabels:
      app: config-server
  replicas: 1
  template:
    metadata:
      labels:
        app: config-server
    spec:
      containers:
      - name: scdf-server
        image: docker-registry.default.svc:5000/facadmin/config-server
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        resources:
          limits:
            cpu: 1.0
            memory: 2048Mi
          requests:
            cpu: 0.5
            memory: 1024Mi
        env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        - name: SERVER_PORT
          value: '80'
      serviceAccountName: scdf-sa
```
Is there anyother config setting missing? Where I went wrong ?

0 个答案:

没有答案
相关问题