1. 程式人生 > >29入叢集安裝筆記

29入叢集安裝筆記

1.修改linux的hostname root使用者登入系統,修改/etc/sysconfig/network,在裡面指定主機名稱HOSTNAME= 然後執行命令hostname 主機名 ctrl+d登出一下系統,再重登入之後就行了。  

2.SSH ssh-keygen -t rsa產生金鑰並加入27的authorized_keys檔案,再分發到28,29之後:29可以ssh到27/28,可是27/28不能SSH到29.原因是29開了防火牆。 在29執行service iptables status,報錯Redirecting to /bin/systemctl status iptables.service                                                              Unit iptables.service could not be found.

再在27/28上檢視service iptables status,同樣報錯Unit iptables.service could not be found.

這是因為centos7中預設使用 firewalld,沒有iptables了

在29上執行service firewalld status:

Redirecting to /bin/systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon    Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)    Active: active

(running) since Mon 2018-10-22 10:13:38 CST; 1 day 4h ago

在27/28上執行service firewalld status:

Redirecting to /bin/systemctl status firewalld.service ● firewalld.service - firewalld - dynamic firewall daemon    Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)    Active: inactive

(dead)

root使用者執行systemctl stop firewalld 關閉防火牆

systemctl disable firewalld   //禁止開機啟動

如果想使用 iptables 命令,可以 yum install -y iptables-services 命令來安裝iptables相關命令,這時仍可使用 iptables;

service iptables status   //檢查防火牆狀態