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

CentOS 掛載 GlusterFS 失敗?排查網路與防火牆的關鍵步驟

編輯:關於 Linux

CentOS 叢集環境中掛載 GlusterFS 卷時,若出現 rpc.statd is not running、Operation not permitted 或 timeout 錯誤,絕大多數源於節點間網路不通或防火牆阻攔。本文從錯誤現象切入,提供系統化的網路配置排查與修復指南,助你快速恢復分散式儲存服務。

典型錯誤現象

# mount target_host:/volume_name /mount_point
/usr/sbin/start-statd: line 8: systemctl: command not found
mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: Operation not permitted

同時執行 gluster volume info 發現遠端節點狀態為 Offline,確認為網路連通性問題。

核心排查兩步走

1. 檢查並修復 iptables 防火牆規則

# 備份現有規則
cp /etc/sysconfig/iptables /etc/sysconfig/iptables.bak

# 導出當前生效規則並對比
service iptables save
diff /etc/sysconfig/iptables /etc/sysconfig/iptables.bak

# 若有差異,修正後重啟防火牆
service iptables restart

重點確認 TCP 24007/24008(Gluster 管理)、24009+(brick 通訊)、111(rpcbind)、38465-38467(NLM)等埠是否放行。

2. 確認 IP 配置與網路連通性

# 檢查 IP 是否變更、是否同網段
ifconfig

# 如有變更,恢復原配置並重啟網路服務
service network restart

# 測試節點間連通性
ping target_host
telnet target_host 24007

掛載命令補充

網路修復後,先嘗試不指定型別掛載:

mount target_host:/volume_name /mount_point

若仍失敗,顯式指定型別:

mount -t glusterfs target_host:/volume_name /mount_point

避坑提醒

  • GlusterFS 依賴 rpcbind/statd 進行鎖管理,確保 rpcbind 服務在所有節點運行;
  • CentOS 7 建議改用 firewall-cmd 管理防火牆,永久開放埠:
    firewall-cmd --permanent --add-port=24007-24008/tcp 等;
  • 生產環境建議配置 /etc/hosts 實現節點間主機名解析,避免 DNS 故障影響。

解決網路層面的阻隔,GlusterFS 掛載通常即可恢復正常。定期巡檢節點連通性與防火牆規則,是保障分散式儲存高可用的關鍵。

Copyright © Windows教程網 All Rights Reserved