centos yum安裝saltstack

來源:互聯網
上載者:User

標籤:

1.匯入安裝源

centos5

rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

centos6

rpm -Uvh http://ftp.linux.ncsu.edu/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2.安裝salt軟體包

master端

yum install salt-master

minion端(俗稱的client端)

yum install salt-minion

3.配置修改

master端

[[email protected] ~]# sed -e ‘s/#.*//‘ -e ‘/^$/ d‘ /etc/salt/master interface: 0.0.0.0publish_port: 4505user: rootmax_open_files: 100000ret_port: 4506pidfile: /var/run/salt-master.pidsyndic_log_file: syndic.loglog_file: /var/log/salt/masterkey_logfile: /var/log/salt/keylog_fmt_logfile: ‘%(asctime)s,%(msecs)03.0f [%(name)-17s][%(levelname)-8s] %(message)s‘

minion端

[[email protected] ~]# sed -e ‘s/#.*//‘ -e ‘/^$/ d‘ /etc/salt/minionmaster: salt.server.365dw.cnmaster_port: 4506pidfile: /var/run/salt-minion.pidpki_dir: /etc/salt/pki/minionid: client01.server.365dw.cncachedir: /var/cache/salt/minion

4.重啟服務端及用戶端

master端:

/etc/init.d/iptables stop/etc/init.d/salt-master restart

minion端:

/etc/init.d/iptables stop/etc/init.d/salt-minion restart

5.認證認證

slat-key -L 查看後發現Unaccepted keys[[email protected] ~]# salt-key -LAccepted Keys:Unaccepted Keys:client01.server.365dw.cnRejected Keys:salt-key -A 認證,Proceed輸入Y[[email protected] ~]# salt-key -AThe following keys are going to be accepted:Unaccepted Keys:client01.server.365dw.cnProceed? [n/Y] YKey for minion client01.server.365dw.cn accepted.再次salt-key -L查看,Unaccepted Keys未認證的用戶端變成了accept的用戶端。[[email protected] ~]# salt-key -LAccepted Keys:client01.server.365dw.cnUnaccepted Keys:Rejected Keys:

6.測試,使用salt內建的cmd.run命令進行ping 測試。

[[email protected] ~]# salt ‘*‘ cmd.run ‘ping -c1 www.365dw.cn‘client01.server.365dw.cn:    PING www.365dw.cn (112.124.43.79) 56(84) bytes of data.    64 bytes from 112.124.43.79: icmp_seq=1 ttl=128 time=12.5 ms        --- www.365dw.cn ping statistics ---    1 packets transmitted, 1 received, 0% packet loss, time 0ms    rtt min/avg/max/mdev = 12.534/12.534/12.534/0.000 ms

centos yum安裝saltstack

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.