我无法使用SSH连接到我的计算服务器VM。它说“重试2/3 .. 3/3”
好像服务器实际上正在运行并运行。我有安装了一些应用程序的Apache Tomcat和MySql服务器。我可以连接到apache tomcat manager页面,我没有看到任何问题。我可以使用MySQL WorkBench等客户端工具连接到我的MySQL数据库。我可以向表中插入新行并删除一些。它看起来不像可用磁盘空间。无论如何,我试图从表中删除一些数据并缩小它,但显然可用空间不是问题。
这是我收到的串口日志。请问,这会导致什么?我用来能够在相同条件下连接(相同的客户端机器,防火墙等),因此问题来自服务器端。
[34987645.468284] Free swap = 0kB
[34987645.471547] Total swap = 0kB
[34987645.474838] 157083 pages RAM
[34987645.478109] 0 pages HighMem/MovableOnly
[34987645.482323] 4886 pages reserved
[34987645.485853] 0 pages hwpoisoned
[34987645.489270] [ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
[34987645.497494] [ 311] 0 311 6350 1726 14 0 0 dhclient
[34987645.506101] [ 358] 0 358 6869 60 18 0 0 cron
[34987645.514339] [ 369] 0 369 64668 459 29 0 0 rsyslogd
[34987645.522954] [ 373] 0 373 1064 38 8 0 0 acpid
[34987645.531266] [ 406] 0 406 3604 38 12 0 0 agetty
[34987645.539669] [ 407] 0 407 3604 38 12 0 0 agetty
[34987645.548081] [ 408] 0 408 3604 40 12 0 0 agetty
[34987645.556571] [ 409] 0 409 3604 40 12 0 0 agetty
[34987645.564986] [ 410] 0 410 3604 39 12 0 0 agetty
[34987645.573414] [ 411] 0 411 3604 39 12 0 0 agetty
[34987645.583546] [ 412] 0 412 3559 40 10 0 0 agetty
[34987645.591939] [ 7263] 0 7263 13796 168 29 0 -1000 sshd
[34987645.600464] [11774] 107 11774 10565 124 25 0 -900 dbus-daemon
[34987645.610085] [20473] 104 20473 7292 146 19 0 0 ntpd
[34987645.618585] [27741] 0 27741 13169 2273 30 0 0 google_accounts
[34987645.627869] [27744] 0 27744 13211 2284 29 0 0 google_clock_sk
[34987645.637039] [27747] 0 27747 13211 2244 30 0 0 google_ip_forwa
[34987645.646401] [14807] 0 14807 10176 101 22 0 -1000 systemd-udevd
[34987645.655412] [30481] 0 30481 1085 43 6 0 0 mysqld_safe
[34987645.664327] [30815] 109 30815 221020 12045 81 0 0 mysqld
[34987645.672765] [15984] 0 15984 7218 64 19 0 0 systemd-journal
[34987645.681934] [19949] 108 19949 547956 45017 173 0 0 java
[34987645.690161] [23671] 0 23671 10560 86 26 0 0 cron
[34987645.698380] [23672] 0 23672 1085 22 7 0 0 sh
[34987645.706415] [23673] 0 23673 1057 20 8 0 0 run-parts
[34987645.715058] [23674] 0 23674 1085 37 6 0 0 apt
[34987645.723279] [23793] 0 23793 28771 5257 62 0 0 unattended-upgr
[34987645.732642] [23803] 0 23803 28579 5281 57 0 0 unattended-upgr
[34987645.741809] [24237] 0 24237 4583 418 14 0 0 dpkg
[34987645.750026] [24239] 0 24239 1085 23 7 0 0 google-cloud-sd
[34987645.759214] [24241] 0 24241 62608 51157 126 0 0 python2
[34987645.767782] [24263] 0 24263 12231 155 28 0 0 sshd
[34987645.775989] [24265] 0 24265 10553 79 26 0 0 cron
[34987645.784795] [24266] 0 24266 12203 131 27 0 0 sshd
[34987645.793015] [24267] 0 24267 12203 132 25 0 0 sshd
[34987645.801461] [24268] 0 24268 12203 85 25 0 0 sshd
[34987645.809715] [24270] 0 24270 12203 85 25 0 0 sshd
[34987645.817941] [24271] 0 24271 12203 82 25 0 0 sshd
[34987645.826202] [24272] 0 24272 12203 68 24 0 0 sshd
[34987645.834413] [24273] 0 24273 12203 66 26 0 0 sshd
[34987645.842619] [24274] 0 24274 12203 65 25 0 0 sshd
[34987645.850850] [24275] 0 24275 4527 26 11 0 0 sshd
[34987645.859165] Out of memory: Kill process 24241 (python2) score 326 or sacrifice child
[34987645.867298] Killed process 24241 (python2) total-vm:250432kB, anon-rss:204628kB, file-rss:0kB
Sep 2 08:16:18 instance-1 kernel: [34987645.059900] sshd invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=-1000
Sep 2 08:16:18 instance-1 kernel: [34987645.067997] sshd cpuset=/ mems_allowed=0
Sep 2 08:16:18 instance-1 kernel: [34987645.072637] CPU: 0 PID: 7263 Comm: sshd Not tainted 3.16.0-4-amd64 #1 Debian 3.16.7-ckt25-2+deb8u3
Sep 2 08:16:18 instance-1 kernel: [34987645.081960] Hardware name: Google Google/Google, BIOS Google 01/01/2011
Sep 2 08:16:18 instance-1 kernel: [34987645.088955] 0000000000000000 ffffffff8150e08f ffff880025daa9a0 0000000000000000
Sep 2 08:16:18 instance-1 kernel: [34987645.097277] ffffffff8150bc8b 0000000000000000 ffffffff810d51ff 0000000000000000
Sep 2 08:16:18 instance-1 kernel: [34987645.105594] ffffffff815129ae 0000000000000200 ffffffff81067933 ffffffff810c2914
Sep 2 08:16:18 instance-1 kernel: [34987645.113999] Call Trace:
Sep 2 08:16:18 instance-1 kernel: [34987645.116817] [] ? dump_stack+0x5d/0x78
Sep 2 08:16:18 instance-1 kernel: [34987645.122507] [] ? dump_header+0x76/0x1e8
Sep 2 08:16:18 instance-1 kernel: [34987645.128393] [] ? smp_call_function_single+0x5f/0xa0
Sep 2 08:16:18 instance-1 kernel: [34987645.135306] [] ? mutex_lock+0xe/0x2a
Sep 2 08:16:18 instance-1 kernel: [34987645.140921] [] ? put_online_cpus+0x23/0x80
Sep 2 08:16:18 instance-1 kernel: [34987645.147045] [] ? rcu_oom_notify+0xc4/0xe0
Sep 2 08:16:18 instance-1 kernel: [34987645.153083] [] ? do_try_to_free_pages+0x4ac/0x520
Sep 2 08:16:18 instance-1 kernel: [34987645.159842] [] ? oom_kill_process+0x21d/0x370
Sep 2 08:16:18 instance-1 kernel: [34987645.166311] [] ? find_lock_task_mm+0x3d/0x90
Sep 2 08:16:18 instance-1 kernel: [34987645.172614] [] ? out_of_memory+0x473/0x4b0
Sep 2 08:16:18 instance-1 kernel: [34987645.178769] [] ? __alloc_pages_nodemask+0x9cd/0xb30
Sep 2 08:16:18 instance-1 kernel: [34987645.185690] [] ? alloc_pages_current+0x9d/0x150
Sep 2 08:16:18 instance-1 kernel: [34987645.192273] [] ? filemap_fault+0x1a0/0x420
Sep 2 08:16:18 instance-1 kernel: [34987645.198395] [] ? __do_fault+0x3a/0xa0
Sep 2 08:16:18 instance-1 kernel: [34987645.204172] [] ? do_read_fault.isra.54+0x4e/0x300
Sep 2 08:16:18 instance-1 kernel: [34987645.210908] [] ? handle_mm_fault+0x63c/0x11c0
Sep 2 08:16:18 instance-1 kernel: [34987645.217288] [] ? vmacache_find+0x29/0xd0
Sep 2 08:16:18 instance-1 kernel: [34987645.223513] [] ? __do_page_fault+0x177/0x4f0
Sep 2 08:16:18 instance-1 kernel: [34987645.229813] [] ? put_prev_entity+0x57/0x350
Sep 2 08:16:18 instance-1 kernel: [34987645.236015] [] ? set_next_entity+0x56/0x70
Sep 2 08:16:18 instance-1 kernel: [34987645.242146] [] ? pick_next_task_fair+0x6e1/0x820
Sep 2 08:16:18 instance-1 kernel: [34987645.248870] [] ? __switch_to+0x15c/0x5a0
Sep 2 08:16:18 instance-1 kernel: [34987645.254812] [] ? page_fault+0x28/0x30
Sep 2 08:16:18 instance-1 kernel: [34987645.260832] Mem-Info:
Sep 2 08:16:18 instance-1 kernel: [34987645.263586] Node 0 DMA per-cpu:
Sep 2 08:16:18 instance-1 kernel: [34987645.267258] CPU 0: hi: 0, btch: 1 usd: 0
Sep 2 08:16:18 instance-1 kernel: [34987645.272519] Node 0 DMA32 per-cpu:
Sep 2 08:16:18 instance-1 kernel: [34987645.276345] CPU 0: hi: 186, btch: 31 usd: 76
Sep 2 08:16:18 instance-1 kernel: [34987645.281531] active_anon:126526 inactive_anon:3096 isolated_anon:0
Sep 2 08:16:18 instance-1 kernel: [34987645.281531] active_file:813 inactive_file:900 isolated_file:0
Sep 2 08:16:18 instance-1 kernel: [34987645.281531] unevictable:0 dirty:0 writeback:0 unstable:0
Sep 2 08:16:18 instance-1 kernel: [34987645.281531] free:8071 slab_reclaimable:2225 slab_unreclaimable:4588
Sep 2 08:16:18 instance-1 kernel: [34987645.281531] mapped:1028 shmem:3130 pagetables:1213 bounce:0
Sep 2 08:16:18 instance-1 kernel: [34987645.281531] free_cma:0
Sep 2 08:16:18 instance-1 kernel: [34987645.314947] Node 0 DMA free:3088kB min:788kB low:984kB high:1180kB active_anon:11608kB inactive_anon:108kB active_file:12kB inactive_file:152kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15992kB managed:15908kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:112kB slab_reclaimable:88kB slab_unreclaimable:480kB kernel_stack:16kB pagetables:52kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:522 all_unreclaimable? yes
Sep 2 08:16:18 instance-1 kernel: [34987645.356698] lowmem_reserve[]: 0 576 576 576
Sep 2 08:16:18 instance-1 kernel: [34987645.361878] Node 0 DMA32 free:29196kB min:29300kB low:36624kB high:43948kB active_anon:494496kB inactive_anon:12276kB active_file:3240kB inactive_file:3448kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:612340kB managed:592796kB mlocked:0kB dirty:0kB writeback:0kB mapped:4112kB shmem:12408kB slab_reclaimable:8812kB slab_unreclaimable:17872kB kernel_stack:2320kB pagetables:4800kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:11577 all_unreclaimable? yes
Sep 2 08:16:18 instance-1 kernel: [34987645.406481] lowmem_reserve[]: 0 0 0 0
Sep 2 08:16:18 instance-1 kernel: [34987645.411143] Node 0 DMA: 22*4kB (UE) 19*8kB (UEM) 12*16kB (UEM) 7*32kB (UEM) 4*64kB (UEM) 1*128kB (U) 0*256kB 0*512kB 0*1024kB 1*2048kB (R) 0*4096kB = 3088kB
Sep 2 08:16:18 instance-1 kernel: [34987645.428083] Node 0 DMA32: 383*4kB (E) 310*8kB (UEM) 450*16kB (UEM) 200*32kB (UEM) 109*64kB (EM) 4*128kB (E) 0*256kB 0*512kB 0*1024kB 0*2048kB 1*4096kB (R) = 29196kB
Sep 2 08:16:18 instance-1 kernel: [34987645.445684] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
Sep 2 08:16:18 instance-1 kernel: [34987645.454775] 4860 total pagecache pages
Sep 2 08:16:18 instance-1 kernel: [34987645.458908] 0 pages in swap cache
Sep 2 08:16:18 instance-1 kernel: [34987645.462650] Swap cache stats: add 0, delete 0, find 0/0
Sep 2 08:16:18 instance-1 kernel: [34987645.468284] Free swap = 0kB
Sep 2 08:16:18 instance-1 kernel: [34987645.471547] Total swap = 0kB
Sep 2 08:16:18 instance-1 kernel: [34987645.474838] 157083 pages RAM
Sep 2 08:16:18 instance-1 kernel: [34987645.478109] 0 pages HighMem/MovableOnly
Sep 2 08:16:18 instance-1 kernel: [34987645.482323] 4886 pages reserved
Sep 2 08:16:18 instance-1 kernel: [34987645.485853] 0 pages hwpoisoned
Sep 2 08:16:18 instance-1 kernel: [34987645.489270] [ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
Sep 2 08:16:18 instance-1 kernel: [34987645.497494] [ 311] 0 311 6350 1726 14 0 0 dhclient
Sep 2 08:16:18 instance-1 kernel: [34987645.506101] [ 358] 0 358 6869 60 18 0 0 cron
Sep 2 08:16:18 instance-1 kernel: [34987645.514339] [ 369] 0 369 64668 459 29 0 0 rsyslogd
Sep 2 08:16:18 instance-1 kernel: [34987645.522954] [ 373] 0 373 1064 38 8 0 0 acpid
Sep 2 08:16:18 instance-1 kernel: [34987645.531266] [ 406] 0 406 3604 38 12 0 0 agetty
Sep 2 08:16:18 instance-1 kernel: [34987645.539669] [ 407] 0 407 3604 38 12 0 0 agetty
Sep 2 08:16:18 instance-1 kernel: [34987645.548081] [ 408] 0 408 3604 40 12 0 0 agetty
Sep 2 08:16:18 instance-1 kernel: [34987645.556571] [ 409] 0 409 3604 40 12 0 0 agetty
Sep 2 08:16:18 instance-1 kernel: [34987645.564986] [ 410] 0 410 3604 39 12 0 0 agetty
Sep 2 08:16:18 instance-1 kernel: [34987645.573414] [ 411] 0 411 3604 39 12 0 0 agetty
Sep 2 08:16:18 instance-1 kernel: [34987645.583546] [ 412] 0 412 3559 40 10 0 0 agetty
Sep 2 08:16:18 instance-1 kernel: [34987645.591939] [ 7263] 0 7263 13796 168 29 0 -1000 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.600464] [11774] 107 11774 10565 124 25 0 -900 dbus-daemon
Sep 2 08:16:18 instance-1 kernel: [34987645.610085] [20473] 104 20473 7292 146 19 0 0 ntpd
Sep 2 08:16:18 instance-1 kernel: [34987645.618585] [27741] 0 27741 13169 2273 30 0 0 google_accounts
Sep 2 08:16:18 instance-1 kernel: [34987645.627869] [27744] 0 27744 13211 2284 29 0 0 google_clock_sk
Sep 2 08:16:18 instance-1 kernel: [34987645.637039] [27747] 0 27747 13211 2244 30 0 0 google_ip_forwa
Sep 2 08:16:18 instance-1 kernel: [34987645.646401] [14807] 0 14807 10176 101 22 0 -1000 systemd-udevd
Sep 2 08:16:18 instance-1 kernel: [34987645.655412] [30481] 0 30481 1085 43 6 0 0 mysqld_safe
Sep 2 08:16:18 instance-1 kernel: [34987645.664327] [30815] 109 30815 221020 12045 81 0 0 mysqld
Sep 2 08:16:18 instance-1 kernel: [34987645.672765] [15984] 0 15984 7218 64 19 0 0 systemd-journal
Sep 2 08:16:18 instance-1 kernel: [34987645.681934] [19949] 108 19949 547956 45017 173 0 0 java
Sep 2 08:16:18 instance-1 kernel: [34987645.690161] [23671] 0 23671 10560 86 26 0 0 cron
Sep 2 08:16:18 instance-1 kernel: [34987645.698380] [23672] 0 23672 1085 22 7 0 0 sh
Sep 2 08:16:18 instance-1 kernel: [34987645.706415] [23673] 0 23673 1057 20 8 0 0 run-parts
Sep 2 08:16:18 instance-1 kernel: [34987645.715058] [23674] 0 23674 1085 37 6 0 0 apt
Sep 2 08:16:18 instance-1 kernel: [34987645.723279] [23793] 0 23793 28771 5257 62 0 0 unattended-upgr
Sep 2 08:16:18 instance-1 kernel: [34987645.732642] [23803] 0 23803 28579 5281 57 0 0 unattended-upgr
Sep 2 08:16:18 instance-1 kernel: [34987645.741809] [24237] 0 24237 4583 418 14 0 0 dpkg
Sep 2 08:16:18 instance-1 kernel: [34987645.750026] [24239] 0 24239 1085 23 7 0 0 google-cloud-sd
Sep 2 08:16:18 instance-1 kernel: [34987645.759214] [24241] 0 24241 62608 51157 126 0 0 python2
Sep 2 08:16:18 instance-1 kernel: [34987645.767782] [24263] 0 24263 12231 155 28 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.775989] [24265] 0 24265 10553 79 26 0 0 cron
Sep 2 08:16:18 instance-1 kernel: [34987645.784795] [24266] 0 24266 12203 131 27 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.793015] [24267] 0 24267 12203 132 25 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.801461] [24268] 0 24268 12203 85 25 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.809715] [24270] 0 24270 12203 85 25 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.817941] [24271] 0 24271 12203 82 25 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.826202] [24272] 0 24272 12203 68 24 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.834413] [24273] 0 24273 12203 66 26 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.842619] [24274] 0 24274 12203 65 25 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.850850] [24275] 0 24275 4527 26 11 0 0 sshd
Sep 2 08:16:18 instance-1 kernel: [34987645.859165] Out of memory: Kill process 24241 (python2) score 326 or sacrifice child
Sep 2 08:16:18 instance-1 kernel: [34987645.867298] Killed process 24241 (python2) total-vm:250432kB, anon-rss:204628kB, file-rss:0kB
Sep 2 16:21:27 instance-1 dhclient: DHCPREQUEST on eth0 to 169.254.169.254 port 67
Sep 2 16:21:27 instance-1 dhclient: DHCPACK from 169.254.169.254
Sep 2 16:21:27 instance-1 dhclient: bound to 10.132.0.2 -- renewal in 40860 seconds.
Sep 2 21:14:06 instance-1 systemd[1]: Starting Cleanup of Temporary Directories...
Sep 2 21:14:06 instance-1 systemd[1]: Started Cleanup of Temporary Directories.
Sep 3 03:42:27 instance-1 dhclient: DHCPREQUEST on eth0 to 169.254.169.254 port 67
Sep 3 03:42:27 instance-1 dhclient: DHCPACK from 169.254.169.254
Sep 3 03:42:27 instance-1 dhclient: bound to 10.132.0.2 -- renewal in 34630 seconds.
Sep 3 13:19:37 instance-1 dhclient: DHCPREQUEST on eth0 to 169.254.169.254 port 67
Sep 3 13:19:37 instance-1 dhclient: DHCPACK from 169.254.169.254
Sep 3 13:19:38 instance-1 dhclient: bound to 10.132.0.2 -- renewal in 33626 seconds.
Sep 3 21:14:22 instance-1 systemd[1]: Starting Cleanup of Temporary Directories...
Sep 3 21:14:22 instance-1 systemd[1]: Started Cleanup of Temporary Directories.
Sep 3 22:40:04 instance-1 dhclient: DHCPREQUEST on eth0 to 169.254.169.254 port 67
Sep 3 22:40:04 instance-1 dhclient: DHCPACK from 169.254.169.254
Sep 3 22:40:04 instance-1 dhclient: bound to 10.132.0.2 -- renewal in 38182 seconds.
Sep 4 09:16:26 instance-1 dhclient: DHCPREQUEST on eth0 to 169.254.169.254 port 67
Sep 4 09:16:26 instance-1 dhclient: DHCPACK from 169.254.169.254
Sep 4 09:16:26 instance-1 dhclient: bound to 10.132.0.2 -- renewal in 35099 seconds.
Sep 4 19:01:25 instance-1 dhclient: DHCPREQUEST on eth0 to 169.254.169.254 port 67
Sep 4 19:01:25 instance-1 dhclient: DHCPACK from 169.254.169.254
Sep 4 19:01:25 instance-1 dhclient: bound to 10.132.0.2 -- renewal in 40004 seconds.
Sep 4 21:14:26 instance-1 systemd[1]: Starting Cleanup of Temporary Directories...
Sep 4 21:14:26 instance-1 systemd[1]: Started Cleanup of Temporary Directories.
答案 0 :(得分:0)
好的,我能够解决这个问题。 显然,机器中的ssh进程因内存不足而停止。当RAM已满时,linux系统会终止进程。 我无法直接从日志中看到它,因为它杀死了其他内容并间接杀死了ssh。
这是解决方案: 我停下了机器,然后又恢复了。 警告:我的IP地址是短暂的,所以我在停止机器之前将其更改为静态。如果我不这样做,我会得到一个不同的IP地址,这将迫使我更新我的域名记录。 它可以稍后切换回短暂的。 Google收取静态IP地址费用。
我现在可以登录ssh。
我想另一个问题是如何防止SSH被杀死。
我希望它对任何人都有帮助。