最近新开了三台虚拟机部署服务上去,jar启动也没有问题,发现不能访问,排查步骤记录一下。
我在79上面部署的jar服务,通过80服务器 telnet访问一下
yum install telnet –y
service xinetd restart
telnet 10.10.11.79 8080
可以看出8080 9200 是ping不通的。
service iptables status
如果报错:
Unit iptables.service could not be found.
安装iptables-services解决
yum install iptables-services
chkconfig iptables off
vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
保存退出后重启防火墙
service iptables restart
查看firewall服务状态
systemctl status firewalld
出现Active: active (running)切高亮显示则表示是启动状态。
出现 Active: inactive (dead)灰色表示停止,看单词也行。
firewall-cmd --query-port=8080/tcp
firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --permanent --remove-port=8080/tcp
#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload