saltstack-部署
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                saltstack-部署
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                ?
?
?
安裝epel源(所有主機安裝)
[root@salt-server /]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo- 安裝salt
 
master安裝salt
[root@salt-server /]# yum -y install salt-master?client安裝
[root@salt-client-01 /]# yum -y install salt-minion [root@salt-client-02 /]# yum -y install salt-minion?
查看master支持的命令
[root@salt-server /]# salt (tab鍵補全) salt salt-key salt-run salt-cp salt-master salt-unity?
client支持的命令
[root@salt-client-01 /]# salt- salt-call salt-minion?
修改client配置文件 (這里保持默認配置)
[root@salt-client-01 /]# vim /etc/salt/minion 16 #master: salt #默認為salt 可改為master的IP 78 #id: #默認為主機名 可根據自身環境修改 唯一的不能沖出?
?修改/etc/hosts
[root@salt-client-01 /]# echo "192.168.119.132 salt" >> /etc/hosts [root@salt-client-02 /]# echo "192.168.119.132 salt" >> /etc/hosts?
啟動服務(先啟動master)
[root@salt-server /]# /etc/init.d/salt-master start Starting salt-master daemon: [ OK ][root@salt-client-01 /]# /etc/init.d/salt-minion start Starting salt-minion daemon: [ OK ][root@salt-client-02 /]# /etc/init.d/salt-minion start Starting salt-minion daemon: [ OK ]?
命令執行
[root@salt-server /]# salt-key -L #顯示所有minion認證信息 Accepted Keys: Denied Keys: Unaccepted Keys: salt-client-01 salt-client-02 Rejected Keys: [root@salt-server /]# salt-key -A -y # -A接受所有Unaccepted狀態的minion認證信息 -a接受指定主機 -y 執行過程中自動yes不用手動 The following keys are going to be accepted: Unaccepted Keys: salt-client-01 salt-client-02 Key for minion salt-client-01 accepted. Key for minion salt-client-02 accepted. [root@salt-server /]# salt-key -L Accepted Keys: salt-client-01 salt-client-02 Denied Keys: Unaccepted Keys: Rejected Keys: [root@salt-server /]# salt '*' test.ping salt-client-01:True salt-client-02:True?master目錄
[root@salt-server salt]# cd pki/ [root@salt-server pki]# ls master [root@salt-server pki]# cd master/ [root@salt-server master]# ls master.pem minions minions_denied minions_rejected master.pub minions_autosign minions_pre [root@salt-server master]# pwd /etc/salt/pki/masterminions #已通過認證的key minions_pre #等待認證的key minions_rejected #拒絕的key[root@salt-server master]# pwd /etc/salt/pki/master [root@salt-server master]# ls minions/ salt-client-01 salt-client-02 使用salt-key -d 'salt-client-01' -y 把salt-client-01提出 [root@salt-server master]# ls minions_pre/ salt-client-01 salt-minion-01?
轉載于:https://www.cnblogs.com/hwlong/p/6126223.html
總結
以上是生活随笔為你收集整理的saltstack-部署的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 5个值得安利的PC软件,建议收藏转发
 - 下一篇: redis 值字符串前面部分乱码_Str