安全增強型Linux(Security-Enhanced Linux)簡稱SELinux,它是一個 Linux 內核模塊,也是Linux的一個安全子系統。為了避免安裝過程出現各種錯誤,建議關閉,有如下兩種關閉方法:
1)臨時關閉(不建議使用)
[root@hadoop101 ~]# setenforce 0
但是這種方式只對當次啟動有效,重啟機器后會失效。
2)永久關閉(建議使用)
修改配置文件/etc/selinux/config
[root@hadoop101 ~]# vim /etc/selinux/config
將SELINUX=enforcing 改為SELINUX=disabled
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. #SELINUX=enforcing SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
3)同步/etc/selinux/config配置文件(這一步是針對集群環境中,參考:使用集群同步腳本對配置文件同步分發)
[root@hadoop101 ~]# xsync /etc/selinux/config
4)重啟主機
[root@hadoop101 ~]# reboot [root@hadoop102 ~]# reboot [root@hadoop103 ~]# reboot