This is my run command:
~# parse-dashboard --config parse-dashboard-config.json --allowInsecureHTTP=1
Can i make this run as a service or something like that?
You could use PM2, just install it globally by running sudo npm install -g pm2.
Then, assuming that you also have parse-dashboard installed globally, you can create a so called ecosystem.json file.
Here is an example ecosystem.json file
{
"apps" : [{
"name" : "parse-dashboard-wrapper",
"script" : "/usr/bin/parse-dashboard",
"watch" : true,
"merge_logs" : true,
"cwd" : "/home/parse/parse-dashboard",
"args" : "--config /home/parse/parse-dashboard/config.json --allowInsecureHTTP=1"
}]
}
I have used a config file in the arguments, but you could also set the ENV variables directly, by adding a "ENV" array.
To start it, run pm2 start ecosystem.json, you should now see something like this:
parse@api:~/parse-dashboard$ pm2 start ecosystem.json
[PM2] Applying action restartProcessId on app [parse-dashboard-wrapper](ids: 1)
[PM2] [parse-dashboard-wrapper](1) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโฌโโโโโโโฌโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ mode โ pid โ status โ restart โ uptime โ memory โ watching โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโผโโโโโโโผโโโโโโโผโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโค
โ parse-server-wrapper โ 0 โ fork โ 1230 โ online โ 0 โ 2D โ 59.738 MB โ enabled โ
โ parse-dashboard-wrapper โ 1 โ fork โ 2526 โ online โ 0 โ 0s โ 12.602 MB โ enabled โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโดโโโโโโโดโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโ
Use `pm2 show <id|name>` to get more details about an app
As you can see, I also have the parse-server itself running, but your output should be similar.
Now to view more info, run pm2 show {ID}, and in order to view the logs you can run pm2 logs {ID}.
When you reboot your server, this entry will be gone, so to save the service, run pm2 save, so you can always start / stop / reboot parse-dashboard.
If you would like to run the dashboard at startup you can (logged in as root) create startup scripts by running sudo pm2 startup ubuntu -u parse --hp /home/parse/, the -u parse tells the script to run as user parse, off course you should change this according to your setup.
You can always run pm2 status to see what's going on.
Hope this helped you, good luck.
It worked! Thanks buddy!
I have forever installed. Its also same thing runs the script continuously. I am using forever to run parse server up.
Can i use same forever or do i need pm2 mandatory to run this dashboard?
It is not mandatory, you can use whatever technology you prefer.
Thank you!
Has anyone had this issue before? I am trying to run parse dashboard by running pm2 start process.json (file below), but it shows up in pm2 list with an errored status. Checking the logs I only get Error: spawn node ENOENT. I can run the dashboard fine in the background by running parse-dashboard --config config.json --allowInsecureHTTP &
{
"apps" : [{
"name" : "Dashboard",
"script" : "/usr/local/bin/parse-dashboard",
"watch" : true,
"merge_logs" : true,
"cwd" : "~/parse-dashboard/",
"args" : "--config ~/parse-dashboard/config.json --allowInsecureHTTP"
}]
}
I am non-securely running everything on a remote machine as root
Most helpful comment
You could use PM2, just install it globally by running
sudo npm install -g pm2.Then, assuming that you also have parse-dashboard installed globally, you can create a so called
ecosystem.jsonfile.Here is an example
ecosystem.jsonfileI have used a config file in the arguments, but you could also set the ENV variables directly, by adding a
"ENV"array.To start it, run
pm2 start ecosystem.json, you should now see something like this:As you can see, I also have the parse-server itself running, but your output should be similar.
Now to view more info, run
pm2 show {ID}, and in order to view the logs you canrun pm2 logs {ID}.When you reboot your server, this entry will be gone, so to save the service, run
pm2 save, so you can always start / stop / reboot parse-dashboard.If you would like to run the dashboard at startup you can (logged in as root) create startup scripts by running
sudo pm2 startup ubuntu -u parse --hp /home/parse/, the-u parsetells the script to run as user parse, off course you should change this according to your setup.You can always run
pm2 statusto see what's going on.Hope this helped you, good luck.
Source: https://www.digitalocean.com/community/tutorials/how-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04