tmp
Showing posts with label
OpenShift
.
Show all posts
Showing posts with label
OpenShift
.
Show all posts
Thursday, September 24, 2015
OpenShift memo
###ストレージがすでにやばい ストレージの利用率を見てみる ```bash $ rhc app show
--gears quota Gear Cartridges Used Limit ------------------------ ------------------------------------- ------ ----- xxxxx nodejs-0.10 mongodb-2.4 rockmongo-1.1 0.8 GB 1 GB ``` データほとんど置いてないのにすでに80% sshして占有しているファイルを確認してみる ```bash > du -h * | sort -rh | head 481M mongodb/data 481M mongodb 384M mongodb/data/journal 134M app-root 84M app-root/runtime 84M app-deployments/2015-09-23_09-23-22.613 84M app-deployments 75M app-root/runtime/repo 75M app-deployments/2015-09-23_09-23-22.613/repo 56M app-root/runtime/repo/client/assets/img ``` `mongodb/data/journal` がでかすぎる mongodbの設定を確認 ```bash > grep small ~/mongodb/conf/mongodb.conf smallfiles = true ``` `smallfiles` が有効になっているのでこれでも少ない方(128M \* 3) (無効の場合は 1G \* 3) 溢れそうなら nojournal にする予定 ###npm install を `--production` で実行させる 環境変数 `NPM_CONFIG_PRODUCTION` を設定する ``` $ rhc env set NPM_CONFIG_PRODUCTION=true -a
```
Tuesday, September 22, 2015
OpenShift Client Tools (RHC)
###install rhc ```bash $ sudo gem install rhc ``` ###setup ```bash rhc setup ``` ###アプリの情報を参照 ```bash $ rhc app show
appname @ http://appname-fiahfy.rhcloud.com/ (uuid: xxxxx) ----------------------------------------------------------------------------- Domain: fiahfy Created: Sep 21 9:49 PM Gears: 1 (defaults to small) Git URL: ssh://xxxxx@appname-fiahfy.rhcloud.com/~/git/lovaapi.git/ SSH: xxxxx@appname-fiahfy.rhcloud.com Deployment: auto (on git push) nodejs-0.10 (Node.js 0.10) -------------------------- Gears: Located with mongodb-2.4, rockmongo-1.1 mongodb-2.4 (MongoDB 2.4) ------------------------- Gears: Located with nodejs-0.10, rockmongo-1.1 Connection URL: mongodb://$OPENSHIFT_MONGODB_DB_HOST:$OPENSHIFT_MONGODB_DB_PORT/ Database Name: appname Password: yyyyy Username: zzzzz rockmongo-1.1 (RockMongo 1.1) ----------------------------- Gears: Located with nodejs-0.10, mongodb-2.4 Connection URL: https://appname-fiahfy.rhcloud.com/rockmongo/ ``` ###ストレージ占有率確認 ```bash $ rhc app show
--gears quota Gear Cartridges Used Limit ------------------------ ------------------------------------- ------ ----- xxxxxxxxxxxxxxxxxxxxxxxxxxxx nodejs-0.10 mongodb-2.4 rockmongo-1.1 0.8 GB 1 GB ``` ###アプリのあるサーバにログイン ```bash $ ssh xxxxx@appname-fiahfy.rhcloud.com # rhc app show の SSH の項目 ``` ###アプリのポートフォワード ```bash $ rhc port-forward
Checking available ports ... done Forwarding ports ... Address already in use - bind(2) for "127.0.0.1" port 8080 while forwarding port 8080. Trying local port 8081 To connect to a service running on OpenShift, use the Local address Service Local OpenShift ------- --------------- ---- ----------------- httpd 127.0.0.1:8080 => 127.7.248.3:8080 mongodb 127.0.0.1:27017 => 127.7.248.2:27017 node 127.0.0.1:8081 => 127.7.248.1:8080 Press CTRL-C to terminate port forwarding ``` ##参考 *
*
Older Posts
Home
Subscribe to:
Posts (Atom)