3. BOSHとCloud Foudryのインストール
3
Based on:
Dr Nic’s “Build Your Own Heroku With Open Source Cloud Foundry”
https://github.com/cloudfoundry-community/bosh-cloudfoundry/blob/master/tutorials/
7. Inception Serverのセットアップ(2)
# 新しいInceptionサーバーを起動
$ inception-server deploy
1. AWS
2. OpenStack
Choose your infrastructure: 1
Using provider AWS
Access key: ***********************
Secret key: ********************************
1. *US East (Northern Virginia) Region (us-east-1)
2. US West (Oregon) Region (us-west-2)
3. US West (Northern California) Region (us-west-1)
4. EU (Ireland) Region (eu-west-1)
5. Asia Pacific (Singapore) Region (ap-southeast-1)
6. Asia Pacific (Sydney) Region (ap-southeast-2)
7. Asia Pacific (Tokyo) Region (ap-northeast-1)
8. South America (Sao Paulo) Region (sa-east-1)
Choose AWS region: 7
Confirming: Using AWS/ap-northeast-1
....
注)使用しない Elastic IPが
払い出されているので削除する
10. MicroBOSHのセットアップ(2)
$ bosh-bootstrap deploy
Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
1. AWS (default)
2. Alternate credentials
Choose an auto-detected infrastructure: 1
Using provider AWS
1. *US East (Northern Virginia) Region (us-east-1)
2. US West (Oregon) Region (us-west-2)
3. US West (Northern California) Region (us-west-1)
4. EU (Ireland) Region (eu-west-1)
5. Asia Pacific (Singapore) Region (ap-southeast-1)
6. Asia Pacific (Sydney) Region (ap-southeast-2)
7. Asia Pacific (Tokyo) Region (ap-northeast-1)
8. South America (Sao Paulo) Region (sa-east-1)
Choose AWS region: 7
Confirming: Using AWS/ap-northeast-1
...
11. MicroBOSHのセットアップ(3)
# bosh-bootstrap deploy の実行結果の続き
# 最後から3行目に表示される IP アドレスが MicroBOSH のIPアドレスとなる
...
WARNING! Your target has been changed to `https://203.0.113.1:25555'!
Deployment set to
'/home/ubuntu/.microbosh/deployments/firstbosh/micro_bosh.yml‘
Deployed `firstbosh/micro_bosh.yml' to `https://firstbosh:25555', took
00:19:34 to complete
# MicroBOSH をターゲットする
$ bosh target https://203.0.113.1:25555
Target set to `firstbosh‘
Your username: admin
Enter password: admin
Logged in as `admin'
14. Cloud Foundryのセットアップ(3)
$ bosh create cf --ip 203.0.113.2 --security-group cf
Fetching bosh information OK
CPI: aws
DNS mapping: 203.0.113.2.xip.io --> ["203.0.113.2"]
Deployment name: cf-1377155859
Deployment size: medium
Persistent disk: 4096
Security group: cf
Validating deployment size OK
Resolve DNS OK
Resolve DNS 'api.203.0.113.2.xip.io' to IP '203.0.113.2' OK
`api.203.0.113.2.xip.io' maps to 203.0.113.2
Resolve DNS OK
Resolve DNS 'demoapp.203.0.113.2.xip.io' to IP '203.0.113.2' OK
`demoapp.203.0.113.2.xip.io' maps to 203.0.113.2
Security group cf exists with ports 22, 80, 443, 4222 (type 'yes' to continue): yes
Creating Cloud Foundry (type 'yes' to continue): yes
Checking/creating /home/ubuntu/deployments/cf for deployment files OK
Creating deployment file /home/ubuntu/deployments/cf/cf-1377155859.yml OK
Deployment set to `/home/ubuntu/deployments/cf/cf-1377155859.yml'
Getting deployment properties from director...
Unable to get properties list from director, trying without it...
Compiling deployment manifest...
Cannot get current deployment information from director, possibly a new deployment
Please review all changes carefully
Deploying `cf-1377155859.yml' to `firstbosh' (type 'yes' to continue): yes
...
15. Cloud Foundryのセットアップ(4)
# デプロイされた VM の確認
$ bosh vms
...
+-----------+---------+---------------+-----------------------------+
| Job/index | State | Resource Pool | IPs |
+-----------+---------+---------------+-----------------------------+
| api/0 | running | small | 10.122.54.35, 203.0.113.2 |
| core/0 | running | small | 10.121.11.212 |
| data/0 | running | small | 10.121.14.213 |
| dea/0 | running | small | 10.122.29.169 |
+-----------+---------+---------------+-----------------------------+
VMs total: 4
# CFの設定値を確認
# common_password が admin ユーザのパスワードになる
$ bosh show cf attributes
Fetching bosh information OK
Immutable attributes:
common_password: e80011989a71
deployment_size: medium
name: cf-1377155859
Mutable (changable) attributes:
ip_addresses: ["203.0.113.2"]
persistent_disk: 4096
security_group: cf
dns: 203.0.113.2.xip.io
16. Cloud Foundryのセットアップ(5)
# cf コマンドのインストール
# 今回インストールされるCFは 5.x に対応していないので 4.2.8
$ gem install cf –v 4.2.8
# デフォルトのターゲットは xip.io で設定されている
# 例)api.203.0.113.2.xip.io
$ cf target api.203.0.113.2.xip.io
# admin ユーザでログイン
# パスワードは前頁参照
$ cf login admin
target: http://api.203.0.113.2.xip.io
Password> e80011989a71
Authenticating... OK
There are no spaces. You may want to create one with create-space.... OK