使用jhipster-registry来创建注册中心

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/x7418520/article/details/82555479

使用jhipster-registry来创建注册中心

jhipster-registry 是一个运行应用,来自于jhipster的团队,就像jhipster生成器一样,它也是开源的,并且它的源码就在jhipster网站上。
jhipster-registry有以下三个主要目的:
* 它是一个Eureka server,它可以充当发现应用的服务器,控制路由,对所有的应用提供负载均衡和可扩展性。
* 它是一个spring cloud 配置服务,它提供了对所有应用程序运行时的配置。
* 它是一个管理服务器,有自己的主页和监控用来管理这些应用程序。

所有的特点都被打包到一个方便的angular应用界面上。

1.使用源码启动,需要node,yarn环境

git clone https://github.com/jhipster/jhipster-registry.git
cd jhipster-registry
./mvnw -Pdev,webpack   #dev启动
./mvnw -Pprod          #生产模式

2.使用docker,下面是yml文件

version: '2'
services:
    jhipster-registry:
        image: jhipster/jhipster-registry:v4.0.0
        volumes:
            # - ./central-server-config:/central-config
            # 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/microservices-architecture/#registry_app_configuration
        environment:
            # - _JAVA_OPTIONS=-Xmx512m -Xms256m
            - SPRING_PROFILES_ACTIVE=dev,swagger
            - SPRING_SECURITY_USER_PASSWORD=admin
            - JHIPSTER_REGISTRY_PASSWORD=admin
            - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_TYPE=native
            - SPRING_CLOUD_CONFIG_SERVER_COMPOSITE_0_SEARCH_LOCATIONS=file:./central-config/localhost-config/
            # - 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
        ports:
            - 8761:8761

使用docker-compose工具来启动。将上面文件保存为:jhipster-registry.yml文件。

docker-compose -f jhipster-registry.yml up -d   #运行在后台

启动完毕后,就可以在浏览器中输入:localhost:8761/,用户名密码为:admin,admin

猜你喜欢

转载自blog.csdn.net/x7418520/article/details/82555479
今日推荐