基础服务无法启动

  • Choerodon平台版本:0.5.0

  • 运行环境(如localhost或k8s):localhost

  • 遇到问题时的前置条件:镜像已经下载,docker启动本地服务

  • 问题描述:

    docker-compose up -d 启动本地基础服务时报错
    image
    zxs@LAPTOP-S1PIIICO MINGW64 /e/Docker
    $ docker-compose up -d
    Starting oauth-server … error
    Starting eureka-server …
    Starting api-gateway …
    Starting redis …
    Starting eureka-server … error
    Starting gateway-helper …
    Starting mysql …
    Starting manager-service …

ERROR: for oauth-server Cannot start service oauth-server: driver failed programming external connectivity on endpoint oauth-server (d5d7333967571c6629233c4a2eb556861fadc425640118a1b0cfd44c94Starting zookeeper-0 … error

Starting redis … error
27d437213): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8000:tcp:172.18.0.3:8000: input/output error

ERROR: for zookeeper-0 Cannot start service zookeeper-0: driver failed programming external connectivity on endpoint zookeeper-0 (e869424f127f06ae9be93113b6b057f72f6c7ce836769b069fea45911952fa8e): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:3888:tcp:172.18.0.4:3888: input/output error
Starting gateway-helper … error
ERROR: for redis Cannot start service redis: driver failed programming external connectivity on endpoint redis (997356acc7f93d1211bdd09eacb6fde0dd9a2e79002af0cd111768a46ca57d35): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:6379:tcp:172.18.0.2:6379: input/output error

ERROR: for gateway-helper Cannot start service gateway-helper: driver failed programming external connectivity on endpoint gateway-helper (1ead81d3260e76550a5d171bd916f2a3614b9e24ccb1f2233f64Starting manager-service … error
Starting api-gateway … error
Starting mysql … error

  • 原因分析:

  • 疑问:

    是配置文件的问题?还是镜像问题

@ahthzxs 这个看似docker的问题 尝试执行下面命令并重启docker

docker stop $(docker ps -a -q)

谢谢,其他服务已经可以启动,只是有两个服务启动后就立即关闭了image

version: “3”
services:
zookeeper-0:
container_name: zookeeper-0
image: registry.saas.hand-china.com/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:
- “./kafka/zk:/var/lib/zookeeper”
kafka-0:
container_name: kafka-0
image: registry.saas.hand-china.com/tools/kafka:1.0.0
hostname: kafka-0
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:
- “./kafka/kafka:/opt/kafka/data”
mysql:
container_name: mysql
image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/mysql:5.7.17
hostname: mysql
ports:
- “3306:3306”
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- ./mysql/mysql_data:/var/lib/mysql
- ./mysql/mysql_db.cnf:/etc/mysql/conf.d/mysql_db.cnf
expose:
- “3306”
eureka-server:
container_name: eureka-server
hostname: eureka-server
image: registry.cn-shanghai.aliyuncs.com/choerodon/eureka-server:0.5.0
ports:
- “8000:8000”
links:
- kafka-0
environment:
- spring.kafka.bootstrap-servers=kafka-0:9092
- eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8000/eureka/
- eureka.client.register-with-eureka=false
- eureka.client.fetch-registry=false
- hystrix.stream.queue.enabled=false
- spring.cloud.bus.enabled=false
- spring.sleuth.stream.enabled=false
expose:
- “8000”
api-gateway:
container_name: api-gateway
image: registry.cn-shanghai.aliyuncs.com/choerodon/api-gateway:0.5.0
links:
- eureka-server
depends_on:
- 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://eureka-server:8000/eureka/
- hystrix.stream.queue.enabled=false
- spring.cloud.bus.enabled=false
- spring.sleuth.stream.enabled=false
expose:
- “8080”
gateway-helper:
container_name: gateway-helper
image: registry.cn-shanghai.aliyuncs.com/choerodon/gateway-helper:0.5.0
depends_on:
- eureka-server
- mysql
links:
- eureka-server
- mysql
ports:
- “9180:9180”
environment:
- eureka.client.serviceUrl.defaultZone=http://eureka-server:8000/eureka/
- spring.datasource.url=jdbc:mysql://mysql/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
- spring.datasource.username=root
- spring.datasource.password=root
- hystrix.stream.queue.enabled=false
- spring.cloud.bus.enabled=false
- spring.sleuth.stream.enabled=false
iam-service:
container_name: iam-service
image: registry.cn-shanghai.aliyuncs.com/choerodon/iam-service:0.5.0
depends_on:
- eureka-server
- mysql
- kafka-0
links:
- eureka-server
- mysql
- kafka-0
ports:
- “8030:8030”
environment:
- eureka.client.serviceUrl.defaultZone=http://eureka-server:8000/eureka/
- spring.kafka.bootstrap-servers=kafka-0:9092
- spring.datasource.url=jdbc:mysql://mysql/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
- spring.datasource.username=root
- spring.datasource.password=root
- hystrix.stream.queue.enabled=false
- spring.cloud.bus.enabled=false
- spring.sleuth.stream.enabled=false
manager-service:
container_name: manager-service
image: registry.cn-shanghai.aliyuncs.com/choerodon/manager-service:0.5.0
depends_on:
- eureka-server
- mysql
- kafka-0
links:
- eureka-server
- mysql
- kafka-0
ports:
- “8963:8963”
environment:
- spring.kafka.bootstrap-servers=kafka-0:9092
- eureka.client.serviceUrl.defaultZone=http://eureka-server:8000/eureka/
- spring.datasource.url=jdbc:mysql://mysql/manager_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
- spring.datasource.username=root
- spring.datasource.password=root
- hystrix.stream.queue.enabled=false
- spring.cloud.bus.enabled=false
- spring.sleuth.stream.enabled=false
oauth-server:
container_name: oauth-server
image: registry.cn-shanghai.aliyuncs.com/choerodon/oauth-server:0.5.0
depends_on:
- eureka-server
- mysql
links:
- eureka-server
- mysql
ports:
- “8020:8020”
environment:
- eureka.client.serviceUrl.defaultZone=http://eureka-server:8000/eureka/
- spring.datasource.username=root
- spring.datasource.url=jdbc:mysql://mysql/iam_service?useUnicode=true&characterEncoding=utf-8&useSSL=false
- spring.datasource.password=root
- hystrix.stream.queue.enabled=false
- spring.cloud.bus.enabled=false
- spring.sleuth.stream.enabled=false

谢谢回复,这份配置服务很全,就是不定时退出的问题还是存在

执行 docker logs kafka-0 是否有报错信息呢

信息如下


$ docker logs kafka-0
Found non argument parameters: 鈥搊verride,zookeeper.connect=zookeeper-0:2181,鈥搊verride,log.dirs=/opt/kafka/data/logs,鈥搊verride,broker.id=0
Option Description


–override Optional property that should override values set in
server.properties file


看看你的缩进和换行符啥的有没有问题

开始复制是有问题的,启动不了,我已经编辑过了,才启动的,要错误是启动不了的

所以在格式上应该是没有问题,就不知道参数值是不是哪里要修改

    - "/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 "

这个地方 请问你加换行符了吗

要不你把邮箱啥的私信给我,我直接发给你,这粘贴的格式会乱掉

xianshui.zhu@hand-china.com ,麻烦各位有可以运行的有空发一下,

%E5%9B%BE%E7%89%87

请参考这篇文档 http://choerodon.io/zh/docs/development-guide/backend/develop-env/install_windows/ ,并注意其中换行符 \ 的使用