美文网首页
Linux端口被拒绝的常用命令行操作

Linux端口被拒绝的常用命令行操作

作者: 幽遊世外 | 来源:发表于2021-06-15 14:50 被阅读0次

    这里以K8S master端口被拒绝为例
    执行kubectl apply -f ... 命令时,出现如下错误

    The connection to the server (master主机IP):6443 was refused - did you specify the right host or port?
    

    以下是检查步骤:

    1. 检查环境变量情况(正常)
    # env | grep -i kub
    
    1. 检查docker服务(正常)
    # systemctl status docker.service
    

    3.检查kubelet服务(表面正常)

    # systemctl status kubelet.service
    

    4.查看端口是是否被监听(没有监听)

    # netstat -pnlt | grep 6443
    

    5.检查防火墙状态(正常)

    # systemctl status firewalld.service
    

    6.查看日志

    # journalctl -xeu kubelet
    

    根据日志查询错误,并对应处理

    相关文章

      网友评论

          本文标题:Linux端口被拒绝的常用命令行操作

          本文链接:https://www.haomeiwen.com/subject/jvkzeltx.html