开发者社区> 问答> 正文

docker compose 指定自定义配置文件启动seata-server失败

错误日志

Exception in thread "main" io.seata.common.exception.NotSupportYetException: not support register type: null
	at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:103)
	at io.seata.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:87)
	at io.seata.server.metrics.MetricsManager.init(MetricsManager.java:49)
	at io.seata.server.Server.main(Server.java:66)
Caused by: java.lang.IllegalArgumentException: illegal type:null
	at io.seata.config.ConfigType.getType(ConfigType.java:70)
	at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:101)
	... 3 more

配置文件:

---docker-compose
version: '3.5'
services:
  seata-server:
    image: seataio/seata-server
    hostname: seata-server
    ports:
      - "8091:8091"
    volumes:
      - /usr/local/docker/seata/logs:/root/logs/seata
    environment:
      - SEATA_PORT=8091
      - STORE_MODE=file
      - SEATA_CONFIG_NAME=file:/usr/local/docker/seata/registry

----registry
registry {
  # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa
  type = "file"

  nacos {
    serverAddr = "localhost"
    namespace = ""
    cluster = "default"
  }
  eureka {
    serviceUrl = "http://localhost:8761/eureka"
    application = "default"
    weight = "1"
  }
  redis {
    serverAddr = "localhost:6379"
    db = "0"
  }
  zk {
    cluster = "default"
    serverAddr = "127.0.0.1:2181"
    session.timeout = 6000
    connect.timeout = 2000
  }
  consul {
    cluster = "default"
    serverAddr = "127.0.0.1:8500"
  }
  etcd3 {
    cluster = "default"
    serverAddr = "http://localhost:2379"
  }
  sofa {
    serverAddr = "127.0.0.1:9603"
    application = "default"
    region = "DEFAULT_ZONE"
    datacenter = "DefaultDataCenter"
    cluster = "default"
    group = "SEATA_GROUP"
    addressWaitTime = "3000"
  }
  file {
    name = "file.conf"
  }
}

config {
  # file、nacos 、apollo、zk、consul、etcd3
  type = "file"

  nacos {
    serverAddr = "localhost"
    namespace = ""
  }
  consul {
    serverAddr = "127.0.0.1:8500"
  }
  apollo {
    app.id = "seata-server"
    apollo.meta = "http://192.168.1.204:8801"
  }
  zk {
    serverAddr = "127.0.0.1:2181"
    session.timeout = 6000
    connect.timeout = 2000
  }
  etcd3 {
    serverAddr = "http://localhost:2379"
  }
  file {
    name = "file.conf"
  }
}

展开
收起
一人吃饱,全家不饿 2021-02-02 10:50:04 2313 0
来自:阿里开源
1 条回答
写回答
取消 提交回答
  • 配置错了, SEATA_CONFIG_NAME 这个配置的路径指向的是容器内的路径,改成/root/logs/seata

    2021-02-02 10:50:14
    赞同 展开评论 打赏
来源圈子
更多
收录在圈子:
+ 订阅
阿里巴巴相信开源的世界里人人贡献代码,人人获得收益,共同创造一个互帮互利的社区,促进技术进步和发展。
问答排行榜
最热
最新

相关电子书

更多
应用 Docker 进行持续交付:用技术改变交付路程 立即下载
从Docker到容器服务 立即下载
Docker@Alibaba——超大规模Docker化的实战经验 立即下载