LoginSignup
0
1

More than 5 years have passed since last update.

Parse Serverの死活管理と設定変更したらすぐ自動で反映されるようにする

Last updated at Posted at 2017-01-18

目的

自前でParse Serverを運用しているが、変なクエリでAPI叩くとすぐ落ちるので自動で再起動したい。
Parse Serverのconfigを変更するとParse Serverが再起動して適用されるようにしたい。
手早くParse Serverのインスタンスを追加したい。
モニタリングしたい。

事前準備

npm install -g parse-server parse-dashboard pm2

configのサンプル

使い方

parse-configs/parse_example.jsonを参考にして、キーなどを設定したjsonを作る。

参考: https://github.com/parse-community/parse-server#configuration

parse-dashboard-config.jsonを書き換える。

参考: https://github.com/parse-community/parse-dashboard

pm2_config.jsonを書き換える。

参考: http://pm2.keymetrics.io/docs/usage/application-declaration/

"watch_options": {
    "usePolling": true
}

をしないと、parse-configs/parse_example.jsonのようにディレクトリの中にあるようなファイルをwatchできない?
parse-dashboard-config.jsonusePolling: falseでもwatchできる。

起動とかのよく使うコマンド

pm2 start pm2_config.json
pm2 delete all
pm2 restart all
pm2 kill

MongoDB

pm2でMongoDBもモニタリングしたければ、

pm2 install pm2-mongodb

参考: https://github.com/pm2-hive/pm2-mongodb

MongoDBのポートなどがデフォルトなら何も設定しなくてもいい。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1