根据开发手册部分构建本地开发环境问题

1.根据后端开发手册
docker-compose.yml文件配置如下:

version: “3”
services:
zookeeper-0:
container_name: zookeeper-0
image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/zookeeper:3.4.10
hostname: zookeeper-0
environment:
- ZK_REPLICAS=1
- ZK_HEAP_SIZE=2G
- ZK_TICK_TIME=2000
- ZK_INIT_LIMIT=10
- ZK_SYNC_LIMIT=5
- ZK_MAX_CLIENT_CNXNS=60
- ZK_SNAP_RETAIN_COUNT=3
- ZK_PURGE_INTERVAL=1
- ZK_LOG_LEVEL=INFO
- ZK_CLIENT_PORT=2181
- ZK_SERVER_PORT=2888
- ZK_ELECTION_PORT=3888
ports:
- “2181:2181”
- “2888:2888”
- “3888:3888”
command:
- sh
- -c
- zkGenConfig.sh && exec zkServer.sh start-foreground
volumes:
- “/home/guoqingdeng/Desktop/docker-share/kafka/zk:/var/lib/zookeeper”
kafka-0:
container_name: kafka-0
image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kafka:1.0.0
hostname: 127.0.0.1
depends_on:
- zookeeper-0
links:
- zookeeper-0
ports:
- “9092:9092”
command:
- sh
- -c
- "/opt/kafka/bin/kafka-server-start.sh config/server.properties
–override zookeeper.connect=zookeeper-0:2181
–override log.dirs=/opt/kafka/data/logs
–override broker.id=0 "
volumes:
- “/home/guoqingdeng/Desktop/docker-share/kafka/kafka:/opt/kafka/data”
redis:
container_name: redis
image: hub.c.163.com/library/redis:latest
ports:
- “6379:6379”
mysql:
container_name: mysql
image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/mysql:5.7.17
ports:
- “3306:3306”
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- /home/guoqingdeng/Desktop/docker-share/mysql/mysql_data:/var/lib/mysql
- /home/guoqingdeng/Desktop/docker-share/mysql/mysql_db.cnf:/etc/mysql/conf.d/mysql_db.cnf
phpadmin:
container_name: phpadmin
image: registry.saas.hand-china.com/tools/phpmyadmin
ports:
- “8888:80” # 80端口方便浏览器直接访问
environment:
PMA_ARBITRARY: 1 # 用于开启phpadmin关于可否输入host的设置
eureka-server:
container_name: eureka-server
image: registry.cn-shanghai.aliyuncs.com/choerodon/eureka-server:0.5.0
hostname: 127.0.0.1
ports:
- “8000:8000”
manager-service:
container_name: manager-service
image: registry.cn-shanghai.aliyuncs.com/choerodon/manager-service:0.5.0
ports:
- “8963:8963”
api-gateway:
container_name: api-gateway
image: registry.cn-shanghai.aliyuncs.com/choerodon/api-gateway:0.5.0
ports:
- “8080:8080”
environment:
- zuul.addHostHeader=true
- zuul.routes.dev.path=/todo/**
- zuul.routes.dev.serviceId=choerodon-todo-service
oauth-server:
container_name: oauth-server
image: registry.cn-shanghai.aliyuncs.com/choerodon/oauth-server:0.5.0
ports:
- “8020:8020”
gateway-helper:
container_name: gateway-helper
image: registry.cn-shanghai.aliyuncs.com/choerodon/gateway-helper:0.5.0
ports:
- “9180:9180”

2.启动问题

1.api-gateway 组件容器无法启动,日志报错信息为无法连接zk服务
2.gateway-helper、manager-service、oauth-server组件容器无法启动,日志报错信息为mysql连接被拒

其他容器可正常启动

3.demo案例问题

参考文档案例,运行时,服务未注册到注册中心

4.Ubuntu系统下运行

麻烦大佬们给解决下哈

docker的运行环境麻烦提供下

我的电脑系统是ubuntu的,这个应该没多大影响吧。

@fuchen 引号是否是英文的"" 而不是中文的“”

yml中配置信息???英文的

粘贴代码的时候使用请使用代码格式, 选中代码后点击编辑框上方的</>,这样便于我们查看。看你贴出来的内容中的引号有点像是中文的引号。

(⊙o⊙)…,本来我是想使用markdown语法的,但是那个缩进有问题。。。所以。。。

大佬,有查到问题所在吗?

version: "3"
services:
  zookeeper-0:
    container_name: zookeeper-0
    image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/zookeeper:3.4.10
    hostname: zookeeper-0
    environment:
    - ZK_REPLICAS=1
    - ZK_HEAP_SIZE=2G
    - ZK_TICK_TIME=2000
    - ZK_INIT_LIMIT=10
    - ZK_SYNC_LIMIT=5
    - ZK_MAX_CLIENT_CNXNS=60
    - ZK_SNAP_RETAIN_COUNT=3
    - ZK_PURGE_INTERVAL=1
    - ZK_LOG_LEVEL=INFO
    - ZK_CLIENT_PORT=2181
    - ZK_SERVER_PORT=2888
    - ZK_ELECTION_PORT=3888
    ports:
    - "2181:2181"
    - "2888:2888"
    - "3888:3888"
    command:
    - sh
    - -c
    - zkGenConfig.sh && exec zkServer.sh start-foreground
    volumes:
    - "/home/guoqingdeng/Desktop/docker-share/kafka/zk:/var/lib/zookeeper"
  kafka-0:
    container_name: kafka-0
    image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kafka:1.0.0
    hostname: 127.0.0.1
    depends_on:
    - zookeeper-0
    links:
    - zookeeper-0
    ports:
    - "9092:9092"
    command:
    - sh
    - -c
    - "/opt/kafka/bin/kafka-server-start.sh config/server.properties \
           --override zookeeper.connect=zookeeper-0:2181 \
           --override log.dirs=/opt/kafka/data/logs \
           --override broker.id=0 "
    volumes:
    - "/home/guoqingdeng/Desktop/docker-share/kafka/kafka:/opt/kafka/data"
  redis:
    container_name: redis
    image: hub.c.163.com/library/redis:latest
    ports:
      - "6379:6379"
  mysql:
    container_name: mysql
    image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/mysql:5.7.17
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - /home/guoqingdeng/Desktop/docker-share/mysql/mysql_data:/var/lib/mysql
      - /home/guoqingdeng/Desktop/docker-share/mysql/mysql_db.cnf:/etc/mysql/conf.d/mysql_db.cnf
  phpadmin:
    container_name: phpadmin
    image: registry.saas.hand-china.com/tools/phpmyadmin
    ports:
      - "8888:80" # 80端口方便浏览器直接访问
    environment:
      PMA_ARBITRARY: 1 # 用于开启phpadmin关于可否输入host的设置
  eureka-server:
    container_name: eureka-server
    image: registry.cn-shanghai.aliyuncs.com/choerodon/eureka-server:0.5.0
    hostname: 127.0.0.1
    ports:
    - "8000:8000"
  manager-service:
    container_name: manager-service
    image: registry.cn-shanghai.aliyuncs.com/choerodon/manager-service:0.5.0
    ports:
    - "8963:8963"
  api-gateway:
    container_name: api-gateway
    image: registry.cn-shanghai.aliyuncs.com/choerodon/api-gateway:0.5.0
    ports:
    - "8080:8080"
    environment:
    - zuul.addHostHeader=true
    - zuul.routes.dev.path=/todo/**
    - zuul.routes.dev.serviceId=choerodon-todo-service
  oauth-server:
    container_name: oauth-server
    image: registry.cn-shanghai.aliyuncs.com/choerodon/oauth-server:0.5.0
    ports:
    - "8020:8020"
  gateway-helper:
    container_name: gateway-helper
    image: registry.cn-shanghai.aliyuncs.com/choerodon/gateway-helper:0.5.0
    ports:
    - "9180:9180"

你好,你可以参考下这一篇

好的哈,我瞅瞅看,谢谢了哈

最新的文档也已经更新到官网上了

哈,现在api-gateway、gateway-helper、manager-service、oauth-server这四个组件容器启动的时候是可以起来的了,但是不知道啥原因,一段时间过后自动停止。。。查看了下日志,信息如下:

e[36mapi-gateway        |e[0m 2018-06-01 09:20:23.544  WARN [api-gateway,,,] 1 --- [tbeatExecutor-0] c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with message: java.net.SocketTimeoutException: Read timed out
e[36mapi-gateway        |e[0m 2018-06-01 09:20:23.545 ERROR [api-gateway,,,] 1 --- [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_API-GATEWAY/275385023fe5:api-gateway:8080 - was unable to send heartbeat!
e[36mapi-gateway        |e[0m 
e[36mapi-gateway        |e[0m com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:111) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.sendHeartBeat(EurekaHttpClientDecorator.java:89) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$3.execute(EurekaHttpClientDecorator.java:92) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.sendHeartBeat(EurekaHttpClientDecorator.java:89) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient.renew(DiscoveryClient.java:815) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1379) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 
e[36mapi-gateway        |e[0m 2018-06-01 09:20:23.584 ERROR [api-gateway,,,] 1 --- [freshExecutor-0] c.n.d.s.t.d.RedirectingEurekaHttpClient  : Request execution error
e[36mapi-gateway        |e[0m 
e[36mapi-gateway        |e[0m com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out
e[36mapi-gateway        |e[0m 	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) ~[jersey-apache-client4-1.19.1.jar!/:1.19.1]
e[36mapi-gateway        |e[0m 	at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123) ~[jersey-client-1.19.1.jar!/:1.19.1]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.sun.jersey.api.client.Client.handle(Client.java:652) ~[jersey-client-1.19.1.jar!/:1.19.1]
e[36mapi-gateway        |e[0m 	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682) ~[jersey-client-1.19.1.jar!/:1.19.1]
e[36mapi-gateway        |e[0m 	at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) ~[jersey-client-1.19.1.jar!/:1.19.1]
e[36mapi-gateway        |e[0m 	at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:509) ~[jersey-client-1.19.1.jar!/:1.19.1]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.getApplicationsInternal(AbstractJerseyEurekaHttpClient.java:194) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.jersey.AbstractJerseyEurekaHttpClient.getApplications(AbstractJerseyEurekaHttpClient.java:165) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.MetricsCollectingEurekaHttpClient.execute(MetricsCollectingEurekaHttpClient.java:73) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:118) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:79) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:119) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1013) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:927) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient.refreshRegistry(DiscoveryClient.java:1451) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient$CacheRefreshThread.run(DiscoveryClient.java:1418) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
e[36mapi-gateway        |e[0m Caused by: java.net.SocketTimeoutException: Read timed out
e[36mapi-gateway        |e[0m 	at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:158) ~[httpcore-4.4.6.jar!/:4.4.6]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:82) ~[httpcore-4.4.6.jar!/:4.4.6]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:271) ~[httpcore-4.4.6.jar!/:4.4.6]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) ~[httpcore-4.4.6.jar!/:4.4.6]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281) ~[httpcore-4.4.6.jar!/:4.4.6]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:257) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:230) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) ~[httpcore-4.4.6.jar!/:4.4.6]
e[36mapi-gateway        |e[0m 	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) ~[httpcore-4.4.6.jar!/:4.4.6]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:684) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.3.jar!/:4.5.3]
e[36mapi-gateway        |e[0m 	at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:173) ~[jersey-apache-client4-1.19.1.jar!/:1.19.1]
e[36mapi-gateway        |e[0m 	... 30 common frames omitted
e[36mapi-gateway        |e[0m 
e[36mapi-gateway        |e[0m 2018-06-01 09:20:23.584  WARN [api-gateway,,,] 1 --- [freshExecutor-0] c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failed with message: java.net.SocketTimeoutException: Read timed out
e[36mapi-gateway        |e[0m 2018-06-01 09:20:23.585 ERROR [api-gateway,,,] 1 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_API-GATEWAY/275385023fe5:api-gateway:8080 - was unable to refresh its cache! status = Cannot execute request on any known server
e[36mapi-gateway        |e[0m 
e[36mapi-gateway        |e[0m com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:111) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134) ~[eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1013) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:927) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient.refreshRegistry(DiscoveryClient.java:1451) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at com.netflix.discovery.DiscoveryClient$CacheRefreshThread.run(DiscoveryClient.java:1418) [eureka-client-1.6.2.jar!/:1.6.2]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
e[36mapi-gateway        |e[0m 
e[36mapi-gateway        |e[0m 2018-06-01 09:20:33.585  INFO [api-gateway,,,] 1 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Disable delta property : true
e[36mapi-gateway        |e[0m 2018-06-01 09:20:33.586  INFO [api-gateway,,,] 1 --- [freshExecutor-0] com.netflix.discovery.DiscoveryClient    : Single vip registry refresh property : null

还有一个问题是如何本地构建的demo案例,服务无法注册到注册中心。。。,yml配置如下:

spring:
  eureka:
    instance:
      preferIpAddress: true
      leaseRenewalIntervalInSeconds: 1
      leaseExpirationDurationInSeconds: 3
    client:
      serviceUrl:
        defaultZone: ${EUREKA_DEFAULT_ZONE:http://localhost:8000/eureka/}
  application:
    name: choerodon-todo-service
  datasource:
    url: jdbc:mysql://localhost/choerodon_demo_service_todo?useUnicode=true&characterEncoding=utf-8&useSSL=false
    username: choerodon
    password: 123456
server:
  port: 8080
mybatis:
  mapperLocations: classpath*:/mapper/*.xml
  configuration:
    mapUnderscoreToCamelCase: true
management:
  port: 8081
  security:
    enabled: false
feign:
  hystrix:
    enabled: true
security:
  basic:
    enabled: false
  ignored: /v2/api-docs

报错是因为无法连接eureka。
可以修改spring.eureka.client.serviceUrl.defaultZone 为本地注册中心的地址
你可以参考下最新的docekr-compose文件
http://choerodon.io/zh/docs/development-guide/backend/intergration/run/

还是不行呀,按照文档所改,虽然组件容器启动是可以了,但是还是会自动停止,还有就是我本地的demo案例的服务一直无法注册到注册中心。。。

yml配置如下:

version: "3"
services:
  zookeeper-0:
    container_name: zookeeper-0
    image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/zookeeper:3.4.10
    hostname: zookeeper-0
    environment:
    - ZK_REPLICAS=1
    - ZK_HEAP_SIZE=2G
    - ZK_TICK_TIME=2000
    - ZK_INIT_LIMIT=10
    - ZK_SYNC_LIMIT=5
    - ZK_MAX_CLIENT_CNXNS=60
    - ZK_SNAP_RETAIN_COUNT=3
    - ZK_PURGE_INTERVAL=1
    - ZK_LOG_LEVEL=INFO
    - ZK_CLIENT_PORT=2181
    - ZK_SERVER_PORT=2888
    - ZK_ELECTION_PORT=3888
    ports:
    - "2181:2181"
    - "2888:2888"
    - "3888:3888"
    command:
    - sh
    - -c
    - zkGenConfig.sh && exec zkServer.sh start-foreground
    volumes:
    - "/home/guoqingdeng/Desktop/docker-share/kafka/zk:/var/lib/zookeeper"
  kafka-0:
    container_name: kafka-0
    image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kafka:1.0.0
    hostname: 127.0.0.1
    depends_on:
    - zookeeper-0
    links:
    - zookeeper-0
    ports:
    - "9092:9092"
    command:
    - sh
    - -c
    - "/opt/kafka/bin/kafka-server-start.sh config/server.properties \
           --override zookeeper.connect=zookeeper-0:2181 \
           --override log.dirs=/opt/kafka/data/logs \
           --override broker.id=0 "
    volumes:
    - "/home/guoqingdeng/Desktop/docker-share/kafka/kafka:/opt/kafka/data"
  redis:
    container_name: redis
    image: hub.c.163.com/library/redis:latest
    ports:
      - "6379:6379"
  mysql:
    container_name: mysql
    image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/mysql:5.7.17
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - /home/guoqingdeng/Desktop/docker-share/mysql/mysql_data:/var/lib/mysql
      - /home/guoqingdeng/Desktop/docker-share/mysql/mysql_db.cnf:/etc/mysql/conf.d/mysql_db.cnf
  phpadmin:
    container_name: phpadmin
    image: registry.saas.hand-china.com/tools/phpmyadmin
    ports:
      - "8888:80" # 80端口方便浏览器直接访问
    environment:
      PMA_ARBITRARY: 1 # 用于开启phpadmin关于可否输入host的设置
  eureka-server:
    container_name: eureka-server
    image: registry.cn-shanghai.aliyuncs.com/choerodon/eureka-server:0.5.0
    hostname: eureka-server
    ports:
    - "8000:8000"
    depends_on:
    - zookeeper-0
    - kafka-0
    links:
    - zookeeper-0
    - kafka-0
  manager-service:
    container_name: manager-service
    image: registry.cn-shanghai.aliyuncs.com/choerodon/manager-service:0.5.0
    ports:
    - "8963:8963"
    environment:
    - eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/
    - spring.cloud.stream.kafka.binder.zkNodes=zookeeper-0:2181
    - spring.datasource.url=jdbc:mysql://mysql/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
    - spring.datasource.username=root
    - spring.datasource.password=root
  api-gateway:
    container_name: api-gateway
    image: registry.cn-shanghai.aliyuncs.com/choerodon/api-gateway:0.5.0
    depends_on:
    - zookeeper-0
    - kafka-0
    - eureka-server
    links:
    - zookeeper-0
    - kafka-0
    - eureka-server
    ports:
    - "8080:8080"
    environment:
    - zuul.addHostHeader=true
    - zuul.routes.dev.path=/todo/**
    - zuul.routes.dev.serviceId=choerodon-todo-service
    - eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/
    - spring.cloud.stream.kafka.binder.zkNodes=zookeeper-0:2181
  oauth-server:
    container_name: oauth-server
    image: registry.cn-shanghai.aliyuncs.com/choerodon/oauth-server:0.5.0
    depends_on:
    - zookeeper-0
    - kafka-0
    - eureka-server
    - mysql
    links:
    - zookeeper-0
    - kafka-0
    - eureka-server
    - mysql
    ports:
    - "8020:8020"
    environment:
    - eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/
    - spring.cloud.stream.kafka.binder.zkNodes=zookeeper-0:2181
    - spring.datasource.url=jdbc:mysql://mysql/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
    - spring.datasource.username=root
    - spring.datasource.password=root
  gateway-helper:
    container_name: gateway-helper
    image: registry.cn-shanghai.aliyuncs.com/choerodon/gateway-helper:0.5.0
    depends_on:
    - zookeeper-0
    - kafka-0
    - eureka-server
    - mysql
    links:
    - zookeeper-0
    - kafka-0
    - eureka-server
    - mysql
    ports:
    - "9180:9180"
    environment:
    - eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/
    - spring.cloud.stream.kafka.binder.zkNodes=zookeeper-0:2181
    - spring.datasource.url=jdbc:mysql://mysql/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
    - spring.datasource.username=root
    - spring.datasource.password=root

我将配置中的eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/,localhost修改为本地ip也没用,照样过一段时间还是会停止

文档中用的不是ip或者localhost,而是http://eureka-server:8000/eureka/, 本地iplocalhost在docker实例里面都无法解析的