• Centos 7 Saltstack 集群


    一. Saltstack  双master

    master1 -------------------master2

     |

    minion       

                    

    master1

    1.yum -y install  salt-master

    2.vim /etc/salt/master

    auto_accept: True 

    master2

    1.yum -y install  salt-master

    2.vim /etc/salt/master

    auto_accept: True 

    拷贝 maser1的 

    /etc/salt/pki/master/master.pem

    /etc/salt/pki/master/master.pub

    以上两个文件覆盖掉

    minion

    1.yum -y install salt-minion

    2.vim  /etc/salt/minion 添加下面内容

    master: 

      - master1

      - master2

    id: minion

    当其中一台master挂了 另一台依然可以使用

    二. Saltstack  syndic集群架构

    bb4b3cb97c6551e45020a460edc1c707.png-wh_

    master   192.168.90.177

    syndic1  192.168.90.178

    syndic2  192.168.90.185

    minion   192.168.90.186

     master

    # salt-key -L

    Accepted Keys:

    192.168.90.178

    syndic1

    # salt-key -L

    Accepted Keys:

    192.168.90.185

    Denied Keys:

    syndic2

    #salt-key -L

    Accepted Keys:

    192.168.90.186

    192.168.90.177            master    (安装salt-master)

    192.168.90.178            syndic1     (安装salt-mater和salt-syndic)

    192.168.90.185            syndic2    (安装salt-mater和salt-syndic )

    192.168.90.186            minion    (安装salt-minion)

    1.master

    # cat /etc/salt/master |grep -v "#" |grep -v "^ *$"

    ipv6: False

    interface: 192.168.90.177

    auto_accept: True

    state_top: top.sls

    file_roots:

      base:

        - /etc/salt/base

      prod:

        - /etc/salt/prod

    pillar_roots:

      base:

        - /etc/salt/pillar/base

      prod:

        - /etc/salt/pillar/prod

    order_masters: True

    2.syndic1  

    # cat /etc/salt/master |grep -v "#" |grep -v "^ *$"

    interface: 192.168.90.178

    ipv6: False

    auto_accept: True

    file_roots:

      prod:

        - /etc/salt/prod

    order_masters: True

    syndic_master: 192.168.90.177

    3.syndic2  

    # cat /etc/salt/master |grep -v "#" |grep -v "^ *$"    

    ipv6: False

    auto_accept: True

    file_roots:

      prod:

        - /etc/salt/prod

    syndic_master: 192.168.90.178

    4.minion

    # cat /etc/salt/minion |grep -v "#" |grep -v "^ *$"

    master: 192.168.90.185

    id: 192.168.90.186

    当在master上执行

    #salt '192.168.90.186'  state.highstate  时 会去执行syndic2上 配置的top.sls文件,不会执行master上和syndic1上的file_roots、pillar和grains定义的内容。

    三.混合的

    065b7da5b203882d445ee7771a1de6b0.png-wh_

    大致相同。

  • 相关阅读:
    RPM包校验和提取
    RPM包查询
    Find命令简介
    无法启动配置好的虚拟机
    文档发布至博客操作说明
    VMware Virtual Machine安装报错解决1
    python create home dircetory
    Centos7/Active Directory authentication using nss-pam-ldapd
    java try后面括号的作用
    vps上搭建jupyter notebook远程服务
  • 原文地址:https://www.cnblogs.com/linkenpark/p/9218238.html
Copyright © 2020-2023  润新知