与服务器localhost:8080的连接被拒绝 - IBM Private Cloud 2.1.0.2安装

时间:2018-06-14 11:50:39

标签: kubernetes ibm-cloud-private

在安装IBM Cloud Private 2.1.0.2(单节点群集)期间,会出现以下错误消息:

TASK [network : Enabling calico] ***********************************************
task path: /installer/playbook/roles/network/tasks/calico.yaml:8
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no 127.0.0.1 '/bin/bash -c '"'"'echo ~ && sleep 0'"'"''
<127.0.0.1> (0, '/home/user\n', '')
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no 127.0.0.1 '/bin/bash -c '"'"'( umask 77 && mkdir -p "` echo /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494 `" && echo ansible-tmp-1528976337.25-231156419672494="` echo /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494 `" ) && sleep 0'"'"''
<127.0.0.1> (0, 'ansible-tmp-1528976337.25-231156419672494=/home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494\n', '')
<127.0.0.1> PUT /tmp/tmp98uaOG TO /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py
<127.0.0.1> SSH: EXEC sshpass -d10 sftp -o BatchMode=no -b - -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no '[127.0.0.1]'
<127.0.0.1> (0, 'sftp> put /tmp/tmp98uaOG /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py\n', '')
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no 127.0.0.1 '/bin/bash -c '"'"'chmod u+x /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/ /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py && sleep 0'"'"''
<127.0.0.1> (0, '', '')
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no -tt 127.0.0.1 '/bin/bash -c '"'"'sudo -H -S -i -p "[sudo via ansible, key=souadjgrohvvwgbsdjfdverklmfvdouq] password: " -u root /bin/bash -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-souadjgrohvvwgbsdjfdverklmfvdouq; /usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py; rm -rf "/home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/" > /dev/null 2>&1'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<127.0.0.1> (0, '\r\n\r\n{"changed": true, "end": "2018-06-14 13:38:59.184433", "stdout": "", "cmd": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", "rc": 1, "start": "2018-06-14 13:38:59.060894", "stderr": "The connection to the server localhost:8080 was refused - did you specify the right host or port?", "delta": "0:00:00.123539", "invocation": {"module_args": {"warn": true, "executable": "/bin/bash", "_uses_shell": true, "_raw_params": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", "removes": null, "creates": null, "chdir": null}}, "warnings": []}\r\n', 'Connection to 127.0.0.1 closed.\r\n')
fatal: [127.0.0.1]: FAILED! => {
    "changed": true, 
    "cmd": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", 
    "delta": "0:00:00.123539", 
    "end": "2018-06-14 13:38:59.184433", 
    "failed": true, 
    "invocation": {
        "module_args": {
            "_raw_params": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", 
            "_uses_shell": true, 
            "chdir": null, 
            "creates": null, 
            "executable": "/bin/bash", 
            "removes": null, 
            "warn": true
        }
    }, 
    "rc": 1, 
    "start": "2018-06-14 13:38:59.060894", 
    "stderr": "The connection to the server localhost:8080 was refused - did you specify the right host or port?", 
    "stderr_lines": [
        "The connection to the server localhost:8080 was refused - did you specify the right host or port?"
    ], 
    "stdout": "", 
    "stdout_lines": []
}

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=204  changed=67   unreachable=0    failed=1   

Playbook run took 0 days, 0 hours, 9 minutes, 36 seconds

user@user:/opt/ibm-cloud-private-ce-2.1.0.2/cluster$ 

我在网上看到了一些关于此错误的kubernetes主题,但我找不到适合我的解决方案,因为我没有/ etc / kubernetes文件夹,也没有任何关于kubernetes的admin.conf文件。

由于我也只是在单个节点群集上安装ICP,因此也不应该将〜/ .kube / config文件传递给其他节点。

我感谢任何帮助!

1 个答案:

答案 0 :(得分:0)

我找到了此修复程序,可以通过取消注释config.yaml中的"kube_apiserver_insecure_port: 8888"并将"8888"更改为"8080"来解决此错误。