0

In a development team, we are working on a jhipster microservice project with Uaa, Jh-registry, mic 1, mic 2 and gateway.

The question here is it possible to deploy shared Uaa and Jh-registry in a remote server using Docker and other developers on either mic 1 and mic 2 use them as a service?

If the answer is yes, is there any config or inspiration sample available?

halfer
  • 19,824
  • 17
  • 99
  • 186
Hosi Jafari
  • 88
  • 2
  • 9

1 Answers1

1

The answer is yes and there's very little to do, just edit the src/main/resources/config/bootstrap.yml file of your gateway, uaa and microservices so that they point to the registry url for config:

spring:
  ...
  cloud:
    config:
      fail-fast: false # if not in "prod" profile, do not force to use Spring Cloud Config
      uri: http://admin:${jhipster.registry.password}@my-registry.example.com:8761/config

And then for Eureka server url, edit application*.yml in applications and registry to change defaultZone

eureka:
  ...
  client:
    service-url:
      defaultZone: http://admin:${jhipster.registry.password}@my-registry.example.com:8761/eureka/
Gaël Marziou
  • 16,028
  • 4
  • 38
  • 49
  • Thank you for the quick response. I did this, but I think still there is more config to do. I get a connection refused error while compiling my application. 2019-12-28 15:34:24.344 ERROR 6588 --- [ restartedMain] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://admin:admin@localhost:8761/eureka/} – Hosi Jafari Dec 28 '19 at 12:08
  • The JHipster registry is both a config server and a eureka server, bootstrap.yml change addressed only the config part, for Eureka I edited my answer – Gaël Marziou Dec 28 '19 at 16:51
  • Dear Gael, it's wired, but in addition to bootstrap.yml I changed application-dev.yml, application-prod.yml, application.yml configs for Eureka server, again I took the same error with new changes. Do I need to make any change in jhipster-registry.yml?. – Hosi Jafari Dec 29 '19 at 07:03
  • I don't think so but you should change the defaultZone property in the files of the jhipster registry central-config folder if you use `native` configuration or in your git repository if you use `git` configuration. See https://www.jhipster.tech/jhipster-registry/#spring-cloud-config or spring cloud config server docs. It's importantt thatt you understand how central configuration works versus local configuration. – Gaël Marziou Dec 29 '19 at 14:28