0

我将我的微服务系统运行到 docker for windows 这是我的 docker-compose.yml

version: '3'
services:
  zookeeper:
    image: wurstmeister/zookeeper:3.4.6
    restart: always
    ports:
      - "8400:8400"
      - "2181:2181"
  kafka:
    image: wurstmeister/kafka:1.1.0
    restart: always
    ports:
      - "9092:9092"
    environment:
      KAFKA_ADVERTISED_HOST_NAME: localhost
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
  registry-jhipster:
    image: jhipster/jhipster-registry:v3.2.4
    restart: always    
    ports:
      - "8761:8761"      
    environment:
      - SPRING_PROFILES_ACTIVE=dev,native
      - JHIPSTER_REGISTRY_PASSWORD=admin
      - JHIPSTER_SECURITY_AUTHENTICATION_JWT_SECRET=secret
      - SPRING_CLOUD_CONFIG_SERVER_NATIVE_SEARCH_LOCATIONS=file:./central-config/
    volumes:
      - ./central-config:/central-config
  db:
    image: mariadb
    restart: always
    ports:
      - "3306:3306"
    environment:    
      MYSQL_ROOT_PASSWORD: password  
    volumes:
        - ./db-init:/docker-entrypoint-initdb.d
  tomcat:
    image: tomcat:8.5-alpine
    environment:
      - JVM_OPTS=-Xmx12g -Xms12g -XX:MaxPermSize=1024m
    links:
      - db:mysql
      - registry-jhipster:registry
      - kafka:kafka
    ports:
      - "8080:8080"
    volumes:
      - ./tomcat/webapps/app.original.war:/usr/local/tomcat/webapps/app.original.war
      - ./tomcat/conf/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml:ro

运行后...一切都已设置好,我可以看到我的注册表,但应用程序实例始终处于关闭状态。

将这些放入 tomcat 容器日志中:

2018-07-06 16:16:48.395  WARN 1 --- [nfoReplicator-0] o.a.k.clients.consumer.ConsumerConfig    : The configuration 'value.serializer'  was supplied but isn't a known config.
2018-07-06 16:16:48.396  WARN 1 --- [nfoReplicator-0] o.a.k.clients.consumer.ConsumerConfig    : The configuration 'key.serializer' was supplied but isn't a known config.
2018-07-06 16:16:48.936  WARN 1 --- [nfoReplicator-0] c.n.discovery.InstanceInfoReplicator     : There was a problem with the instance info replicator
2018-07-06T16:16:48.936993100Z 
java.lang.OutOfMemoryError: Java heap space

发生了什么?以及如何修复并使我的应用程序可用?

4

1 回答 1

0

我找到了解决方案。我将此添加到我的 docker-compose.yml

jhipster-registry:
     container_name: registry
     hostname: registry

在我的应用程序的 boostrap.yml 中

    Spring:
        cloud:
            config:
                uri: http://admin:${jhipster.registry.password}@registry:8761/config

它有效

于 2018-07-09T11:08:39.693 回答