线上解决问题分析

时间:2021-01-11 16:48:13

昨天公司的服务器升级硬件,只升级了CPU和 内存,然后重启过后,线上运行的东西就运行不了,查了一下,所有端口和服务有没有开放,防火墙那些,结果发现端口和服务,防火墙允许的端口都开了

还是运行不了,带到晚上10点,突然有一个哥们说了一句,要不把防火墙关了试一下,结果就好了,忘了查看防火墙信息

目前我们只用到了的端口是

cat: /etc/sysconfig/iptables: Permission denied
[dev@chttl-8a6e210a8d27536a ~]$ sudo cat /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 27017 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

只有这些,

结果后面查了一下防火墙信息发现还TM用到了smb 这个我真的就搞不明白了

ack)
Jul 17 09:08:32 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Jul 17 09:21:32 chttl-8a6e210a8d27536a smbd[28014]: [2015/07/17 09:21:32.803089,  0] printing/print_cups.c:151(cups_connect)
Jul 17 09:21:32 chttl-8a6e210a8d27536a smbd[28014]:   Unable to connect to CUPS server localhost:631 - Connection refused
Jul 17 09:21:32 chttl-8a6e210a8d27536a smbd[1567]: [2015/07/17 09:21:32.803424,  0] printing/print_cups.c:528(cups_async_callback)
Jul 17 09:21:32 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Jul 17 09:34:33 chttl-8a6e210a8d27536a smbd[31824]: [2015/07/17 09:34:33.385856,  0] printing/print_cups.c:151(cups_connect)
Jul 17 09:34:33 chttl-8a6e210a8d27536a smbd[31824]:   Unable to connect to CUPS server localhost:631 - Connection refused
Jul 17 09:34:33 chttl-8a6e210a8d27536a smbd[1567]: [2015/07/17 09:34:33.386165,  0] printing/print_cups.c:528(cups_async_callback)
Jul 17 09:34:33 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Jul 17 09:47:34 chttl-8a6e210a8d27536a smbd[3272]: [2015/07/17 09:47:34.017469,  0] printing/print_cups.c:151(cups_connect)
Jul 17 09:47:34 chttl-8a6e210a8d27536a smbd[3272]:   Unable to connect to CUPS server localhost:631 - Connection refused
Jul 17 09:47:34 chttl-8a6e210a8d27536a smbd[1567]: [2015/07/17 09:47:34.017824,  0] printing/print_cups.c:528(cups_async_callback)
Jul 17 09:47:34 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Jul 17 10:00:34 chttl-8a6e210a8d27536a smbd[7256]: [2015/07/17 10:00:34.651162,  0] printing/print_cups.c:151(cups_connect)
Jul 17 10:00:34 chttl-8a6e210a8d27536a smbd[7256]:   Unable to connect to CUPS server localhost:631 - Connection refused
Jul 17 10:00:34 chttl-8a6e210a8d27536a smbd[1567]: [2015/07/17 10:00:34.651720,  0] printing/print_cups.c:528(cups_async_callback)
Jul 17 10:00:34 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Jul 17 10:13:35 chttl-8a6e210a8d27536a smbd[11582]: [2015/07/17 10:13:35.362361,  0] printing/print_cups.c:151(cups_connect)
Jul 17 10:13:35 chttl-8a6e210a8d27536a smbd[11582]:   Unable to connect to CUPS server localhost:631 - Connection refused
Jul 17 10:13:35 chttl-8a6e210a8d27536a smbd[1567]: [2015/07/17 10:13:35.362682,  0] printing/print_cups.c:528(cups_async_callback)
Jul 17 10:13:35 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Jul 17 10:26:35 chttl-8a6e210a8d27536a smbd[15564]: [2015/07/17 10:26:35.823554,  0] printing/print_cups.c:151(cups_connect)
Jul 17 10:26:35 chttl-8a6e210a8d27536a smbd[15564]:   Unable to connect to CUPS server localhost:631 - Connection refused
Jul 17 10:26:35 chttl-8a6e210a8d27536a smbd[1567]: [2015/07/17 10:26:35.823862,  0] printing/print_cups.c:528(cups_async_callback)
Jul 17 10:26:35 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Jul 17 10:39:36 chttl-8a6e210a8d27536a smbd[19370]: [2015/07/17 10:39:36.439927,  0] printing/print_cups.c:151(cups_connect)
Jul 17 10:39:36 chttl-8a6e210a8d27536a smbd[19370]:   Unable to connect to CUPS server localhost:631 - Connection refused
Jul 17 10:39:36 chttl-8a6e210a8d27536a smbd[1567]: [2015/07/17 10:39:36.440280,  0] printing/print_cups.c:528(cups_async_callback)
Jul 17 10:39:36 chttl-8a6e210a8d27536a smbd[1567]:   failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL

始终就没有明白这个631这个端口是搞什么的

查了一下是

samba服务器Unable to connect to CUPS server localhost:631 – 拒绝连接

这个就坑到家了本来,我就没有用samba 这个的,后来想了一下,应该是亚马迅云服务器可能用到了,所以导致的问题

总结,最后还是多看日志,看了一下apache 日志 php 日志,就是忘了看防火墙日志.原本以为我想要的端口都是开的,结果,还是错了,永远都不要以为以为,要去实际做了