修改主机名
查看当前服务器的主机名称:
hostname
修改主机名:编辑/etc/sysconfig/network 中的HOSTNAME 注意:主机名称不要有“_”下划线
vi /etc/hosts
192.168.1.100 hadoop100
192.168.1.101 hadoop101
192.168.1.102 hadoop102
192.168.1.103 hadoop103
重启后生效
Linux防火墙
关闭防火墙(centos6.9)
查看防火墙状态
service iptables status
临时关闭防火墙
service iptables stop
查看防火墙开机启动状态
chkconfig iptables --list
设置开机时关闭防火墙
chkconfig iptables off
centos7
查看防火墙状态
firewall-cmd --state
关闭防火墙
systemctl stop firewalld.service
开启防火墙
systemctl start firewalld.service
禁止开机启动启动防火墙
systemctl disable firewalld.service
service 服务名 start (功能描述:开启服务)
service 服务名 stop (功能描述:关闭服务)
service 服务名 restart (功能描述:重新启动服务)
service 服务名 status (功能描述:查看服务状态)
查看服务的方法:/etc/init.d/服务名
chkconfig 设置后台服务的自启配置
chkconfig (功能描述:查看所有服务器自启配置)
chkconfig 服务名 off (功能描述:关掉指定服务的自动启动)
chkconfig 服务名 on (功能描述:开启指定服务的自动启动)
chkconfig 服务名 --list (功能描述:查看服务开机启动状态)
进程运行级别
查看端口是否占用
netstat -nltp | grep 22