2017-05-01 130 views
0

我有一个ec2实例用于填充数据库。我有一个python脚本,我输入: nohup python populate_db.py &。这工作和数据库开始得到填充。但是,如果我离开了SSH会话,然后尝试重新加入,因为这是运行我得到加入vvv标志时输出如下:在运行脚本时将SSH转换为EC2实例

OpenSSH_7.4p1, OpenSSL 1.0.2k 26 Jan 2017 
debug1: Reading configuration data /home/me/.ssh/config 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug2: resolving "ec2-xx-xxx-xxx-x.compute-1.amazonaws.com" port 22 
debug2: ssh_connect_direct: needpriv 0 
debug1: Connecting to ec2-xx-xxx-xxx-x.compute-1.amazonaws.com 
[xx.xxx.xxx.x] port 22. 
debug1: Connection established. 
debug1: key_load_public: No such file or directory 
debug1: identity file .ssh/ec2key.pem type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file .ssh/ec2key.pem-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_7.4 
ssh_exchange_identification: read: Connection reset by peer 

另外我CloudWatch的日志似乎停止录制,扣球后的CPU使用率到最大80%下降到大约6%的使用率,所以感觉像是可能会崩溃。

有没有办法找出发生了什么问题/解决这个问题?

+0

尝试使用'screen'而不是'nohup'。 –

回答

0

事实证明,我的脚本中有内存泄漏。我没有在EC2上进行内存监控,但在本地运行,在几分钟内使用的内存就升至2.5 GB(远超过t2.micro的处理能力)。