zoukankan      html  css  js  c++  java
  • saltstack syndic

    #syndic 相当于master的代理,master通过syndic代理控制node主机

    master <------ syndic+master <---------- node

    master修改

    [root@k8s_master ~]# cat /etc/salt/master |grep -v "grep|^$|^#"|grep order_masters
    order_masters: True
    [root@k8s_master ~]# 

    syndic+master

    [root@slave3 ~]# yum install salt-syndic
    [root@slave3 ~]# cat /etc/salt/master |grep -v "grep|^$|^#"
    syndic_master: 192.168.132.148                #这里指向master的ip
    [root@slave3 ~]# systemctl restart salt-master
    [root@slave3 ~]# systemctl start salt-syndic

    master查看key

    [root@k8s_master ~]# salt-key
    Accepted Keys:
    k8s_master
    k8s_node1
    k8s_node2
    slave3
    Denied Keys:
    Unaccepted Keys:
    Rejected Keys:

    node设置:

    [root@slave3 ~]# cat /etc/salt/minion |grep -v "grep|^$|^#"
    master: 192.168.132.141            #syndic+master 主机ip
    id: slave3
    
    [root@slave3 ~]# systemctl start salt-minion

    syndic+master主机

    [root@slave3 ~]# salt-key 
    Accepted Keys:
    slave3
    Denied Keys:
    Unaccepted Keys:
    Rejected Keys:

    在syndic+master主机上执行job,然后在master主机上查看结果

    #syndic+master主机
    [root@slave3 ~]
    # salt 'slave3' cmd.run ifconfig slave3: ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.132.141 netmask 255.255.255.0 broadcast 192.168.132.255 inet6 fe80::c417:d467:ea7e:9cda prefixlen 64 scopeid 0x20<link> ether 00:0c:29:a7:b3:0f txqueuelen 1000 (Ethernet) RX packets 72554 bytes 42829743 (40.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 68017 bytes 10703886 (10.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 #master主机 [root@k8s_master ~]# salt-run jobs.list_jobs ...... ....... ....... 20180125191843784925: ---------- Arguments: - ifconfig Function: cmd.run StartTime: 2018, Jan 25 19:18:43.784925 Target: slave3 Target-type: glob User: root [root@k8s_master ~]# salt-run jobs.lookup_jid 20180125191843784925 slave3: ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.132.141 netmask 255.255.255.0 broadcast 192.168.132.255 inet6 fe80::c417:d467:ea7e:9cda prefixlen 64 scopeid 0x20<link> ether 00:0c:29:a7:b3:0f txqueuelen 1000 (Ethernet) RX packets 72554 bytes 42829743 (40.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 68017 bytes 10703886 (10.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

    sls(state)使用说明

    master里的top.sls不能直接指定到客户端(minion)的id做管理,但可以直接管理minion(不通过sls),

    绿色字体说明:master可以在自己的top.sls里的目标直接写minion的id(此id没有被master接受),只不过执行的top.sls为syndic+master下的top.sls,而master自己的top.sls不会被执行

     

  • 相关阅读:
    洛谷P2089 烤鸡
    HDU-1000 A+B Problem
    《新标准C++程序设计》4.7-4.9(C++学习笔记17)
    《新标准C++程序设计》4.6(C++学习笔记16)
    面向对象程序设计寒假作业3
    《新标准C++程序设计》4.5(C++学习笔记15)
    《新标准C++程序设计》4.4(C++学习笔记14)
    《新标准C++程序设计》4.2-4.3(C++学习笔记13)
    洛谷题解P1047 校门外的树
    [lr] 矫正白平衡
  • 原文地址:https://www.cnblogs.com/FRESHMANS/p/8352530.html
Copyright © 2011-2022 走看看