Tag: amazon ec2

对于AWS,如何使用ruby aws-sdk将标记设置为资源?

我很擅长使用亚马逊的ruby-sdk(gem install aws-sdk),并且我只是试图简单地为快照资源创建一个标签。 这就是我正在做的事情: ec2.tags.create(:resource_id => “snap-7d3aa701”, :key => “My Test Tag”, :value => “My test value”) ArgumentError: wrong number of arguments (1 for 2) 注意,ec2 = AWS :: EC2.new(在我设置我的凭据之后)。 我有什么想法我做错了吗? 我无法在网上找到使用ruby aws-sdk进行标记的单一示例。

与ror托管错误

我在aws ec2中托管了一个ror应用程序。 开发环境工作正常,但当我开始生产模式时,它说 – “我们很抱歉,但出了点问题。我们已经收到有关此问题的通知,我们很快就会对其进行审核。” 我chechked production.log production.log [2015-07-02T16:37:21.257777 #12834] INFO — : Migrating to (20150608154559) 像这样,所有表名都显示为具有迁移的消息。 这是一个错误吗? 怎么解决这个?

ruby:没有这样的文件加载 – 运行cap rubber时的ubygems(LoadError):create_staging

我正在尝试按照Railscast#347 Rubber和Amazon EC2的指示启动Amazon EC2实例。 Rails项目配置如下。 .ruby-version文件: ruby-1.9.3 这是Gemfile : source ‘http://rubygems.org’ ruby ‘1.9.3’ gem ‘rails’, ‘~> 3.2.13’ gem ‘rb-readline’, ‘~> 0.5.0’ gem ‘counter_culture’, ‘~> 0.1.12’ gem ‘jquery-rails’, ‘~> 3.0.2’ gem ‘therubyracer’, ‘~> 0.11.4’, require: ‘v8’ gem ‘attribute_normalizer’, ‘~> 1.1.0’ group :assets do gem ‘sass-rails’, ‘~> 3.2.5’ gem ‘coffee-rails’, ‘~> 3.2.2’ gem ‘uglifier’, ‘~> 2.1.1’ end […]

cap使用admin而不是ec2-user

我正在尝试为我的ROR网站做一个“封装ec2onrails:setup”到EC2实例(亚马逊图像),但无论我做什么,身份validation都会一直要求我输入密码。 我在这个和/或其他论坛上尝试了几乎所有我读过的东西: 将公钥从〜/ .ssh复制到ec2-user @_。sa-east-1.compute.amazonaws.com:/ home / ec2-user / .ssh / authorized_keys2(或authorized_keys) 使用Amazon Management Console生成私钥,然后将公钥从服务器复制到我的计算机 使用ssh-add -l添加任何这些键 使用ssh-keychain生成新密钥 使用我机器中已有的公钥/私钥组(id_rsa&id_rsa.pub) 按照上述^^约定命名键 chmod 400为〜/ .ssh中的键 将键移动到〜/ .ec2 设置像这里所述的环境变量 笔记: 使用ssh和AWS .pem密钥连接到服务器工作正常 我在“ssh_options”中设置“keys”值并不重要,Capistrano似乎总是忽略它。 但是,它不会忽略ssh-add -l中列出的键 以下是我尝试设置关键路径的方法 set :ssh_options, {:keys => [“/Users/dalef/.ssh/pk”]} 这是我最新测试的输出代码,使用详细输出 Damians-MacBook-Pro:test dalef$ cap ec2onrails:setup [Deprecation Warning] This API has changed, please hook `deploy:create_symlink` instead of `deploy:symlink`. […]

无法连接到AWS中的rails服务器

我整理了一个rails 5应用程序,并尝试从AWS ec2实例运行它。 我已经设置了安全组,但无法访问我选择的特殊端口。 可能有什么不对? 安全组设置: Ports Protocol Source rails-dev-and-ssh 80 tcp 72.21.xxx.0/24 ✔ 22 tcp 72.21.xxx.0/24 ✔ 3800 tcp 0.0.0.0/0 ✔ Puma服务器启动: [ec2-user@ip-172-31-42-206 Viewer]$ rails server -p 3800 -b 172.31.42.206 => Booting Puma => Rails 5.0.0.1 application starting in development on http://172.31.42.206:3800 => Run `rails server -h` for more startup options Puma starting in […]

mysql不尊重my.cnf中的wait_timeout设置

我在my.cnf中设置了wait_timeout并重新启动了服务器,但空闲连接的时间继续大于我设置的默认值100s。 任何想法为什么会这样? PS:我正在运行ubuntu 12.04和Mysql Server 5.5。 使用Rails 3和mysql2 gem。 mysql> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST ORDER BY TIME DESC LIMIT 20; +——+——————+————————————-+————————–+———+——+——-+——+ | ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | +——+——————+————————————-+————————–+———+——+——-+——+ | 760 | user | ip-xxx-xxx-xxx-xxx.ec2.internal:45852 | x | Sleep | 4202 | | NULL | […]

MySQL不会在与Rubber部署的EC2上连接

我正在使用橡胶来部署rails应用程序,并且无法连接到MySQL。 我是否必须在EC2上手动设置MySQL,或者橡胶是否已经这样做了? 虽然这不是那么有用,但是在运行rake时这是日志输出: ** [out :: db01.memepluspl.us] rake aborted! ** [out :: db01.memepluspl.us] ** [out :: db01.memepluspl.us] Access denied for user ”@’db01.memepluspl.us’ to database ‘meme_plus_plus_production’ ** [out :: db01.memepluspl.us] ** [out :: db01.memepluspl.us] ** [out :: db01.memepluspl.us] Tasks: TOP => db:migrate => environment

capistrano部署后,ec2服务器中缺少puma.sock

在通过capistrano将生产ruby on rails项目部署到ec2上的实例后,我在nginx错误日志中收到以下错误。 亚马逊公共主机显示502 Bad Gateway nginx / 1.10.0(Ubuntu)。 我按照https://www.sitepoint.com/deploy-your-rails-app-to-aws/上的教程进行操作。当我运行cap生产部署时,似乎没有创建puma.sock。 2017/06/28 01:09:57 [crit] 12802#12802: *1 connect() to unix:/home/deploy/app_name/shared/tmp/sockets/puma.sock failed (2: No such file or directory) while connecting to upstream, client: 173.198.30.2, server: localhost, request: “GET / HTTP/1.1”, upstream: “http://unix:/home/deploy/app_name/shared/tmp/sockets/puma.sock:/”, host: “host” 以下是我的deploy.rb set :application, ‘app_name’ set :repo_url, ‘git@github.com:github_account/app_name.git’ # Edit this to match your repository […]

Rubber和Amazon EC2托管问题(Net :: SSH :: AuthenticationFailed:root)

我想在Amazon EC2服务器上托管我的ruby on rails应用程序。 我在Ubuntu上关注Rubber和Amazon EC2的铁路广播。 当我执行cap rubber:create_staging命令时,它显示的错误是这样的 – * 2013-06-19 17:00:53 executing `rubber:setup_remote_aliases’ servers: [“production.ginfy.com”, “www.ginfy.com”, “foo.ginfy.com”, “ginfy.ginfy.com”, “temple.ginfy.com”, “ibetter.ginfy.com”] connection failed for: www.ginfy.com (Timeout::Error: execution expired), ibetter.ginfy.com (Timeout::Error: execution expired), temple.ginfy.com (Timeout::Error: execution expired), ginfy.ginfy.com (Timeout::Error: execution expired), production.ginfy.com (Net::SSH::AuthenticationFailed: root) 我已经检查过google group和github有关此问题的问题,但没有任何对我有用 。 不知道为什么我收到这个错误? 我无法弄清楚问题。 请帮忙。 更新: 我在亚马逊上成功托管了我的rails应用程序 现在我想知道如何在亚马逊上运行seeds.rb。 有没有办法在亚马逊上打开控制台? 在这里我提到了我的问题 – […]

Mysql无法通过Amazon EC2上的套接字连接到本地服务器

我在Amazon EC2上打开了我的应用程序(在Rails中)并收到错误 – 因此我检查了日志并且有以下内容: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111) 10个小时前,一切正常。 有什么问题? 很多交通? 该应用程序正在Micro Instance上运行。 如何解决这个问题以及将来如何避免这个问题? 非常感谢你 编辑: sudo find / -type s — /tmp/.sock /dev/log /var/lib/apt-xapian-index/update-socket /run/mysqld/mysqld.sock /run/acpid.socket /run/dbus/system_bus_socket /run/udev/control find: `/proc/4739/task/4739/fd/5′: No such file or directory find: `/proc/4739/task/4739/fdinfo/5′: No such file or directory find: `/proc/4739/fd/5′: No […]