2016-12-27 132 views
0

我在我的MacOS(版本:10.12.2)上通過docker-machine命令在辦公室文檔https://docs.docker.com/swarm/install-w-machine/之後構建了碼頭羣。我首先創建了swarm-master並設置了它的env變量,它運行良好,然後我繼續添加swarm節點swarm-agent-00,它也運行良好。然後我的Mac因耗盡記憶而放慢速度。我強制重啓我的Mac以實現第二個羣集節點swarm-agent-01。但是,當我返回到開始我的swarm-master,它在登錄步驟失敗,我用可選-D調試,並獲得以下日誌:無法通過ssh登錄碼頭

linzongshutekiMacBook-Air:~ root# docker-machine -D start swarm-master 
Docker Machine Version: 0.8.2, build e18a919 
Found binary path at /usr/local/bin/docker-machine 
Launching plugin server for driver virtualbox 
Plugin server listening at address 127.0.0.1:65359 
() Calling .GetVersion 
Using API Version 1 
() Calling .SetConfigRaw 
() Calling .GetMachineName 
command=start machine=swarm-master 
Starting "swarm-master"... 
(swarm-master) Calling .GetState 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage showvminfo swarm-master --machinereadable 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | name="swarm-master" 
(swarm-master) DBG | groups="/" 
(swarm-master) DBG | ostype="Linux 2.6/3.x/4.x (64-bit)" 
(swarm-master) DBG | UUID="1c319a99-23bc-457c-85a2-8eb84a219e38" 
(swarm-master) DBG | CfgFile="/var/root/.docker/machine/machines/swarm-master/swarm-master/swarm-master.vbox" 
(swarm-master) DBG | SnapFldr="/var/root/.docker/machine/machines/swarm-master/swarm-master/Snapshots" 
(swarm-master) DBG | LogFldr="/var/root/.docker/machine/machines/swarm-master/swarm-master/Logs" 
(swarm-master) DBG | hardwareuuid="1c319a99-23bc-457c-85a2-8eb84a219e38" 
(swarm-master) DBG | memory=1024 
(swarm-master) DBG | pagefusion="off" 
(swarm-master) DBG | vram=8 
(swarm-master) DBG | cpuexecutioncap=100 
(swarm-master) DBG | hpet="on" 
(swarm-master) DBG | chipset="piix3" 
(swarm-master) DBG | firmware="BIOS" 
(swarm-master) DBG | cpus=1 
(swarm-master) DBG | pae="on" 
(swarm-master) DBG | longmode="on" 
(swarm-master) DBG | triplefaultreset="off" 
(swarm-master) DBG | apic="on" 
(swarm-master) DBG | x2apic="off" 
(swarm-master) DBG | cpuid-portability-level=0 
(swarm-master) DBG | bootmenu="disabled" 
(swarm-master) DBG | boot1="dvd" 
(swarm-master) DBG | boot2="dvd" 
(swarm-master) DBG | boot3="disk" 
(swarm-master) DBG | boot4="none" 
(swarm-master) DBG | acpi="on" 
(swarm-master) DBG | ioapic="on" 
(swarm-master) DBG | biosapic="apic" 
(swarm-master) DBG | biossystemtimeoffset=0 
(swarm-master) DBG | rtcuseutc="on" 
(swarm-master) DBG | hwvirtex="on" 
(swarm-master) DBG | nestedpaging="on" 
(swarm-master) DBG | largepages="on" 
(swarm-master) DBG | vtxvpid="on" 
(swarm-master) DBG | vtxux="on" 
(swarm-master) DBG | paravirtprovider="default" 
(swarm-master) DBG | effparavirtprovider="kvm" 
(swarm-master) DBG | VMState="poweroff" 
(swarm-master) DBG | VMStateChangeTime="2016-12-27T02:22:44.927000000" 
(swarm-master) DBG | monitorcount=1 
(swarm-master) DBG | accelerate3d="off" 
(swarm-master) Calling .Start 
(swarm-master) DBG | accelerate2dvideo="off" 
(swarm-master) DBG | teleporterenabled="off" 
(swarm-master) DBG | teleporterport=0 
(swarm-master) DBG | teleporteraddress="" 
(swarm-master) DBG | teleporterpassword="" 
(swarm-master) DBG | tracing-enabled="off" 
(swarm-master) DBG | tracing-allow-vm-access="off" 
(swarm-master) DBG | tracing-config="" 
(swarm-master) DBG | autostart-enabled="off" 
(swarm-master) DBG | autostart-delay=0 
(swarm-master) DBG | defaultfrontend="" 
(swarm-master) DBG | storagecontrollername0="SATA" 
(swarm-master) DBG | storagecontrollertype0="IntelAhci" 
(swarm-master) DBG | storagecontrollerinstance0="0" 
(swarm-master) DBG | storagecontrollermaxportcount0="30" 
(swarm-master) DBG | storagecontrollerportcount0="30" 
(swarm-master) DBG | storagecontrollerbootable0="on" 
(swarm-master) DBG | "SATA-0-0"="/var/root/.docker/machine/machines/swarm-master/boot2docker.iso" 
(swarm-master) DBG | "SATA-ImageUUID-0-0"="c0f13743-4448-4636-ab6b-343c424223ff" 
(swarm-master) DBG | "SATA-tempeject"="off" 
(swarm-master) DBG | "SATA-IsEjected"="off" 
(swarm-master) DBG | "SATA-1-0"="/var/root/.docker/machine/machines/swarm-master/disk.vmdk" 
(swarm-master) DBG | "SATA-ImageUUID-1-0"="77fcc5a6-5c88-4d04-ba03-b1136afc3fbe" 
(swarm-master) DBG | "SATA-2-0"="none" 
(swarm-master) DBG | "SATA-3-0"="none" 
(swarm-master) DBG | "SATA-4-0"="none" 
(swarm-master) DBG | "SATA-5-0"="none" 
(swarm-master) DBG | "SATA-6-0"="none" 
(swarm-master) DBG | "SATA-7-0"="none" 
(swarm-master) DBG | "SATA-8-0"="none" 
(swarm-master) DBG | "SATA-9-0"="none" 
(swarm-master) DBG | "SATA-10-0"="none" 
(swarm-master) DBG | "SATA-11-0"="none" 
(swarm-master) DBG | "SATA-12-0"="none" 
(swarm-master) DBG | "SATA-13-0"="none" 
(swarm-master) DBG | "SATA-14-0"="none" 
(swarm-master) DBG | "SATA-15-0"="none" 
(swarm-master) DBG | "SATA-16-0"="none" 
(swarm-master) DBG | "SATA-17-0"="none" 
(swarm-master) DBG | "SATA-18-0"="none" 
(swarm-master) DBG | "SATA-19-0"="none" 
(swarm-master) DBG | "SATA-20-0"="none" 
(swarm-master) DBG | "SATA-21-0"="none" 
(swarm-master) DBG | "SATA-22-0"="none" 
(swarm-master) DBG | "SATA-23-0"="none" 
(swarm-master) DBG | "SATA-24-0"="none" 
(swarm-master) DBG | "SATA-25-0"="none" 
(swarm-master) DBG | "SATA-26-0"="none" 
(swarm-master) DBG | "SATA-27-0"="none" 
(swarm-master) DBG | "SATA-28-0"="none" 
(swarm-master) DBG | "SATA-29-0"="none" 
(swarm-master) DBG | natnet1="nat" 
(swarm-master) DBG | macaddress1="080027E0FEBA" 
(swarm-master) DBG | cableconnected1="on" 
(swarm-master) DBG | nic1="nat" 
(swarm-master) DBG | nictype1="82540EM" 
(swarm-master) DBG | nicspeed1="0" 
(swarm-master) DBG | mtu="0" 
(swarm-master) DBG | sockSnd="64" 
(swarm-master) DBG | sockRcv="64" 
(swarm-master) DBG | tcpWndSnd="64" 
(swarm-master) DBG | tcpWndRcv="64" 
(swarm-master) DBG | Forwarding(0)="ssh,tcp,127.0.0.1,52348,,22" 
(swarm-master) DBG | hostonlyadapter2="vboxnet0" 
(swarm-master) DBG | macaddress2="0800275C28CA" 
(swarm-master) DBG | cableconnected2="on" 
(swarm-master) DBG | nic2="hostonly" 
(swarm-master) DBG | nictype2="82540EM" 
(swarm-master) DBG | nicspeed2="0" 
(swarm-master) DBG | nic3="none" 
(swarm-master) DBG | nic4="none" 
(swarm-master) DBG | nic5="none" 
(swarm-master) DBG | nic6="none" 
(swarm-master) DBG | nic7="none" 
(swarm-master) DBG | nic8="none" 
(swarm-master) DBG | hidpointing="ps2mouse" 
(swarm-master) DBG | hidkeyboard="ps2kbd" 
(swarm-master) DBG | uart1="off" 
(swarm-master) DBG | uart2="off" 
(swarm-master) DBG | uart3="off" 
(swarm-master) DBG | uart4="off" 
(swarm-master) DBG | lpt1="off" 
(swarm-master) DBG | lpt2="off" 
(swarm-master) DBG | audio="none" 
(swarm-master) DBG | clipboard="disabled" 
(swarm-master) DBG | draganddrop="disabled" 
(swarm-master) DBG | vrde="off" 
(swarm-master) DBG | usb="off" 
(swarm-master) DBG | ehci="off" 
(swarm-master) DBG | xhci="off" 
(swarm-master) DBG | SharedFolderNameMachineMapping1="Users" 
(swarm-master) DBG | SharedFolderPathMachineMapping1="/Users" 
(swarm-master) DBG | vcpenabled="off" 
(swarm-master) DBG | vcpscreens=0 
(swarm-master) DBG | vcpfile="/var/root/.docker/machine/machines/swarm-master/swarm-master/swarm-master.webm" 
(swarm-master) DBG | vcpwidth=1024 
(swarm-master) DBG | vcpheight=768 
(swarm-master) DBG | vcprate=512 
(swarm-master) DBG | vcpfps=25 
(swarm-master) DBG | GuestMemoryBalloon=0 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
... 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage list hostonlyifs 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | Name:   vboxnet0 
(swarm-master) DBG | GUID:   786f6276-656e-4074-8000-0a0027000000 
(swarm-master) DBG | DHCP:   Disabled 
(swarm-master) DBG | IPAddress:  192.168.99.1 
(swarm-master) DBG | NetworkMask:  255.255.255.0 
(swarm-master) DBG | IPV6Address:  
(swarm-master) DBG | IPV6NetworkMaskPrefixLength: 0 
(swarm-master) DBG | HardwareAddress: 0a:00:27:00:00:00 
(swarm-master) DBG | MediumType:  Ethernet 
(swarm-master) DBG | Status:   Up 
(swarm-master) DBG | VBoxNetworkName: HostInterfaceNetworking-vboxnet0 
(swarm-master) DBG | 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | Searching for hostonly interface for IPv4: 192.168.99.1 and Mask: ffffff00 
(swarm-master) DBG | Found: vboxnet0 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage list dhcpservers 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | NetworkName: HostInterfaceNetworking-vboxnet0 
(swarm-master) DBG | IP:    192.168.99.6 
(swarm-master) DBG | NetworkMask: 255.255.255.0 
(swarm-master) DBG | lowerIPAddress: 192.168.99.100 
(swarm-master) DBG | upperIPAddress: 192.168.99.254 
(swarm-master) DBG | Enabled:  Yes 
(swarm-master) DBG | 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | Removing orphan DHCP servers... 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage list hostonlyifs 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | Name:   vboxnet0 
(swarm-master) DBG | GUID:   786f6276-656e-4074-8000-0a0027000000 
(swarm-master) DBG | DHCP:   Disabled 
(swarm-master) DBG | IPAddress:  192.168.99.1 
(swarm-master) DBG | NetworkMask:  255.255.255.0 
(swarm-master) DBG | IPV6Address:  
(swarm-master) DBG | IPV6NetworkMaskPrefixLength: 0 
(swarm-master) DBG | HardwareAddress: 0a:00:27:00:00:00 
(swarm-master) DBG | MediumType:  Ethernet 
(swarm-master) DBG | Status:   Up 
(swarm-master) DBG | VBoxNetworkName: HostInterfaceNetworking-vboxnet0 
(swarm-master) DBG | 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | Adding/Modifying DHCP server "192.168.99.6"... 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage list dhcpservers 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | NetworkName: HostInterfaceNetworking-vboxnet0 
(swarm-master) DBG | IP:    192.168.99.6 
(swarm-master) DBG | NetworkMask: 255.255.255.0 
(swarm-master) DBG | lowerIPAddress: 192.168.99.100 
(swarm-master) DBG | upperIPAddress: 192.168.99.254 
(swarm-master) DBG | Enabled:  Yes 
(swarm-master) DBG | 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage modifyvm swarm-master --nic2 hostonly --nictype2 82540EM --nicpromisc2 deny --hostonlyadapter2 vboxnet0 --cableconnected2 on 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage modifyvm swarm-master --natpf1 delete ssh 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage modifyvm swarm-master --natpf1 ssh,tcp,127.0.0.1,52348,,22 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | COMMAND: /usr/local/bin/VBoxManage startvm swarm-master --type headless 
(swarm-master) DBG | STDOUT: 
(swarm-master) DBG | { 
(swarm-master) DBG | Waiting for VM "swarm-master" to power on... 
(swarm-master) DBG | VM "swarm-master" has been successfully started. 
(swarm-master) DBG | } 
(swarm-master) DBG | STDERR: 
(swarm-master) DBG | { 
(swarm-master) DBG | } 
(swarm-master) DBG | Checking vm logs: /var/root/.docker/machine/machines/swarm-master/swarm-master/Logs/VBox.log 
(swarm-master) Waiting for an IP... 
(swarm-master) DBG | Getting to WaitForSSH function... 
(swarm-master) DBG | Using SSH client type: external 
(swarm-master) DBG | Using SSH private key: /var/root/.docker/machine/machines/swarm-master/id_rsa (-rw-------) 
(swarm-master) DBG | &{[-F /dev/null -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none [email protected] -o IdentitiesOnly=yes -i /var/root/.docker/machine/machines/swarm-master/id_rsa -p 52348] /usr/bin/ssh <nil>} 
(swarm-master) DBG | About to run SSH command: 
(swarm-master) DBG | exit 0 
(swarm-master) DBG | SSH cmd err, output: exit status 255: 
(swarm-master) DBG | Error getting ssh command 'exit 0' : Something went wrong running an SSH command! 
(swarm-master) DBG | command : exit 0 
(swarm-master) DBG | err  : exit status 255 
(swarm-master) DBG | output : 
(swarm-master) DBG | 
(swarm-master) DBG | Getting to WaitForSSH function... 
(swarm-master) DBG | Using SSH client type: external 
(swarm-master) DBG | Using SSH private key: /var/root/.docker/machine/machines/swarm-master/id_rsa (-rw-------) 
(swarm-master) DBG | &{[-F /dev/null -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none [email protected] -o IdentitiesOnly=yes -i /var/root/.docker/machine/machines/swarm-master/id_rsa -p 52348] /usr/bin/ssh <nil>} 
(swarm-master) DBG | About to run SSH command: 
(swarm-master) DBG | exit 0 
(swarm-master) DBG | SSH cmd err, output: exit status 255: 
(swarm-master) DBG | Error getting ssh command 'exit 0' : Something went wrong running an SSH command! 
(swarm-master) DBG | command : exit 0 
(swarm-master) DBG | err  : exit status 255 
(swarm-master) DBG | output : 

