Saltstack 安裝使用

來源:互聯網
上載者:User

標籤:http   使用   os   io   檔案   for   art   問題   

Saltstack是一個具備puppet與func功能為一身的集中化,輕量級的自動化營運管理工具,使用python編寫,功能非常強大,可以使用EPEL快速安裝。相比較puppet,安裝和配置更加容易和簡單。

 

EPEL Install

[[email protected] ~]# rpm -Uvh  http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm###CentOS 5.x###rpm -Uvh https://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

 

1、安裝salt-master(僅安裝於Master主機)

[[email protected] ~]# yum -y install salt-master salt####salt-minmion 被管理機器###[[email protected] ~]# yum -y install salt-minion

 

2、配置Saltstack

##############salt-Master##################[[email protected] ~]# awk ‘!/^[\ ]$/‘ /etc/salt/master # salt啟動並執行使用者,影響到salt的執行許可權 #user: root#s alt的運行線程,開的線程越多一般處理的速度越快,但一般不要超過CPU的個數 #worker_threads: 10# master的管理連接埠 #publish_port : 4505# master跟minion的通訊連接埠,用於檔案服務,認證,接受返回結果等 #ret_port : 4506# 如果這個master啟動並執行salt-syndic串連到了一個更高層級的master,那麼這個參數需要配置成串連到的這個高層級master的監聽連接埠 #syndic_master_port : 4506# 指定pid檔案位置 #pidfile: /var/run/salt-master.pid# saltstack 可以控制的檔案系統的開始位置 #root_dir: /# 記錄檔地址 #log_file: /var/log/salt_master.log# 分組設定 #nodegroups:  group_all: ‘*‘# salt state執行時候的根目錄 #file_roots:  base:    - /etc/salt/file# 設定pillar 的根目錄 #pillar_roots:  base:    - /etc/salt/pillar##############salt-Minion##################[[email protected] ~]# awk ‘!/^[\ ]$/‘ /etc/salt/minion # minion的識別ID,可以是IP,網域名稱,或是可以通過DNS解析的字串 #id: 192.168.1.99# salt啟動並執行使用者權限 #user: root# master的識別ID,可以是IP,網域名稱,或是可以通過DNS解析的字串 #master : 192.168.1.99# master通訊連接埠 #master_port: 4506# 備份模式,minion是本地備份,當進行檔案管理時的檔案備份模式 #backup_mode: minion# 執行salt-call時候的輸出方式 #output: nested# minion等待master接受認證的時間 #acceptance_wait_time: 10# 失敗重連次數,0表示無限次,非零會不斷嘗試到設定值後停止嘗試 #acceptance_wait_time_max: 0# 重新認證延遲時間,可以避免因為master的key改變導致minion需要重新認證的syn風暴 #random_reauth_delay: 60# 記錄檔位置 #log_file: /var/logs/salt_minion.log# 檔案路徑基本位置 #file_roots:  base:    - /etc/salt/minion/file# pillar基本位置 #pillar_roots:  base:    - /data/salt/minion/pillar#####啟動SaltStack#####[[email protected] ~]# service salt-master startStarting salt-master daemon:                               [  OK  ][[email protected] ~]# service salt-minion startStarting salt-minion daemon:                               [  OK  ]OR[[email protected] ~]# python2.6 /usr/bin/salt-master -d[[email protected] ~]# python2.6 /usr/bin/salt-minion -d####Python 3.0 會存在相容性問題####

 

3、測試SaltStck

[[email protected] ~]# salt-keyAccepted Keys:Unaccepted Keys:192.168.1.99Rejected Keys:[[email protected] ~]# salt-key -y -a 192.168.1.99The following keys are going to be accepted:Unaccepted Keys:192.168.1.99Key for minion 192.168.1.99 accepted.##移除Salt-Minion 的認證##[[email protected] ~]# salt-key -y -d  192.168.1.99Deleting the following keys:Accepted Keys:192.168.1.99Key for minion 192.168.1.99 deleted.##測試##[[email protected] ~]# salt ‘192.168.1.99‘ test.ping --show-timeout192.168.1.99:    True

 

» 轉載保留著作權:IT辰逸 » 《Saltstack 安裝使用》» 本文連結地址:http://www.ipython.me/centos/saltstack-install-and-using.html» 本文著作權採取: BY-NC-SA 協議進行授權,轉載註明出處。除IT-Tools、News以及特別標註,本站所有文章均為原創。» 如果喜歡可以: 點此訂閱本站

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.