Rabu, 14 Maret 2018

How To Proceed Parse Server Dashboard Running Or Initiatory Of All At Organization Boot

Parse-Dashboard-

By-Default parse dashboard industrial plant until your final is active, in i lawsuit your connectedness intermission parse dashboard volition non endure available.
We tin move ii methods to proceed dashboard running always.

Method 1- Use nohup command.


Step 1- move nohup ascendence amongst parse dashboard
 Use nohup command to proceed running parse dashboard inwards the background. move the ascendence below.
Go to the parse dashboard directory-
 root@Server16: #  cd /opt/parse-dashboard
use nohup "parse command" &


root@Server16:/opt/parse-dashboard# nohup parse-dashboard --config parse-dashboard-config.json --allowInsecureHTTP imitation &

nohup ascendence volition proceed running parse dashboard inwards the background


Step 2- setup this ascendence to run at organization boot.
above ascendence volition aid us to run parse dashboard inwards the background but inwards illustration our server gets the reboot or crashed due to ability failure or other reason. In such case, nosotros postulate to brand certain to run our parse dashboard at organization kick up. follow the steps below to run dashboard at organization boot.

open in addition to edit rc.local file
root@Server16: # vi /etc/rc.local
Append the parse dashboard path in addition to then ascendence to offset parse dashboard. Add the ruby-red highlighted trace of piece of occupation to your rc.local, brand certain y'all are adding both the trace of piece of occupation earlier exit 0.
# In gild to enable or disable this script only alter the execution # bits. # # By default this script does nothing. #path of parse dashboard cd /opt/parse-dashboard # Command to offset parse dashboard inwards the backgroupnd nohup parse-dashboard --config parse-dashboard-config.json --allowInsecureHTTP imitation & exit 0 
Your file should endure similar to a higher identify inwards the screenshot

Method 2- Use PM2 npm module to offset parse dashboard.

We can  PM2 ascendence to start, halt in addition to banking concern fit the condition of parse dashboard. The wages is nosotros tin stop, offset in addition to banking concern fit the condition of our dashboard anytime. Follow the steps below to brand PM2 ascendence available inwards your environment.
Step 1- Install PM2
To install PM2 on your Linux machine move ascendence below.
sudo npm install -g pm2
Once pm2 installed, 
Step 2- Create parse-dashboard.json file.
create a script to brand parse dashboard available globally at Linux shell.
Create a parse-dashboard.json file using vim editor.
root@Server16: # vi parse-dashboard.json
Append the follow lines in addition to alter the highlighted trace of piece of occupation amongst your path
{   "apps" : [{     "name"        : "parse-dashboard-wrapper",     "script"      : "/usr/bin/parse-dashboard",     "watch"       : true,     "merge_logs"  : true,     "cwd"         : "/opt/parse-dashboard",     "args"         : "--config /opt/parse-dashboard/parse-dashboard-config.json --allowInsecureHTTP=1"   }] } 
Save in addition to driblet dead from the editor.
Step 3- Start parse dashboard.
root@Server16: # pm2 offset parse-deshboard.json
Parse dashboard is upward in addition to running.
Step 4- Check status:
root@Server16: # pm2 condition parse-deshboard.json
Step 4-Check condition of specific pm2 ID
To banking concern fit the item of ascendence move ID of running app
root@Server16: # pm2 demonstrate 0
In the screenshot below y'all volition detect Script path in addition to executed command.

Step 5- Mark pm2 ascendence execute during organization boot.
Your application volition endure available until the system is upward in i lawsuit your organization kick upward y'all in i lawsuit again postulate to run this ascendence to brand available your dashboard.
Let's laid upward our ascendence to execute during organization boot.
open in addition to edit rc.local file
root@Server16: # vi /etc/rc.local
Add the next trace of piece of occupation earlier exit 0 line
# bits. # # By default this script does nothing. #Start parse dashboard at organization kick upward pm2 offset /home/amar/parse-deshboard.json exit 0  
Save in addition to driblet dead from the file.

Now, your parse dashboard volition endure available if your organization gets the reboot.



Sumber https://linuxhowtoguide.blogspot.com/

Tidak ada komentar:

Posting Komentar