zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Git常用命令
    maven profile动态选择配置文件
    Nodejs的偏函数
    用CountDownLatch来同步java的多线程
    NodeJS的Promise的用法
    alluxio常用命令
    常见小代码
    Mongodb
    Mysql_常用语法
    PostgreSQL
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/14881953.html
Copyright © 2011-2022 走看看