'Jhipster registry instance DOWN when running both Registry and Eureka in docker in production environment

Jhispster Registry instance won't get registered itself with Eureka. I can access the Jhipster Registry dashboard where it shows the status for instance DOWN

enter image description here

Error Logs

jhipster-registry_1  | 2022-05-18 09:20:35.839  INFO 1 --- [           main] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://admin:admin@localhost:8761/eureka/}, exception=java.net.ConnectException: Connection refused (Connection refused) stacktrace=com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused (Connection refused)
jhipster-registry_1  |  at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187)
jhipster-registry_1  |  at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123)
jhipster-registry_1  |  at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27)
jhipster-registry_1  |  at com.sun.jersey.api.client.Client.handle(Client.java:652)

I am new to Jhipster. I have downloaded the jhipster registry image and created created a container using docker-compose command. I am using GIT repo for config server.

Command : docker-compose -f jhipster-registry.yml up

jhipster-registry.yml

version: '3.8'
services:
  jhipster-registry:
    image: jhipster/jhipster-registry:v7.1.0
    network_mode: vs-bridge-net
    environment:
      - _JAVA_OPTIONS=-Xmx512m -Xms256m
      - SPRING_PROFILES_ACTIVE=prod
      - SPRING_SECURITY_USER_PASSWORD=admin
      - JHIPSTER_REGISTRY_PASSWORD=admin
      - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=git
      - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_URI=https://github.com/xxxxxx/config-server.git
      - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_USERNAME=<git username>
      - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_PASSWORD=<git pswd>
      - SPRING_CLOUD_CONFIG_SERVER_GIT_DEFAULT-LABEL=main
      - SPRING_CLOUD_CONFIG_SERVER_GIT_BASEDIR=<directory>
      - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_PATHS=central-config
    ports:
      - 8761:8761

Config-server : application.yml at GIT repo

# ===================================================================
# JHipster Sample Spring Cloud Config.
# ===================================================================

# Property used on app startup to check the config server status
configserver:
    name: JHipster Registry config server
    status: Connected to the JHipster Registry config server!

# Default JWT secret token (to be changed in production!)
jhipster:
    security:
        authentication:
            jwt:               
                base64-secret: MjkwYWRhZTZmYmY5ZWRkMDg4MjM4YmNhZDVjMzVkYmExM2UwYzkyNDAyMWQ0ODkxNzllYmRkN2I2MGM1ZmIyOWM2NzNhMDZkYzU0MjcxYTkxN2ZjMTk5YWUzYTJkYTRiNDI4NjY4NzgwZDBlYmQ1YzZmZmYxM2E2MmY2ODk4NDk

# Enable /management/logfile endpoint for all apps
logging:
    path: /tmp
    file: ${spring.application.name}.log


#defaultZone=http://admin:${jhipster.registry.password}@jhipster-registry:8761/eureka/
eureka:
  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
      defaultZone: http://admin:admin@localhost:8761/eureka/

It won't throw error when i set value to false for below property . But it won't register any microservices.

register-with-eureka: false and fetch-registry: false

What I tried -

  • used the ip address in place of localhost
  • set many other properties I found during search on google.

Kindly help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source