Skip to content

Instantly share code, notes, and snippets.

@ryshinoz
Last active September 10, 2019 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryshinoz/fbe192f30ddb1dc01a4708c5bd4fd421 to your computer and use it in GitHub Desktop.
Save ryshinoz/fbe192f30ddb1dc01a4708c5bd4fd421 to your computer and use it in GitHub Desktop.
# App
https://github.com/isucon/isucon9-qualify
## alibaba cloud
instance spec
https://gist.github.com/sota1235/a7356a5909af264c1c1c840dd216c98f#%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B%E3%82%A4%E3%83%B3%E3%82%B9%E3%82%BF%E3%83%B3%E3%82%B9%E3%81%AE%E3%82%B9%E3%83%9A%E3%83%83%E3%82%AF
OS: Ubuntu - 18.04 64bit
## local
$ docker --version
Docker version 19.03.2, build 6a30dfc
$ ansible --version
ansible 2.8.3
$ ghq get https://github.com/isucon/isucon9-qualify
## initial-data
https://github.com/isucon/isucon9-qualify#%E5%89%8D%E6%BA%96%E5%82%99
$ cd initial-data
$ make
$ cd webapp/public/
$ curl -O -L https://github.com/isucon/isucon9-qualify/releases/download/v2/initial.zip
$ unzip initial.zip
$ mv v3_initial_data upload
※ サーバー上(app-01)でやる場合は権限isuconにしておく / 画像アップロードでエラーになる
$ chwon -R isucon:isucon upload
## ansible
※ ssh app-01でアクセスできるようにしておく
$ cd provisioning
$ vim inventory/hosts
[webapp]
app-01
$ ansible-playbook webapp.yml -i inventory/hosts
$ sudo vim /etc/hosts
$ xxx.xxx.xxx.xxx isucon9.catatsuy.org
# Api
instanceはAppと同じ
* ssh api-01でアクセスできるようにしておく
$ cd provisioning
$ vim inventory/hosts
[dev]
api-01
$ ansible-playbook dev.yml -i inventory/hosts
$ sudo vim /etc/hosts
$ xxx.xxx.xxx.xxx isucon9.catatsuy.org
xxx.xxx.xxx.xxx payment.isucon9q.catatsuy.org
xxx.xxx.xxx.xxx shipment.isucon9q.catatsuy.org
## api-01
vim /etc/hosts
$ xxx.xxx.xxx.xxx isucon9.catatsuy.org
xxx.xxx.xxx.xxx payment.isucon9q.catatsuy.org
xxx.xxx.xxx.xxx shipment.isucon9q.catatsuy.org
https://gist.github.com/sota1235/a7356a5909af264c1c1c840dd216c98f#%E9%96%8B%E7%99%BA%E7%94%A8shipment%E3%81%8A%E3%82%88%E3%81%B3payment-service%E3%81%AE%E5%88%A9%E7%94%A8%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6
$ vim initialize.json
{
"payment_service_url":"https://payment.isucon9q.catatsuy.org",
"shipment_service_url":"https://shipment.isucon9q.catatsuy.org"
}
$ curl -XPOST http://127.0.0.1:8000/initialize -H 'Content-Type: application/json' -d @initialize.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment