Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

FreeBSD 8.2 使用 Ports 安裝與配置 SaltStack 完整教學

編輯:關於 Linux

SaltStack 是強大的分散式配置管理與遠端執行工具。在 FreeBSD 8.2 上安裝 Salt,建議使用 Ports 集合,系統會自動處理龐大的依賴套件。本文記錄從更新 Ports 樹、安裝依賴、編譯 Salt Master 到基本配置的完整流程。

環境準備

  • 作業系統:FreeBSD 8.2
  • 安裝方式:Ports(需先更新 Ports 樹)

步驟 1:更新 Ports 樹

預設 Ports 中可能尚無 Salt 相關套件,需重新下載或升級 Ports 集合:

# 移除舊 Ports 目錄(備份)
mv /usr/ports /usr/ports.old
cd /usr
# 下載並解壓最新 Ports 快照(約 20 分鐘)
portsnap fetch extract

步驟 2:安裝 Salt Master 及依賴

新 Ports 目錄中會出現 sysutils/py-salt:

cd /usr/ports/sysutils/py-salt
make install clean

編譯過程中可能提示 libtool 版本過低(需 ≥ 2.4),需先升級:

cd /usr/ports/devel/libtool
make install clean FORCE_PKG_REGISTER=yes

完成後再回到 py-salt 目錄繼續安裝。

步驟 3:配置 Salt Master

安裝完成後,複製範例配置檔並編輯:

cp /usr/local/etc/salt/master.sample /usr/local/etc/salt/master
vi /usr/local/etc/salt/master
# 依需求修改 interface、publish_port、file_roots、pillar_roots 等

步驟 4:啟動與驗證

# 加入開機自啟
echo 'salt_master_enable="YES"' >> /etc/rc.conf
# 啟動服務
service salt_master start
# 驗證
salt-key -L
salt '*' test.ping

FreeBSD Salt 安裝過程截圖

小結

透過 Ports 安裝 SaltStack 可自動解決依賴問題,雖編譯耗時較長,但最適合 FreeBSD 環境。安裝完成後記得配置 master 檔並啟動服務,即可開始管理 Minion 節點。

Copyright © Windows教程網 All Rights Reserved