centraldogma ha 配置

centraldogma 支持ha模式的运行(依赖zk),以下是参考配置

环境准备

  • docker-compose
version: "3"
services: 
    app:
        image: line/centraldogma
        volumes: 
        - "./shiro.ini:/opt/centraldogma/conf/shiro.ini"
        - "./dogma.json:/opt/centraldogma/conf/dogma.json"
        ports: 
        - "36462:36462"
    app2:
        image: line/centraldogma
        volumes: 
        - "./shiro.ini:/opt/centraldogma/conf/shiro.ini"
        - "./dogma2.json:/opt/centraldogma/conf/dogma.json"
        ports: 
        - "36463:36462"
    app3:
        image: line/centraldogma
        volumes: 
        - "./shiro.ini:/opt/centraldogma/conf/shiro.ini"
        - "./dogma3.json:/opt/centraldogma/conf/dogma.json"
        ports: 
        - "36464:36462"
  • 配置
    主要是关于dogma的,核心如下,具体参考github
 
"replication" : {
        "method": "ZOOKEEPER",
        "serverId": 1, // id 需要不同,因为使用了嵌入的zk,实际上就是myid,需要不同,而且需要奇数节点
        "servers": {
          "1": {
            "host": "app",
            "quorumPort": 36463,
            "electionPort": 36464,
            "groupId": null,
            "weight": null
          },
          "2": {
            "host": "app2",
            "quorumPort": 36463,
            "electionPort": 36464,
            "groupId": null,
            "weight": null
          },
          "3": {
            "host": "app2",
            "quorumPort": 36463,
            "electionPort": 36464,
            "groupId": null,
            "weight": null
          }
        },
        "secret": "JqJAkZ!oZ6MNx4rBpIH8M*yuVWXDULgR",
        "additionalProperties": {},
        "timeoutMillis": null,
        "numWorkers": null,
        "maxLogCount": null,
        "minLogAgeMillis": null
    },

运行效果

 

 


数据

 

 

说明

centraldogma 的ha 使用了内嵌模式的zk,或者部署起来还是比较方便的(但是注意如果使用了容器数据持久化必须做),以下是参考的数据格式
(容器内部存储,内嵌zk的数据目录)

 

 

参考资料

https://line.github.io/centraldogma/setup-configuration.html
https://github.com/rongfengliang/centraldogma-ha

posted on   荣锋亮  阅读(115)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2016-06-14 webpack es6支持配置

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示