Spring Boot + Vault Integration Issue

I have an spring boot microservices example. I defined vault running on docker in vm of Google cloud. Here is the vault dependency of pom.xml in config server
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-vault-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-vault-config</artifactId>
</dependency>
Here is the application.yml of config server
server:
port: 8888
encrypt:
key: my-secret-key

spring:
application:
name: config-server
cloud:
config:
server:
git:
uri: GIT_CONFIG_URI
default-label: main
username: GIT_USERNAME
password: GIT_PASSWORD
clone-on-start: true

vault:
host: IP_ADDRESS
port: 8200
scheme: http
token: {token}
backend: secret-engine
kvVersion: 2
default-key: datasource-rdms


eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
fetch-registry: true
register-with-eureka: true
management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
show-details: always
server:
port: 8888
encrypt:
key: my-secret-key

spring:
application:
name: config-server
cloud:
config:
server:
git:
uri: GIT_CONFIG_URI
default-label: main
username: GIT_USERNAME
password: GIT_PASSWORD
clone-on-start: true

vault:
host: IP_ADDRESS
port: 8200
scheme: http
token: {token}
backend: secret-engine
kvVersion: 2
default-key: datasource-rdms


eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka/
fetch-registry: true
register-with-eureka: true
management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
show-details: always
Caused by: org.apache.hc.client5.http.HttpHostConnectException: Connect to http://127.0.0.1:8200 [/127.0.0.1] failed: Connection refused: getsockopt
Caused by: org.apache.hc.client5.http.HttpHostConnectException: Connect to http://127.0.0.1:8200 [/127.0.0.1] failed: Connection refused: getsockopt
It always connects with localhost:8200 instead of IP_ADDRESS:8200 How can I fix the issue?
5 Replies
JavaBot
JavaBot4mo ago
This post has been reserved for your question.
Hey @direct_x_34! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
direct_x_34
direct_x_34OP4mo ago
@Moderator Can you help me?
Defective
Defective4mo ago
You serious? Don't ping mods (or other random users) under your help post Unless you have an issue related to the server, someone is harrassing you here, etc.
noComment | Kez
noComment | Kez4mo ago
Yeah please don’t lol
JavaBot
JavaBot4mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?