linux 防火墙相关命令
主机名
vim /etc/hostname
node1.itcast.cn
node2.itcast.cn
Hosts映射
vim /etc/hosts
192.168.0.140 node1 node1.itcast.cn
192.168.0.141 node2 node2.itcast.cn
192.168.0.130 master1
192.168.0.140 worker1
192.168.0.150 worker2
环境变量
vim /etc/profile
export JAVA_HOME=...
export PATH=...
source /etc/profile
关闭防火墙
systemctl stop firewalld
systemctl disabled firewalld
systemctl status firewalld
firewall-cmd --help
firewall-cmd --list-all
firewall-cmd --state
firewall-cmd --reload
--打开http服务
firewall-cmd --add-service=http 立刻生效,重启后,会失效
firewall-cmd --add-service=http --permanent 永久生效,需要reload
firewall-cmd --reload
--打开端口
firewall-cmd --list-all
firewall-cmd --add-port=6379/tcp --permanent 永久生效,需要reload
firewall-cmd --reload
天生我材必有用,千金散尽还复来