本文共 2386 字,大约阅读时间需要 7 分钟。
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | minion端 [root@linux-node2 salt] # tree . ├── minion ├── minion.d │ └── _schedule.conf ├── minion_id #客户端的ID └── pki └── minion ├── minion_master.pub ├── minion.pem └── minion.pub 3 directories, 6 files [root@linux-node2 salt] # pwd /etc/salt [root@linux-node2 salt] # master端 [root@linux-node1 salt] # tree . ├── master ├── minion ├── minion.d │ └── _schedule.conf ├── minion_id └── pki ├── master │ ├── master.pem │ ├── master.pub │ ├── minions │ │ ├── linux-node1.example.com │ │ └── linux-node2.example.com │ ├── minions_autosign │ ├── minions_denied │ ├── minions_pre │ └── minions_rejected └── minion ├── minion_master.pub ├── minion.pem └── minion.pub 9 directories, 11 files [root@linux-node1 salt] # pwd /etc/salt [root@linux-node1 salt] # 1.salt minion /etc/salt/minion master 改成master的IP 域名也行 启动后生成 minion端的 ├── minion.pem └── minion.pub #公钥 master端启动 └── minion ├── minion_master.pub #生成的master端的配置文件 2.salt-key -A /-a 增加以后 master端会把公钥传到minion端 3.然后 master端会生成 │ ├── minions │ │ ├── linux-node1.example.com │ │ └── linux-node2.example.com ‘ 这个就是minion端的公钥 master端 4505 端口 发送 消息 4506 端口 负责接收消息 master和minion 采用消息队列的方式 效用发布和订阅的模式 所以快 [root@linux-node1 salt] # lsof -ni:4505 COMMAND PID USER FD TYPE DEVICE SIZE /OFF NODE NAME salt-mast 11948 root 13u IPv4 31472 0t0 TCP *:4505 (LISTEN) salt-mast 11948 root 15u IPv4 34969 0t0 TCP 192.168.56.11:4505->192.168.56.12:34318 (ESTABLISHED) salt-mast 11948 root 16u IPv4 35043 0t0 TCP 192.168.56.11:4505->192.168.56.11:54330 (ESTABLISHED) salt-mini 12616 root 25u IPv4 35042 0t0 TCP 192.168.56.11:54330->192.168.56.11:4505 (ESTABLISHED) [root@linux-node1 salt] # lsof -ni:4506 COMMAND PID USER FD TYPE DEVICE SIZE /OFF NODE NAME salt-mast 11960 root 21u IPv4 31480 0t0 TCP *:4506 (LISTEN) salt-mast 11960 root 28u IPv4 34968 0t0 TCP 192.168.56.11:4506->192.168.56.12:48642 (ESTABLISHED) salt-mast 11960 root 29u IPv4 34975 0t0 TCP 192.168.56.11:4506->192.168.56.11:34578 (ESTABLISHED) salt-mini 12616 root 14u IPv4 34974 0t0 TCP 192.168.56.11:34578->192.168.56.11:4506 (ESTABLISHED) [root@linux-node1 salt] # |