Centos 6上安裝Saltstack

來源:互聯網
上載者:User

標籤:automation

[[email protected]_server home]# ifconfig eth0 | grep "inet addr:" | awk -F: ‘{print $2}‘ | awk ‘{print $1}‘    192.168.100.228    [[email protected]_server home]# cat /etc/redhat-release     CentOS release 6.3 (Final)    [[email protected]_server home]# uname -r    2.6.32-279.el6.x86_64    [[email protected]_server home]#


http://ftp.linux.ncsu.edu/pub/epel/6/x86_64/
參考文章
http://docs.saltstack.cn/topics/installation/rhel.html

在安裝之前需要注意幾個包

Python 不用說大家都知道 這玩意就python寫的    ZeroMQ 訊息中介軟體相當於puppet的rabbitMQ、activeMQ    PyCrypto  Python密碼工具包    M2Crypto    加密模組 是Python OpenSSL封裝    msgpack-python 高效能的訊息交換格式    YAML    不說大家都知道 檔案格式    Jinja2    解析Salt States (在master設定檔中配置)    MarkupSafe    Implements a XML/HTML/XHTML Markup safe string for Python    apache-libcloud    與大量的主流雲端服務提供者進行互動時統一API的Python類

在安裝之前我們需要設定防火牆的連接埠

lokkit  -p 4505:tcp -p 4506:tcp

一、安裝master salt-master 2014.1.1版本
下載安裝
記住路徑下次直接安裝不需要下載
如果想本地儲存需要緩衝
vim /etc/yum.conf
keepcache=1 修改成1

安裝master 17.0.5版本,首先要安裝好本地源碼

[[email protected]_server mnt]# yum install python-jinja2    [[email protected]_server mnt]# yum install salt-master

安裝minion 17.0.5版本

[[email protected]_client1 ~]# yum install python-jinja2    [[email protected]_client1 ~]# yum install salt-minion

三、啟動master
[[email protected]_server ~]# vim /etc/salt/master  如下是正確寫法不然會報錯

#interface: 0.0.0.0    interface: 192.168.100.228    [[email protected]_server ~]# /etc/rc.d/init.d/salt-master start    Starting salt-master daemon:                               [  OK  ]    [[email protected]_server ~]# chkconfig --level 35 salt-master on    [[email protected]_server ~]#

四、修改minion然後啟動

[[email protected]_client1 ~]# cat  /etc/salt/minion | grep 100.228    master: 192.168.100.228                這個maste可以填寫maste的主機名稱也可以使ip地址    [[email protected]_client1 ~]#

還需要修改id 這個ID是伺服器標識用戶端的東西,如果配置ID 服務端將是以ID的 名字為標準,需要注意
id: salt_client1

[[email protected]_client1 ~]# /etc/rc.d/init.d/salt-minion start   Starting salt-minion daemon:                               [  OK  ]    [[email protected]_client1 ~]# chkconfig --level 35 salt-minion on    [[email protected]_client1 ~]#

五、在master上查看是否有用戶端key的請求

[[email protected]_server ~]# salt-key -L    Accepted Keys:    Unaccepted Keys:    salt_client1    Rejected Keys:    [[email protected]_server ~]#

六、master來批准用戶端的請求檔案
—————A是通過用戶端全部的請求檔案
—————d是這個選項是刪除認證請求檔案

[[email protected]_server ~]# salt-key -a salt_client1    The following keys are going to be accepted:    Unaccepted Keys:    salt_client1    Proceed? [n/Y] Y    Key for minion salt_client1 accepted.    [[email protected]_server ~]#

如果不想去手動確認,那麼我們修改設定檔就可以自動確認
修改設定檔vim /etc/salt/master
#auto_accept: False
去掉其中的#號 把False修改成True就可以

查看key

[[email protected]_server base]# salt-key -f salt_client1    Accepted Keys:    salt_client1:  20:a6:2d:6b:24:4a:a9:bc:77:72:ba:6f:30:22:20:7f    [[email protected]_server base]# salt ‘salt_client1‘ cmd.run ‘salt-call key.finger --local‘    salt_client1:        local:            20:a6:2d:6b:24:4a:a9:bc:77:72:ba:6f:30:22:20:7f    [[email protected]_server base]#

測試:

[[email protected]_server ~]# salt ‘salt*‘ test.ping   salt_client1:        True    salt_client2:        True    [[email protected]_server ~]#


本文出自 “營運之家(Q群:1991706)” 部落格,請務必保留此出處http://304076020.blog.51cto.com/7503470/1553222

Centos 6上安裝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.