为什么在EC2实例上运行的配置文件不适用于弹性beanstalk?

时间:2018-01-24 17:08:54

标签: amazon-web-services amazon-ec2 elastic-beanstalk

所以我在我的EC2实例上有以下kue.config文件可以正常工作(即运行正常),当我尝试在Elastic Beanstalk上使用它作为.ebextension时无法正常工作?

    description "start kue server"

    start on filesystem and started networking
    stop on shutdown


    script
      touch /var/log/forever.log
      touch /var/log/stat_out.log
      touch /var/log/stat_err.log
      rm /var/log/forever.log
      rm /var/log/stat_out.log
      rm /var/log/stat_err.log
    NODE_ENV=production forever start --spinSleepTime 10000 -l /var/log/forever.log -o /var/log/stat_out.log -e /var/log/stat_err.log /home/ec2-user/mykue/server.js
    /bin/echo 'Server should be started we ran etc/init/kue.config' >> ../home/ec2-user/wearego
    end script

我收到以下错误:

Top level element in configuration file burrokue/.ebextensions/kue.config in application version burrokue3 must be a map. Update the top level element in the configuration file.

1 个答案:

答案 0 :(得分:2)

您混淆了.config个文件。

您正在使用的kue.config文件是用于配置Kue服务的配置文件:https://github.com/Automattic/kue

但是,.config文件夹中的.ebextensions个文件并不相同。它们用于不同的目的:配置Elastic Beanstalk服务。

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html

文件格式不同。

虽然它们的名字都以.config结尾,但它们并不相同。

在您的情况下,假设您已经在Elastic Beanstalk EC2实例上安装了Kue,您可以创建一个.ebextensions文件,指示Elastic Beanstalk创建您的kue.config文件。