外殼呈持續Getting to WaitForSSH function...,並返回錯誤消息,Error getting ssh command 'exit 0' : Something went wrong running an SSH command!終於退出Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded

但是機器運行的是空的URL,然後我嘗試了另外兩個swarm節點,並且他們成功登錄並且可以被激活。這裏是機器列表(代理-01停止由於缺乏記憶):

linzongshutekiMacBook-Air:~ root# docker-machine ls 
NAME    ACTIVE  DRIVER  STATE  URL       SWARM     DOCKER ERRORS 
default   -   virtualbox Stopped              Unknown 
local   -   virtualbox Stopped              Unknown 
swarm-agent-00 -   virtualbox Running tcp://192.168.99.102:2376 swarm-master   v1.12.5 
swarm-agent-01 -   virtualbox Stopped        swarm-master   Unknown 
swarm-master  * (swarm) virtualbox Running        swarm-master (master) Unknown Something went wrong running an SSH command! 
command : ip addr show 
err  : exit status 255 
output : 

通過查看上述的記錄,我發現有登錄通過SSH本地主機的步驟,然後我直接運行該命令在日誌信息終端,並輸出爲:

linzongshutekiMacBook-Air:~ root# ssh -o PasswordAuthentication=no -i /var/root/.docker/machine/machines/swarm-master/id_rsa -p 52348 [email protected] -vvv 
OpenSSH_7.3p1, LibreSSL 2.4.1 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 20: Applying options for * 
debug2: resolving "127.0.0.1" port 52348 
debug2: ssh_connect_direct: needpriv 0 
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 52348. 
debug1: Connection established. 
debug1: permanently_set_uid: 0/0 
debug1: identity file /var/root/.docker/machine/machines/swarm-master/id_rsa type 1 
debug1: key_load_public: No such file or directory 
debug1: identity file /var/root/.docker/machine/machines/swarm-master/id_rsa-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_7.3 
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2 
debug1: match: OpenSSH_7.2 pat OpenSSH* compat 0x04000000 
debug2: fd 3 setting O_NONBLOCK 
debug1: Authenticating to 127.0.0.1:52348 as 'docker' 
debug3: put_host_port: [127.0.0.1]:52348 
debug3: hostkeys_foreach: reading file "/var/root/.ssh/known_hosts" 
debug3: record_hostkey: found key type ECDSA in file /var/root/.ssh/known_hosts:67 
debug3: load_hostkeys: loaded 1 keys from [127.0.0.1]:52348 
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 
debug3: send packet: type 20 
debug1: SSH2_MSG_KEXINIT sent 
debug3: receive packet: type 20 
debug1: SSH2_MSG_KEXINIT received 
debug2: local client KEXINIT proposal 
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c 
debug2: host key algorithms: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa 
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc 
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc 
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 
debug2: compression ctos: none,[email protected],zlib 
debug2: compression stoc: none,[email protected],zlib 
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug2: peer server KEXINIT proposal 
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256 
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] 
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] 
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 
debug2: compression ctos: none,[email protected] 
debug2: compression stoc: none,[email protected] 
debug2: languages ctos: 
debug2: languages stoc: 
debug2: first_kex_follows 0 
debug2: reserved 0 
debug1: kex: algorithm: [email protected] 
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none 
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none 
debug3: send packet: type 30 
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 
debug3: receive packet: type 31 
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:suSnsokwsrM9SiXN+LGUnF+3h698gOhqaQqGQBsECiY 
debug3: put_host_port: [127.0.0.1]:52348 
debug3: put_host_port: [127.0.0.1]:52348 
debug3: hostkeys_foreach: reading file "/var/root/.ssh/known_hosts" 
debug3: record_hostkey: found key type ECDSA in file /var/root/.ssh/known_hosts:67 
debug3: load_hostkeys: loaded 1 keys from [127.0.0.1]:52348 
debug1: Host '[127.0.0.1]:52348' is known and matches the ECDSA host key. 
debug1: Found key in /var/root/.ssh/known_hosts:67 
debug3: send packet: type 21 
debug2: set_newkeys: mode 1 
debug1: rekey after 134217728 blocks 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug3: receive packet: type 21 
debug2: set_newkeys: mode 0 
debug1: rekey after 134217728 blocks 
debug1: SSH2_MSG_NEWKEYS received 
debug2: key: /var/root/.docker/machine/machines/swarm-master/id_rsa (0x7f93e9410560), explicit 
debug3: send packet: type 5 
debug3: receive packet: type 7 
debug1: SSH2_MSG_EXT_INFO received 
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512> 
debug3: receive packet: type 6 
debug2: service_accept: ssh-userauth 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug3: send packet: type 50 
debug3: receive packet: type 51 
debug1: Authentications that can continue: publickey,password,keyboard-interactive 
debug3: start over, passed a different list publickey,password,keyboard-interactive 
debug3: preferred publickey,keyboard-interactive 
debug3: authmethod_lookup publickey 
debug3: remaining preferred: keyboard-interactive 
debug3: authmethod_is_enabled publickey 
debug1: Next authentication method: publickey 
debug1: Offering RSA public key: /var/root/.docker/machine/machines/swarm-master/id_rsa 
debug3: send_pubkey_test 
debug3: send packet: type 50 
debug2: we sent a publickey packet, wait for reply 
debug3: receive packet: type 51 
debug1: Authentications that can continue: publickey,password,keyboard-interactive 
debug2: we did not send a packet, disable method 
debug3: authmethod_lookup keyboard-interactive 
debug3: remaining preferred: 
debug3: authmethod_is_enabled keyboard-interactive 
debug1: Next authentication method: keyboard-interactive 
debug2: userauth_kbdint 
debug3: send packet: type 50 
debug2: we sent a keyboard-interactive packet, wait for reply 
debug3: receive packet: type 51 
debug1: Authentications that can continue: publickey,password,keyboard-interactive 
debug3: userauth_kbdint: disable: no info_req_seen 
debug2: we did not send a packet, disable method 
debug1: No more authentication methods to try. 
Permission denied (publickey,password,keyboard-interactive). 

