SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Downloaden Sie, um offline zu lesen
Хокку про Heroku
Сергей Селецкий
@sseletskyy
Европейское Агентство Высоких Технологий

http://www.foss-sea.org.ua/

2013
Что такое Paas
(Product as a Service)

Cloud сервер + Agile + масштабирование
Что такое Paas
(Product as a Service)
с финансовой точки зрения
● нет затрат на покупку серверов
● на покупку серверного ПО
● на зарплату администратора
● ежемесячная оплата услуг PaaS
GIT
SOURCE
CODE

HEROKU

$ git push heroku your_branch:master
$ heroku ps:scale web=1 worker=1

LOAD
BALANCER

HEROKU

STATELESS
INSTANCE
WEB
DYNO

PostgreSQL

STATELESS
INSTANCE
WORKER
DYNO
$ heroku ps:scale web=2 worker=2

LOAD
BALANCER

HEROKU

STATELESS
STATELESS
INSTANCE
INSTANCE
WEB
DYNO
DYNO

PostgreSQL

STATELESS
STATELESS
INSTANCE
INSTANCE
WORKER
DYNO
DYNO
$ heroku ps:scale web=3 worker=3

LOAD
BALANCER

HEROKU

STATELESS
STATELESS
INSTANCE
STATELESS
INSTANCE
INSTANCE
DYNO
WEB
DYNO
DYNO

PostgreSQL

STATELESS
STATELESS
INSTANCE
STATELESS
INSTANCE
INSTANCE
DYNO
WORKER
DYNO
DYNO
$ heroku ps:scale web=5 worker=5

LOAD
BALANCER

HEROKU

STATELESS
STATELESS
INSTANCE
STATELESS
INSTANCE
STATELESS
INSTANCE
STATELESS
INSTANCE
DYNO
INSTANCE
DYNO
DYNO
WEB
DYNO
DYNO

PostgreSQL

