Centos6.5
关闭selinux:
永久有效:
vim /etc/sysconfig/selinux
将文本中的SELINUX=enforcing
,改为SELINUX=disabled
。然后重启网卡
即时有效:
setenforce 0
查看状态:getenforce
关闭防火墙:
永久性生效:
chkconfig iptables off
,然后重启网卡
即时生效:
service iptables stop
查看防火墙状态:
service iptables status
(或者iptables -L
)
检查防火墙是否开机自启:
chkconfig iptables --list
(--list
这是两个横线)
Centos7
关闭selinux:
永久关闭:
vim /etc/selinux/config
将文本中的SELINUX=enforcing
,改为SELINUX=disabled
。然后重启网卡
即时有效:
setenforce 0
关闭防火墙:
临时关闭:
systemctl stop firewalld
防火墙开机关闭:
systemctl disable firewalld
开机启动:
systemctl enable firewalld
查看状态:
systemctl status firewalld
获取
firewalld
状态:firewall-cmd --state
其他命令:
重启网卡:systemctl restart network
修改主机名命令:hostnamectl set-hostname master
将hadoop
的安全模式关了命令:hadoop dfsadmin -safemode leave
首先看是否设置static
如果设置了
输入命令ip addr
查看里边是否有两个ip地址,如果有
systemctl stop NetworkManagersystemctl
systemctl disable NetworkManagersystemctl
systemctl restart network
然后在查看ip addr
和ifconfig
是否一致