问题标签 [aws-opsworks]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
142 浏览

caching - Where should my caching daemon live?

TL;DR - should a simple cache cluster for session storage (using memcache or redis) live on the app's servers (i.e. along with nginx and php) or on its own separate ec2 instance (like elasticache or a customized ec2 instance)?

I'm in the process of using Amazon OpsWorks to set up my web app's infrastructure. I am leaning toward implementing the session cache through memcache instances installed on the app layer itself rather than as its own ec2 instance. For instance:

vs.

What are the pros and cons here? To me the later solution seems unnecessary, though I can see how a high-traffic website with a really large session cache might need this.

Is there a reason I may not want to run redis or elasticache alongside my nginx/php app server stack? Does it make auto-scaling or monitoring performance more difficult to do perhaps?

0 投票
1 回答
354 浏览

php - Where does aws opsworks deploy to by default?

Let's say we have a laravel app that is deployed from a github repository.

What I can't seem to find any documentation for is where the applications source code is deployed to on the filesystem?

We are using PHP5.5 features in our code so our PHP App Server is a custom layer based off an AMI.

I need to setup an apache vhost that points to the application, but I can't do this if I don't know where it get's deployed to!

0 投票
1 回答
1523 浏览

php - OpsWorks / Chef PHP 部署流程

我对使用 OpsWorks 可靠地部署一个简单的 PHP 应用程序感到非常沮丧,我找不到任何有关如何srv/www/app-name/releases管理目录的文档,但我认为这可能是我当前问题的原因。

我正在部署一个 Laravel 应用程序,所以我需要在部署时使用厨师食谱发生两件事:composer install,以及一些可写的目录。Composer 似乎安装得很好,但是我创建和 chmod 目录的方法似乎发生在以前的版本中——这对我来说根本没有意义。

安装作曲家:

这工作正常,我可以刷新供应商目录,因为它运行看到出现的依赖项。但是下一个要运行的配方:

来自的内容Chef::log确实出现在日志中,没有错误,但目录根本不存在 - 它们是在 PREVIOUSrelease/timestamp目录中创建的,就好像“当前”符号链接在本食谱期间已恢复。它们也是使用权限“411”创建的。

谁能解释我在这里出错的地方?我可以访问新目录路径而不是使用“当前”符号链接吗?

0 投票
1 回答
212 浏览

php - How Are OpsWorks' Built-In Recipes Versioned?

When you set up a stack in OpsWorks, does it lock in the current built-in cookbooks version or will it use the most up-to-date version each time a lifecycle event is triggered?

For custom cookbooks, I understand that OpsWorks caches the provided recipes when they are provided rather than fetching the newest version each time, but I wonder if the same is true for the built-in cookbooks.

I'm concerned about this for a few reasons. What if the cookbooks are updated to install a different version of Apache or PHP or slightly vary their default configuration? What if I then setup a new instance in a layer in which the old recipe was used and end up with multiple servers with slightly different configurations?

Also there doesn't appear to be a way to customize which PHP5 version gets installed, so am I just at the mercy of the ubuntu package managers' decision to use the latest stable version?

I do want to continue using the latest and greatest software versions, but I would like to deploy them on my own time after I have been able to test that my application works in the new version.

0 投票
1 回答
1702 浏览

amazon-web-services - 厨师,找不到模板

我正在尝试将 chef 与 aws opsworks 一起使用。

但是它似乎没有加载我的模板。

这是有关配方的一部分,位于 /api/recipes/configure.rb

这是堆栈跟踪

这是我的目录结构
目录截图

0 投票
2 回答
490 浏览

php - How to run a command on only the first instance in a specific layer on deployment with opsworks?

We are deploying a Laravel application on aws opsworks, everything is running great, however we need to do two other things:

1) On each deployment we want to run php artisan migrate to install the database updates.
2) We have a file (app/database/run.list) which contains a list of class names, for each line in the file we want to run php artisan db:seed --class={line from file}. e.g.

run.list contains

we want to run

That parts not exactly difficult (although I am a bit stuck on the last one). The part that I am stuck on is, we only want to do this on the first instance in a specific layer (the php-app layer).

We obviously don't want to end up seeding the database for every instance!

Is there a way to automate this, or must we create another recipe, then after deployment manually trigger this recipe on the instance?

0 投票
1 回答
734 浏览

node.js - AWS opsworks createApp api 不适用于通过 bitbucket 提供的密码和用户名

我正在尝试使用 aws node.js sdk 在 OPSWorks 中创建应用程序。

我的存储库位于 bitbucket,它是私有的。

我想将 AWS api 与我的帐户密码一起使用,而不是 SSH。

这是代码:

出于某种原因,我在使用此应用程序运行实例时一直收到此错误。

错误:

我也尝试将网址更改为:

但后来我收到一个错误,它没有用户名字段。

一些它没有读取我提供的密码。

我已经成功使用了 DescribeApps,只是为了确保密码和用户名保存在亚马逊服务器的应用程序中。

那么AWS API可能有问题吗?

0 投票
1 回答
241 浏览

ruby - 如何在 OpsWorks 中运行独立程序?

我确信有一个简单的答案。我们的程序是一个可执行的 jar 文件,我们有一个 shell 脚本包装器。

  • OpsWorks 从 S3 抓取分发 zip 文件
  • 我们正在尝试解压缩并运行位于bin/run_server.sh

我目前正在为其编写自定义部署配方,在“其他”类型的层上运行。

这是我的尝试:

这失败了,声称它找不到bin/run_server.sh

提前致谢。

0 投票
3 回答
13223 浏览

ruby - 厨师属性“没有将字符串隐式转换为整数”

我正在编写一个厨师食谱,它只是创建一个数据库配置文件,但我很难访问这些属性。我为每个实例部署了一些 PHP 应用程序,并且 OpsWorks 对每个人都使用相同的配方,因此我在属性文件中有一些不同的设置。

属性/数据库-settings.rb

食谱/数据库-settings.rb

我得到的错误是no implicit conversion of String into Integer. 我已经尝试以我能想到的各种方式创建和访问设置,例如...

我敢肯定我在这里做错了一些非常明显的事情,但是我已经尝试了所有我能想到的东西,但我似乎找不到任何方法让它起作用?!理想情况下,我想尽可能使用一个变量"api",但是对于 3 个应用程序来说,使用 if/else 不会太糟糕......

0 投票
1 回答
2176 浏览

amazon-web-services - 如何在 AWS Opsworks 上设置 EC2 标签

我一直在使用各种社区食谱来建立堆栈。

我知道 AWS Opsworks 为您设置了一些标签(堆栈名称、层名称),但我需要自己设置一些标签。

似乎没有办法通过 Opsworks API 设置它们,所以我假设我需要使用食谱/食谱以某种方式设置它们。

是否有现有的方法/食谱可以这样做,还是我需要去学习厨师?