Closed paris0120 closed 2 years ago
Can you try changing localhost-config
with docker-config
in this line and try?
- SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/localhost-config/
Can you try changing
localhost-config
withdocker-config
in this line and try?- SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/localhost-config/
The dock image works now but other microservice can't connect to Eureka now. I get the following message with microservice.
Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://admin:admin@jhipster-registry:8761/eureka/}, exception=I/O error on GET request for "http://admin:admin@jhipster-registry:8761/eureka/apps/": No such host is known (jhipster-registry); nested exception is java.net.UnknownHostException: No such host is known (jhipster-registry) stacktrace=org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://admin:admin@jhipster-registry:8761/eureka/apps/": No such host is known (jhipster-registry); nested exception is java.net.UnknownHostException: No such host is known (jhipster-registry)
You can try adding an entry into your hosts
config to map jhipster-registry
with 127.0.0.1
for micro-services connection issue.
Closing, since doubts have been answered
Overview of the issue
It seems that the gateway server cannot connect to the Eureka server out of jdl generator.
Motivation for or Use Case
Generate microservice with gateway and microservice
Reproduce the error
Generated a gateway server and microservice server.
Started gateway server with docker-compose -f src/main/docker/app.yml up
I got
ERROR 1 --- [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_GATEWAY/gateway:139fa15be5b04239ff7a0dd2a823ac7e - was unable to send heartbeat!
Also, Eureka doesn't list the gateway server.
If I start a microservice with mvn, the Eureka can show the microservice but not the gateway. Also if I try to accesss the API of microservice from the gate server I get
{"type":"https://www.jhipster.tech/problem/problem-with-message","title":"Unauthorized","status":401,"detail":"Not Authenticated","path":"/api/issues","message":"error.http.401"}
The following is my app.yml
This configuration is intended for development purpose, it's your responsibility to harden it for production
version: '3.8' services: gateway-app: image: gateway environment:
If you want to expose these ports outside your dev PC,
remove the "127.0.0.1:" prefix
ports:
volumes:
- ~/volumes/jhipster/gateway/mysql/:/var/lib/mysql/
environment:
If you want to expose these ports outside your dev PC,
remove the "127.0.0.1:" prefix
ports:
volumes:
- ~/volumes/jhipster/gateway/elasticsearch/:/usr/share/elasticsearch/data/
If you want to expose these ports outside your dev PC,
remove the "127.0.0.1:" prefix
ports:
When run with the "dev" Spring profile, the JHipster Registry will
read the config from the local filesystem (central-server-config directory)
When run with the "prod" Spring profile, it will read the configuration from a Git repository
See https://www.jhipster.tech/jhipster-registry/#spring-cloud-config
environment:
- SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=git
- SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_URI=https://github.com/jhipster/jhipster-registry/
- SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_PATHS=central-config
For keycloak to work, you need to add '127.0.0.1 keycloak' to your hosts file
If you want to expose these ports outside your dev PC,
remove the "127.0.0.1:" prefix
ports:
If you want to expose these ports outside your dev PC,
remove the "127.0.0.1:" prefix
ports:
Related issues
Suggest a Fix
JHipster Version(s)
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System