java.net.NoRouteToHostException: No route to host (Host unreachable) 问题的解决方法

环境:centos7 

检查防火墙状态,原因是防火墙没有关闭,我这边做了关闭防火墙,也可以在防火墙配置里面把端口设置为例外

systemctl status firewalld.service     
鈼[0m firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-05-12 13:08:51 CST; 1 day 3h ago
     Docs: man:firewalld(1)
 Main PID: 5233 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           鈹斺攢5233 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

May 12 13:08:48 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
May 12 13:08:51 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
[root@localhost ~]# systemctl stop firewalld.service     
[root@localhost ~]# systemctl disable firewalld.service  
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

你可能感兴趣的:(问题)