Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to keep dashboard running? #315

Closed
guilhermevini opened this issue May 3, 2016 · 6 comments
Closed

How to keep dashboard running? #315

guilhermevini opened this issue May 3, 2016 · 6 comments

Comments

@guilhermevini
Copy link

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?

@rickvdl
Copy link

rickvdl commented May 3, 2016

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.

Source: https://www.digitalocean.com/community/tutorials/how-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04

@guilhermevini
Copy link
Author

It worked! Thanks buddy!

@jinuem
Copy link

jinuem commented Apr 26, 2017

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?

@guilhermevini
Copy link
Author

It is not mandatory, you can use whatever technology you prefer.

@jinuem
Copy link

jinuem commented Apr 26, 2017

Thank you!

@calinpastean
Copy link

calinpastean commented Apr 27, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants