EC2启动脚本卡在wget上 [英] EC2 startup script gets stuck on wget

查看:129
本文介绍了EC2启动脚本卡在wget上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下脚本进行一些数字处理

 #!/ bin / bash 
sudo apt-get更新-y
sudo apt-get升级-y
sudo apt-get install -y r-base r-base-dev htop s3cmd p7zip-full
wget https://s3.amazonaws .com / ####### / ###。7z
7z e ###。7z
sudo R CMD BATCH --slave --no-timing --vanilla --args 0 1 100 200 500 2 SOME-ROUTINE.R
s3cmd put * .results s3:// ######### /


。我将脚本作为文件上传到启动实例->实例详细信息->用户数据



计算机启动,更新和升级,但是它不执行wget并执行无法下载文件。当我在实例中执行SSH并运行完全相同的命令时,该过程将顺利完成。



有什么想法wget无法正常工作?



还有其他选择吗?



EC

解决方案

总是有一些猜测,但是这就是我的调试方法:



我的第一个建议是检查S3 URL中的特殊字符。这可能导致wget调用失败。



第二,我将使用 -O 选项给出wget的显式输出路径。编辑命令时,还可以添加 -o 以输出日志信息。



最后一步是检查您对S3存储桶的访问权限。也许您可以尝试将文件放在另一个Web空间上,以查看命令是否随后执行。


I have the following script for some number crunching

#!/bin/bash
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y r-base r-base-dev htop s3cmd p7zip-full
wget https://s3.amazonaws.com/#######/###.7z
7z e ###.7z
sudo R CMD BATCH --slave --no-timing --vanilla "--args 0 1 100 200 500 2" SOME-ROUTINE.R
s3cmd put *.results s3://#########/

on EC2. I upload the script as file at the Launch Instance->Instance Details->User Data

The machine fires up, updates and upgrades but then it does not execute wget and does not download the file. When i SSH in the Instance and run the exact same commands the process completes without problems.

Any ideas why wget does not work?

Any other alternatives?

EC

解决方案

It is always a bit of guessing, but here is how I would debug this:

My first suggestion would be to check for special characters in the S3 URL. This might cause the wget call to fail.

Second, I would give an explicit output path to wget with the -O option. While you are editing the command, you can also add -o to output logging information.

Last step is to check your access rights to the S3 bucket. Perhaps you can try to put the file on another webspace to see if the command executes then.

这篇关于EC2启动脚本卡在wget上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