日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
CentOS7.2安裝部署SaltStack
  1. Saltstack安裝文檔:https://repo.saltstack.com/#rhel

SaltStack的安裝與簡(jiǎn)單配置,應(yīng)用。

創(chuàng)新互聯(lián)建站是專(zhuān)業(yè)的屏山網(wǎng)站建設(shè)公司,屏山接單;提供網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì),網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專(zhuān)業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行屏山網(wǎng)站開(kāi)發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專(zhuān)業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,專(zhuān)業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!

一.環(huán)境

Server:centos Linux release 7.2.1511 (Core)

Salt-master:172.18.12.201

Salt-minion:172.18.12.204

二.Saltstack安裝與配置

1. yum安裝

# Salt-master安裝:
[root@localhost ~]# yum install https://repo.saltstack.com/yum/RedHat/salt-repo-latest-1.el7.noarch.rpm
[root@localhost ~]# yum clean expire-cache
[root@localhost ~]# yum install salt-master

# Salt-minion安裝,最后一步安裝組件有區(qū)別:
[root@localhost ~]# yum install salt-minion

2. 防火墻配置(salt-master)

# CentOS7.2默認(rèn)自帶firewall,無(wú)iptable;
# 移除系統(tǒng)自帶firewall的開(kāi)機(jī)啟動(dòng),安裝iptable,設(shè)置iptable開(kāi)機(jī)啟動(dòng)
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
[root@localhost ~]# yum install iptables-services –y
[root@localhost ~]# systemctl enable iptables.service
[root@localhost ~]# systemctl restart iptables.service

# tcp4506是salt-master發(fā)送命令信息的端口,tcp4506是salt-minion返回信息的端口;
# Salt-minion可不做防火墻處理,默認(rèn)iptable規(guī)則即可
[root@localhost ~]# vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 4505 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 4506 -j ACCEPT

3. salt-master配置

#interface參數(shù)綁定master的通信ip,默認(rèn)可不變更,表示所有主機(jī)ip;
[root@localhost ~]# sed -i 's/#interface: 0.0.0.0/interface: 172.18.12.201/g' /etc/salt/master

# hash_type參數(shù)默認(rèn)可不變更,salt-master也可啟動(dòng),但啟動(dòng)后有告警如下:
# [WARNING ] IMPORTANT: Do not use md5 hashing algorithm! Please set "hash_type" to sha256 in Salt Master config!
[root@localhost ~]# sed -i 's/#hash_type: md5/hash_type: sha256/g' /etc/salt/master

# auto_accept參數(shù)是自動(dòng)認(rèn)證開(kāi)關(guān),默認(rèn)關(guān)閉,使用salt-key確認(rèn)證書(shū)信任
[root@localhost ~]# sed -i 's/#auto_accept: False/auto_accept: True/g' /etc/salt/master

4. salt-minion配置

# master參數(shù)指定master 的ip (或者主機(jī)名),必配參數(shù),如果minion啟動(dòng)時(shí)不能解析到master 主機(jī),啟動(dòng)會(huì)失??;
[root@localhost ~]# sed -i 's/#master: salt/master: 172.18.12.201/g' /etc/salt/minion

# hash_type參數(shù)同master;
[root@localhost ~]# sed -i 's/#hash_type: sha256/hash_type: sha256/g' /etc/salt/master

# id參數(shù)設(shè)置salt-minion名,默認(rèn)未設(shè)置,minio名取主機(jī)hostname中設(shè)定的主機(jī)名
[root@localhost ~]# sed -i 's/#id:/id: 172.18.12.204/g' /etc/salt/minion

5. 啟動(dòng)服務(wù)

啟動(dòng)salt-master

# 設(shè)置開(kāi)機(jī)啟動(dòng),啟動(dòng)后查看狀態(tài);
# 啟動(dòng)中有問(wèn)題可通過(guò)"systemctl status salt-master.service"與"salt-mater -l debug"等命令定位故障,下面salt-minion相同
[root@localhost ~]# systemctl enable salt-master.service 
[root@localhost ~]# systemctl start salt-master.service
[root@localhost ~]# systemctl status salt-master.service

啟動(dòng)salt-minion

#設(shè)置開(kāi)機(jī)啟動(dòng),啟動(dòng)后查看狀態(tài)
[root@localhost ~]# systemctl enable salt-minion.service
[root@localhost ~]# systemctl start salt-minion.service
[root@localhost ~]# systemctl status salt-mionion.service

6. 驗(yàn)證(salt-master)

查看minion表

[root@localhost ~]# salt-key -L

Salt-master已經(jīng)設(shè)置"auto_accept"參數(shù)為"True",minion主機(jī)"172.18.12.204"已在"Acceptd Keys"中(主機(jī)名為salt-minion設(shè)置的id或hostname)。

手動(dòng)認(rèn)證key("auto_accept"參數(shù)為"False"時(shí))

# -A指確認(rèn)"Unacceptd Keys"中的全部minion(unacceptd中的minion列表為紅色,確認(rèn)到accepted列表中后變?yōu)榫G色)
[root@localhost ~]# salt-key -A

# -a指"Unacceptd Keys"中特定的minion
# 或[root@localhost ~]# salt-key -a 172.18.12.204

簡(jiǎn)單的命令測(cè)試

# "*"表示所有"Acceptd Keys"中的minion,也可以對(duì)特定的minion執(zhí)行命令;
# 返回值為"True"表示master與minion連接成功
[root@localhost ~]# salt "*" test.ping
#使用"cmd.run"可以執(zhí)行具體的命令
[root@localhost ~]# salt "*" cmd.run "iptables -nL"

本文名稱(chēng):CentOS7.2安裝部署SaltStack
文章位置:http://www.dlmjj.cn/article/dhhsedj.html