的我用Google搜索周圍,有人說這些日誌沒有任何有用的東西,它應該是指在遠程服務器的sshd的日誌。它讓我感到困惑,因爲我甚至沒有從我的Mac上找到ssh的日誌,而且我也不知道如何繼續調試?

當然,我可以刪除主機並創建一個新機器,但對我來說找到原因更好。有人能告訴我什麼是問題以及如何解決它?有關docker處理docker用戶登錄的更多詳細信息可能會更好。非常感謝你!

回答

0

隨着更多的搜索和調試,我發現docker-machine是一個linux喜歡的虛擬機(不是很精確),它還包含用戶和auth用戶,以下問題顯示docker用戶的密碼是tcuser,而我試了一下,成功登錄:

ssh -p 52348 [email protected] 

參考:How do I SSH into the boot2docker host vm that the Vagrant 1.6 Docker Provider sets up?

後來我發現/home/docker DONOT含有.ssh文件,所以我按照在本地終端命令複製公鑰:

ssh-copy-id -i /var/root/.docker/machine/machines/swarm-master/id_rsa.pub -p 52348 [email protected] 

然後,它可以通過登錄:

ssh -i /var/root/.docker/machine/machines/swarm-master/id_rsa.pub -p 52348 [email protected] 

但證書需要您設置泊塢窗環境變量之前再生:

docker-machine regenerate-certs swarm-master 
eval "$(docker-machine env swarm-master)" 

最後,swarm-master運行良好:

$ docker-machine ls 
NAME    ACTIVE DRIVER  STATE  URL       SWARM     DOCKER ERRORS 
... 
swarm-agent-01 -  virtualbox Running tcp://192.168.99.103:2376  swarm-master   v1.12.5 
swarm-master  *  virtualbox Running tcp://192.168.99.101:2376 swarm-master (master) v1.12.5 

但是,它來了acros一個新的問題,.ssh文件夾將被刪除,每次swarm-master重新啓動,然後我需要重做上述操作使其工作, 有人可以告訴我爲什麼,我該如何解決問題徹底?