首页 > 其他 > 详细

centraldogma ha 配置

时间:2021-06-14 17:12:54      阅读:15      评论:0      收藏:0      [点我收藏+]

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

centraldogma ha 配置

原文:https://www.cnblogs.com/rongfengliang/p/14881953.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!