STATELESS
STATELESS
INSTANCE
STATELESS
INSTANCE
STATELESS
INSTANCE
STATELESS
INSTANCE
DYNO
INSTANCE
DYNO
DYNO
WORKER
DYNO
DYNO
==> heroku login
Enter your Heroku credentials.
Email: gustotune@gmail.com
Password (typing will be hidden):
Found the following SSH public keys:
1) id_rsa.pub
2) id_rsa_cloud.pub
Which would you like to use with your Heroku account?
2
Uploading SSH public key /Users/gustotune/.
ssh/id_rsa_cloud.pub... failed
! This key is already in use by another account. Each
account must have a unique key.
/Users/gustotune
==> ssh-keygen -t rsa -C "gustotune@gmail.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/gustotune/.
ssh/id_rsa): id_rsa_gustotune
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_rsa_gustotune.
Your public key has been saved in id_rsa_gustotune.
pub.
/Users/gustotune
==> mv id_rsa_gustotune* .ssh/
/Users/gustotune
==> heroku login
Enter your Heroku credentials.
Email: gustotune@gmail.com
Password (typing will be hidden): password is here
Found the following SSH public keys:
1) id_rsa.pub
2) id_rsa_cloud.pub
3) id_rsa_gustotune.pub
Which would you like to use with your Heroku account? 3
Uploading SSH public key /Users/gustotune/.
ssh/id_rsa_gustotune.pub... done
Authentication successful.
/Users/gustotune/rails_app
==> git config -e
# комментарий: добавить три строчки в конец файла
[remote "foss-sea"]
url = git@heroku.com:foss-sea.git
fetch = +refs/heads/*:refs/remotes/heroku/*
или тоже самое одной командой
==> heroku git:remote -a foss-sea -r foss-sea
где -a - это название приложения
-r - это git remote name (‘heroku’ по умолчанию)
/Users/gustotune/rails_app
==> git push foss-sea heroku:master
foss-sea = remote git repo in git config
heroku = our local branch (локальная ветка)
master = default branch at foss-sea
еще примеры
==> git push foss-sea master:master
==> git push foss-sea release_1.0:master
==> git push foss-sea heroku:master
Counting objects: 8212, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2822/2822), done.
Writing objects: 100% (8212/8212), 9.68 MiB | 74.00 KiB/s, done.
Total 8212 (delta 5114), reused 8101 (delta 5027)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
New app detected loading default bundler cache
Running: bundle install --without development:test --path vendor/bundle --binstubs
vendor/bundle/bin --deployment
Fetching source index from https://rubygems.org/
Asset precompilation completed (28.32s)
Cleaning assets
-----> Discovering process types
Procfile declares types -> web
Default types for Ruby -> console, rake, worker
-----> Compiled slug size: 55.3MB
-----> Launching... done, v5
http://foss-sea.herokuapp.com deployed to Heroku
To git@heroku.com:foss-sea.git
* [new branch]
heroku -> master
Подготовка базы данных
/Users/gustotune/rails_app
==> heroku run rake db:version
Running `rake db:version` attached to terminal... up, run.9905
Current version: 0
/Users/gustotune/rails_app
==> heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.7096
Migrating to DeviseCreateUsers (20130910211249)
== DeviseCreateUsers: migrating
==============================================
-- create_table(:users)
-> 0.0398s
-- add_index(:users, :email, {:unique=>true})
-> 0.0203s
-- add_index(:users, :reset_password_token, {:unique=>true})
-> 0.0260s
-- add_index(:users, :confirmation_token, {:unique=>true})
-> 0.0222s
== DeviseCreateUsers: migrated (0.1091s)
...
БИНГО ;)
Работа с дополнениями
add-ons
/Users/gustotune/rails_app
==> heroku addons:add logentries
Adding logentries on foss-sea... failed
! Please verify your account to install this add-on
! For more information, see http://devcenter.heroku.com/categories/billing
! Verify now at https://heroku.com/verify
==> heroku addons:add newrelic:stark
Adding newrelic:stark on foss-sea... done, v7 (free)
Use `heroku addons:docs newrelic` to view documentation.
==> heroku addons:add pgbackups:auto-month
Adding pgbackups:auto-month on foss-sea... done, v8 (free)
You can now use "pgbackups" to backup your databases or import an external
backup.
Use `heroku addons:docs pgbackups` to view documentation.
==> heroku addons:add rollbar
Adding rollbar on foss-sea... done, v9 (free)
Use `heroku addons:docs rollbar` to view documentation.
==> heroku addons:add sendgrid
Adding sendgrid on foss-sea... done, v10 (free)
Use `heroku addons:docs sendgrid` to view documentation.
Настройка дополнений
и переменных
окружения
> heroku config:set MAILER_URL=foss-sea.herokuapp.com
или так если используется собственный домен
> heroku config:set MAILER_URL=foss-sea.custom-domain.io
Примеры дополнений
Играем с
масштабированием и
ценой
Полезные команды
==> heroku ps # возвращает список работающих копий приложения
=== web (1X): `bundle exec passenger start -p $PORT --max-pool-size 2`
web.1: up 2013/11/29 01:02:25 (~ 46m ago)
==> heroku ps:scale web=2 worker=1
Scaling web processes... done, now running 2
Scaling worker processes... done, now running 1
==> heroku run bash # получить доступ к консоли сервера
==> heroku run rails c # получить доступ к консоли приложения
==> heroku run rake [your_rake_task] # вызвать rake задачу [your_rake_task]
==> heroku logs --tail #просмотреть логи
==> heroku labs:enable user-env-compile # решает ряд проблем при сборке
==> heroku fork -a foss-sea foss-sea-copy # делает полную копию приложения
==> heroku maintenance:on
Enabling maintenance mode for foss-sea... done
Восстановление после неудачного обновления
Спасибо
Сергей Селецкий
@sseletskyy
Хокку про Heroku

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (18)

Odoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvOdoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenv
 
Securing Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultSecuring Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp Vault
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~
 
Elastic stack
Elastic stackElastic stack
Elastic stack
 
Ansibleではじめるサーバー・ネットワークの自動化(2019/02版)
Ansibleではじめるサーバー・ネットワークの自動化(2019/02版)Ansibleではじめるサーバー・ネットワークの自動化(2019/02版)
Ansibleではじめるサーバー・ネットワークの自動化(2019/02版)
 
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQRealtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
Realtime Analytics Using MongoDB, Python, Gevent, and ZeroMQ
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015
 
IIJにおけるGlusterFS利用事例 GlusterFSの詳解と2年間の運用ノウハウ
IIJにおけるGlusterFS利用事例 GlusterFSの詳解と2年間の運用ノウハウIIJにおけるGlusterFS利用事例 GlusterFSの詳解と2年間の運用ノウハウ
IIJにおけるGlusterFS利用事例 GlusterFSの詳解と2年間の運用ノウハウ
 
CouchDB Day NYC 2017: Replication
CouchDB Day NYC 2017: ReplicationCouchDB Day NYC 2017: Replication
CouchDB Day NYC 2017: Replication
 
オブジェクトストレージの詳解とクラウドサービスを活かすスケーラブルなシステム開発
オブジェクトストレージの詳解とクラウドサービスを活かすスケーラブルなシステム開発オブジェクトストレージの詳解とクラウドサービスを活かすスケーラブルなシステム開発
オブジェクトストレージの詳解とクラウドサービスを活かすスケーラブルなシステム開発
 
Automating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSAutomating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWS
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
Gaelyk
GaelykGaelyk
Gaelyk
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
Observability with Consul Connect
Observability with Consul ConnectObservability with Consul Connect
Observability with Consul Connect
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Laravel Day / Deploy
Laravel Day / DeployLaravel Day / Deploy
Laravel Day / Deploy
 

Andere mochten auch

Modulo i día 4 introduccion rse_diplomado rse periodistas
Modulo i día 4 introduccion rse_diplomado rse periodistasModulo i día 4 introduccion rse_diplomado rse periodistas
Modulo i día 4 introduccion rse_diplomado rse periodistas
UDELAS
 
La Despertà Valenciana
La Despertà ValencianaLa Despertà Valenciana
La Despertà Valenciana
MARTA FIGUERAS
 
Mémoire AU Camille Gellin
Mémoire AU Camille GellinMémoire AU Camille Gellin
Mémoire AU Camille Gellin
Camille Gellin
 
Download kashmir sheet music by led zeppelin sheet music plus
Download kashmir sheet music by led zeppelin   sheet music plusDownload kashmir sheet music by led zeppelin   sheet music plus
Download kashmir sheet music by led zeppelin sheet music plus
André Lenz
 

Andere mochten auch (20)

Mídias Sociais e Mobilidade Urbana
Mídias Sociais e Mobilidade UrbanaMídias Sociais e Mobilidade Urbana
Mídias Sociais e Mobilidade Urbana
 
Modulo i día 4 introduccion rse_diplomado rse periodistas
Modulo i día 4 introduccion rse_diplomado rse periodistasModulo i día 4 introduccion rse_diplomado rse periodistas
Modulo i día 4 introduccion rse_diplomado rse periodistas
 
Cibercultura aula 07 comunicação digital (of. 2)
Cibercultura   aula 07   comunicação digital (of. 2)Cibercultura   aula 07   comunicação digital (of. 2)
Cibercultura aula 07 comunicação digital (of. 2)
 
Planejamento e Gestão Em Mídias Digitais - Aula 08
Planejamento e Gestão Em Mídias Digitais - Aula 08Planejamento e Gestão Em Mídias Digitais - Aula 08
Planejamento e Gestão Em Mídias Digitais - Aula 08
 
CIO Survey 2014
CIO Survey 2014CIO Survey 2014
CIO Survey 2014
 
Eb 4
Eb 4Eb 4
Eb 4
 
Yo te lo dige
Yo te lo digeYo te lo dige
Yo te lo dige
 
Slaidrāde
SlaidrādeSlaidrāde
Slaidrāde
 
La Despertà Valenciana
La Despertà ValencianaLa Despertà Valenciana
La Despertà Valenciana
 
O legado da copa do mundo no brasil
O legado da copa do mundo no brasilO legado da copa do mundo no brasil
O legado da copa do mundo no brasil
 
Usando efeitos, animações e transições no FireMonkey
Usando efeitos, animações e transições no FireMonkey Usando efeitos, animações e transições no FireMonkey
Usando efeitos, animações e transições no FireMonkey
 
Mémoire AU Camille Gellin
Mémoire AU Camille GellinMémoire AU Camille Gellin
Mémoire AU Camille Gellin
 
Gurumudra
GurumudraGurumudra
Gurumudra
 
Download kashmir sheet music by led zeppelin sheet music plus
Download kashmir sheet music by led zeppelin   sheet music plusDownload kashmir sheet music by led zeppelin   sheet music plus
Download kashmir sheet music by led zeppelin sheet music plus
 
Trophy winning-teams Codemotion Milan 2015
Trophy winning-teams Codemotion Milan 2015Trophy winning-teams Codemotion Milan 2015
Trophy winning-teams Codemotion Milan 2015
 
Amazon ECSとDevOps
Amazon ECSとDevOpsAmazon ECSとDevOps
Amazon ECSとDevOps
 
字字千金(二)(With animation & music)
字字千金(二)(With animation & music)字字千金(二)(With animation & music)
字字千金(二)(With animation & music)
 
Web Politics 2.0
Web Politics 2.0Web Politics 2.0
Web Politics 2.0
 
Carlos 8ºb
Carlos 8ºbCarlos 8ºb
Carlos 8ºb
 
Guitarra xpress
Guitarra xpressGuitarra xpress
Guitarra xpress
 

Ähnlich wie Хокку про Heroku

mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
tutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
tutorialsruby
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
tutorialsruby
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
Ortus Solutions, Corp
 

Ähnlich wie Хокку про Heroku (20)

Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK Seminar
 
Optimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerOptimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for Docker
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Dexterity in 15 minutes or less
Dexterity in 15 minutes or lessDexterity in 15 minutes or less
Dexterity in 15 minutes or less
 
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
Open Source Backup Conference 2014: Workshop bareos introduction, by Philipp ...
 
Hosting Your Own OTA Update Service
Hosting Your Own OTA Update ServiceHosting Your Own OTA Update Service
Hosting Your Own OTA Update Service
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
 
Bower & Grunt - A practical workflow
Bower & Grunt - A practical workflowBower & Grunt - A practical workflow
Bower & Grunt - A practical workflow
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and dockerInto The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
 
Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018Going live with BommandBox and docker Into The Box 2018
Going live with BommandBox and docker Into The Box 2018
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Heroku Tips and Hacks
Heroku Tips and HacksHeroku Tips and Hacks
Heroku Tips and Hacks
 
Oracle API Gateway Installation
Oracle API Gateway InstallationOracle API Gateway Installation
Oracle API Gateway Installation
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Хокку про Heroku

  • 1. Хокку про Heroku Сергей Селецкий @sseletskyy Европейское Агентство Высоких Технологий http://www.foss-sea.org.ua/ 2013
  • 2. Что такое Paas (Product as a Service) Cloud сервер + Agile + масштабирование
  • 3. Что такое Paas (Product as a Service) с финансовой точки зрения ● нет затрат на покупку серверов ● на покупку серверного ПО ● на зарплату администратора ● ежемесячная оплата услуг PaaS
  • 4. GIT SOURCE CODE HEROKU $ git push heroku your_branch:master
  • 5. $ heroku ps:scale web=1 worker=1 LOAD BALANCER HEROKU STATELESS INSTANCE WEB DYNO PostgreSQL STATELESS INSTANCE WORKER DYNO
  • 6. $ heroku ps:scale web=2 worker=2 LOAD BALANCER HEROKU STATELESS STATELESS INSTANCE INSTANCE WEB DYNO DYNO PostgreSQL STATELESS STATELESS INSTANCE INSTANCE WORKER DYNO DYNO
  • 7. $ heroku ps:scale web=3 worker=3 LOAD BALANCER HEROKU STATELESS STATELESS INSTANCE STATELESS INSTANCE INSTANCE DYNO WEB DYNO DYNO PostgreSQL STATELESS STATELESS INSTANCE STATELESS INSTANCE INSTANCE DYNO WORKER DYNO DYNO
  • 8. $ heroku ps:scale web=5 worker=5 LOAD BALANCER HEROKU STATELESS STATELESS INSTANCE STATELESS INSTANCE STATELESS INSTANCE STATELESS INSTANCE DYNO INSTANCE DYNO DYNO WEB DYNO DYNO PostgreSQL STATELESS STATELESS INSTANCE STATELESS INSTANCE STATELESS INSTANCE STATELESS INSTANCE DYNO INSTANCE DYNO DYNO WORKER DYNO DYNO
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. ==> heroku login Enter your Heroku credentials. Email: gustotune@gmail.com Password (typing will be hidden): Found the following SSH public keys: 1) id_rsa.pub 2) id_rsa_cloud.pub Which would you like to use with your Heroku account? 2 Uploading SSH public key /Users/gustotune/. ssh/id_rsa_cloud.pub... failed ! This key is already in use by another account. Each account must have a unique key.
  • 17. /Users/gustotune ==> ssh-keygen -t rsa -C "gustotune@gmail.com" Generating public/private rsa key pair. Enter file in which to save the key (/Users/gustotune/. ssh/id_rsa): id_rsa_gustotune Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in id_rsa_gustotune. Your public key has been saved in id_rsa_gustotune. pub. /Users/gustotune ==> mv id_rsa_gustotune* .ssh/
  • 18. /Users/gustotune ==> heroku login Enter your Heroku credentials. Email: gustotune@gmail.com Password (typing will be hidden): password is here Found the following SSH public keys: 1) id_rsa.pub 2) id_rsa_cloud.pub 3) id_rsa_gustotune.pub Which would you like to use with your Heroku account? 3 Uploading SSH public key /Users/gustotune/. ssh/id_rsa_gustotune.pub... done Authentication successful.
  • 19.
  • 20.
  • 21. /Users/gustotune/rails_app ==> git config -e # комментарий: добавить три строчки в конец файла [remote "foss-sea"] url = git@heroku.com:foss-sea.git fetch = +refs/heads/*:refs/remotes/heroku/* или тоже самое одной командой ==> heroku git:remote -a foss-sea -r foss-sea где -a - это название приложения -r - это git remote name (‘heroku’ по умолчанию)
  • 22. /Users/gustotune/rails_app ==> git push foss-sea heroku:master foss-sea = remote git repo in git config heroku = our local branch (локальная ветка) master = default branch at foss-sea еще примеры ==> git push foss-sea master:master ==> git push foss-sea release_1.0:master
  • 23. ==> git push foss-sea heroku:master Counting objects: 8212, done. Delta compression using up to 4 threads. Compressing objects: 100% (2822/2822), done. Writing objects: 100% (8212/8212), 9.68 MiB | 74.00 KiB/s, done. Total 8212 (delta 5114), reused 8101 (delta 5027) -----> Ruby app detected -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.0.0 -----> Installing dependencies using Bundler version 1.3.2 New app detected loading default bundler cache Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment Fetching source index from https://rubygems.org/ Asset precompilation completed (28.32s) Cleaning assets -----> Discovering process types Procfile declares types -> web Default types for Ruby -> console, rake, worker -----> Compiled slug size: 55.3MB -----> Launching... done, v5 http://foss-sea.herokuapp.com deployed to Heroku To git@heroku.com:foss-sea.git * [new branch] heroku -> master
  • 24.
  • 25.
  • 26. Подготовка базы данных /Users/gustotune/rails_app ==> heroku run rake db:version Running `rake db:version` attached to terminal... up, run.9905 Current version: 0 /Users/gustotune/rails_app ==> heroku run rake db:migrate Running `rake db:migrate` attached to terminal... up, run.7096 Migrating to DeviseCreateUsers (20130910211249) == DeviseCreateUsers: migrating ============================================== -- create_table(:users) -> 0.0398s -- add_index(:users, :email, {:unique=>true}) -> 0.0203s -- add_index(:users, :reset_password_token, {:unique=>true}) -> 0.0260s -- add_index(:users, :confirmation_token, {:unique=>true}) -> 0.0222s == DeviseCreateUsers: migrated (0.1091s) ...
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35. /Users/gustotune/rails_app ==> heroku addons:add logentries Adding logentries on foss-sea... failed ! Please verify your account to install this add-on ! For more information, see http://devcenter.heroku.com/categories/billing ! Verify now at https://heroku.com/verify ==> heroku addons:add newrelic:stark Adding newrelic:stark on foss-sea... done, v7 (free) Use `heroku addons:docs newrelic` to view documentation. ==> heroku addons:add pgbackups:auto-month Adding pgbackups:auto-month on foss-sea... done, v8 (free) You can now use "pgbackups" to backup your databases or import an external backup. Use `heroku addons:docs pgbackups` to view documentation. ==> heroku addons:add rollbar Adding rollbar on foss-sea... done, v9 (free) Use `heroku addons:docs rollbar` to view documentation. ==> heroku addons:add sendgrid Adding sendgrid on foss-sea... done, v10 (free) Use `heroku addons:docs sendgrid` to view documentation.
  • 36.
  • 38. > heroku config:set MAILER_URL=foss-sea.herokuapp.com или так если используется собственный домен > heroku config:set MAILER_URL=foss-sea.custom-domain.io
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 46.
  • 47.
  • 48.
  • 49.
  • 51. ==> heroku ps # возвращает список работающих копий приложения === web (1X): `bundle exec passenger start -p $PORT --max-pool-size 2` web.1: up 2013/11/29 01:02:25 (~ 46m ago) ==> heroku ps:scale web=2 worker=1 Scaling web processes... done, now running 2 Scaling worker processes... done, now running 1 ==> heroku run bash # получить доступ к консоли сервера ==> heroku run rails c # получить доступ к консоли приложения ==> heroku run rake [your_rake_task] # вызвать rake задачу [your_rake_task] ==> heroku logs --tail #просмотреть логи ==> heroku labs:enable user-env-compile # решает ряд проблем при сборке ==> heroku fork -a foss-sea foss-sea-copy # делает полную копию приложения ==> heroku maintenance:on Enabling maintenance mode for foss-sea... done