Skip to content

Eureka won't connect when run jhipster-registery in docker with cloud config server #538

@Chipsona

Description

@Chipsona

Hi All,
I am new to jhipster and docker. Just creating a jhipster-registry instance on linux server using docker. I am getting below exception

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)

It also shows Jhipster-registry instand as DOWN on dashboard
image

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
fetch-registry: false

Kindly help and let me know what is wrong with above configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions