Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu 在AWS EC2上安装CodeDeploy代理时出错_Ubuntu_Amazon Web Services_Amazon Ec2_Rpm_Aws Code Deploy - Fatal编程技术网

Ubuntu 在AWS EC2上安装CodeDeploy代理时出错

Ubuntu 在AWS EC2上安装CodeDeploy代理时出错,ubuntu,amazon-web-services,amazon-ec2,rpm,aws-code-deploy,Ubuntu,Amazon Web Services,Amazon Ec2,Rpm,Aws Code Deploy,在我新创建的EC2实例(Ubuntu14.04)上安装CodeDeploy代理时,我在遵循指南中的步骤时遇到了rpm错误 命令: wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install chmod +x ./install sudo ./install auto sudo: unable to resolve host ip-10-0-88-56 I, [2016-08-12T01:22:00.600236

在我新创建的EC2实例(Ubuntu14.04)上安装CodeDeploy代理时,我在遵循指南中的步骤时遇到了
rpm
错误

命令:

wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install

chmod +x ./install

sudo ./install auto
sudo: unable to resolve host ip-10-0-88-56
I, [2016-08-12T01:22:00.600236 #30533]  INFO -- : Starting Ruby version check.
I, [2016-08-12T01:22:00.600470 #30533]  INFO -- : Starting update check.
I, [2016-08-12T01:22:00.600565 #30533]  INFO -- : Checking AWS_REGION environment variable for region information...
I, [2016-08-12T01:22:00.600645 #30533]  INFO -- : Checking EC2 metadata service for region information...
I, [2016-08-12T01:22:00.627237 #30533]  INFO -- : Downloading version file from bucket aws-codedeploy-us-west-2 and key latest/VERSION...
I, [2016-08-12T01:22:00.666351 #30533]  INFO -- : Downloading version file from bucket aws-codedeploy-us-west-2 and key latest/VERSION...
I, [2016-08-12T01:22:00.695690 #30533]  INFO -- : Downloading package from bucket aws-codedeploy-us-west-2 and key releases/codedeploy-agent-1.0-1.1011.noarch.rpm...
I, [2016-08-12T01:22:00.756074 #30533]  INFO -- : Executing `/usr/bin/yum -y localinstall /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm`...
Setting up Local Package Process
Examining /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm: codedeploy-agent-1.0-1.1011.noarch
Marking /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package codedeploy-agent.noarch 0:1.0-1.1011 will be installed
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Finished Dependency Resolution
Error: Package: codedeploy-agent-1.0-1.1011.noarch (/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs)
           Requires: /bin/sh
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
E, [2016-08-12T01:22:00.847217 #30533] ERROR -- : Error installing /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm.
错误:

wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install

chmod +x ./install

sudo ./install auto
sudo: unable to resolve host ip-10-0-88-56
I, [2016-08-12T01:22:00.600236 #30533]  INFO -- : Starting Ruby version check.
I, [2016-08-12T01:22:00.600470 #30533]  INFO -- : Starting update check.
I, [2016-08-12T01:22:00.600565 #30533]  INFO -- : Checking AWS_REGION environment variable for region information...
I, [2016-08-12T01:22:00.600645 #30533]  INFO -- : Checking EC2 metadata service for region information...
I, [2016-08-12T01:22:00.627237 #30533]  INFO -- : Downloading version file from bucket aws-codedeploy-us-west-2 and key latest/VERSION...
I, [2016-08-12T01:22:00.666351 #30533]  INFO -- : Downloading version file from bucket aws-codedeploy-us-west-2 and key latest/VERSION...
I, [2016-08-12T01:22:00.695690 #30533]  INFO -- : Downloading package from bucket aws-codedeploy-us-west-2 and key releases/codedeploy-agent-1.0-1.1011.noarch.rpm...
I, [2016-08-12T01:22:00.756074 #30533]  INFO -- : Executing `/usr/bin/yum -y localinstall /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm`...
Setting up Local Package Process
Examining /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm: codedeploy-agent-1.0-1.1011.noarch
Marking /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package codedeploy-agent.noarch 0:1.0-1.1011 will be installed
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Processing Dependency: /bin/sh for package: codedeploy-agent-1.0-1.1011.noarch
--> Finished Dependency Resolution
Error: Package: codedeploy-agent-1.0-1.1011.noarch (/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs)
           Requires: /bin/sh
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
E, [2016-08-12T01:22:00.847217 #30533] ERROR -- : Error installing /tmp/codedeploy-agent-1.0-1.1011.noarch.tmp-20160812-30533-1j5n6zs.rpm.
我确实证实:

  • /bin/sh
    确实存在
  • Ruby 2.3.0是通过RVM安装的

我是DevOps的新手,所以不确定从这里去哪里。任何帮助或指导都将不胜感激

我认为主要问题是主机名错误:

sudo: unable to resolve host ip-10-0-88-56
我有这个问题,;这似乎是某种类型的初始化错误。我尝试了一次新的AMI发布,它自行解决了问题

为了隔离问题,请尝试以下方法:

echo "127.0.0.1 $(hostname)" >> /etc/hosts
然后重试安装脚本

作为参考,我使用相同的步骤在Ubuntu 14.04上安装CodeDeploy;步骤是正确的

wget https://aws-codedeploy-${EC2_REGION}.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
sudo service codedeploy-agent status

您是否尝试过使用
sudo./install deb
?它强制使用基于Debian的安装过程

如果它不起作用,请在安装gdebi后使用
sudo apt get install gdebi
重试