pm2-hive / pm2-hive.github.io Goto Github PK
View Code? Open in Web Editor NEWDocumentation website for PM2
Home Page: http://pm2.keymetrics.io
License: Other
Documentation website for PM2
Home Page: http://pm2.keymetrics.io
License: Other
In https://github.com/pm2-hive/pm2-hive.github.io/blob/master/docs/features/restart-strategies.md
It seems the --cron-restart
section doesn't have a heading and had its explanation copied from the "Exponential Backoff Restart Delay" section, which seems incorrect.
Hi, I've tried using the pm2 api to restart my app from within itself, but can't get it to work. This is what I have :
pm2.connect(function(err){
pm2.list(function(err,proc){
var procs = new Array();
for(var i=0; i < proc.length; i++){
if(proc[i].name !== 'LabMan_ADMIN'){
procs.push(proc[i]);
//pm2.restart(proc[i]);
}
}
pm2.disconnect();
pm2.restart(procs[0],function(err, proc){
console.error("Error restarting proc");
console.error(err);
console.error(proc);
});
});
});
Clearly I've got something wrong (yes I know that procs[0] is only going to restart 1... Or it would... It was part of my testing.
I tried using the name, the id... nothing seems to work.
Thank you for any help you have!
Hello,
is there a way when I restart my process via the web interface that it then runs a script on the server?
Is there a way of seeing a log of ID in node.js without console?
The docs say that --log (or -l) on the pm2 cli will put both error and out logs in to that file specified after the -l flag. This is true, except it continues to write a second logging file in the default location /home/xxx/.pm2/logs.
This does not happen if you specify -e and -o separately.
Documentation is conflicting:
http://pm2.keymetrics.io/docs/usage/cluster-mode/ states:
The -i or instances option can be:
0/max to spread the app across all CPUs
-1 to spread the app across all CPUs - 1
number to spread the app across number CPUs
http://pm2.keymetrics.io/docs/usage/quick-start/#cheatsheet states
Cluster mode
pm2 start app.js -i 0 # Will start maximum processes with LB depending on available CPUs
pm2 start app.js -i max # Same as above, but deprecated.
Interpreter --/node_modules/pm2/node_modules/.bin/ts-node is NOT AVAILABLE in PATH. (type 'which ----/node_modules/pm2/node_modules/.bin/ts-node' to double check.)
Currently the button stand at the bottom of the left sidebar.
It should be put somewhere else more visible, for example at the bottom of the article.
Currently the heroku integration docs does not show how to setup cluster mode for heroku.
If we specify instances: "max"
in our ecosystem.config.js
file, 8 different instances of process would be deployed. But these 8 CPUs as detected by PM2 are shared and the deployment will fail. The better option is to use instances: process.env.WEB_CONCURRENCY || "max"
.
Hi,
According to this issue, stop-exit-codes
option is not yet merged to the main version. So it should not appear in the documentation.
Please consider hide it until this function is merged to the main branch, or add a tip to notice user to install #development
version to use this feature.
Thanks
The combination doesn't work. If you specify -o and -e to save to "/tmp" for example (as in the case of a RO raspberry pi) while the logging works, if you pm2 save
and reboot, the process won't restart indicating:
Current process list running is not in sync with saved list ... App xxx differs. Type 'pm2 save' to synchronize.
How do folks pm2 log to a tmpfs?
When running
env PATH=$PATH:/usr/local/bin pm2 startup rcd -u webhost --hp /home/webhost
I get
Bad : modifier in $ '/'.
I guess that's due to root shell in FreeBSD is tcsh. So instead of "env" it should be "setenv".
I still don't know what exactly should be achieved by that line since /usr/local/bin is in the system path by default in FreeBSD.
Maybe someone can clarify on this.
If you look at this page: http://pm2.keymetrics.io/docs/usage/pm2-api/ , you can see places where bullet points are not rendered, but instead displayed as inline astrisks, even tho the page is properly formatted here: https://github.com/pm2-hive/pm2-hive.github.io/blob/master/docs/features/pm2-api.md
Using paypal integration with PM2 in On , gives errors, however when i use npm start the integration works fine.
Maybe i am just being blind but what are the default max memory limits?
I can see that a limit can be set: http://pm2.keymetrics.io/docs/usage/process-management/
What I cannot see are the default values are or how to find them anywhere.
I found a broken link on the deployment.md
This is probably a broken link
https://gist.github.com/Protosac/c3fb459b1a942f161f23556f61a67d66
https://github.com/pm2-hive/pm2-hive.github.io/blame/master/docs/features/watch-restart.md#L39
says:
As specified in the Schema:
watch can be a boolean, an array of paths or a string representing a path
but in Schema
https://github.com/pm2-hive/pm2-hive.github.io/blame/master/docs/features/app-declaration.md#L179
it says:
Field Type Example Description watch boolean or [] true enable watch & restart feature, if a file change in the folder or subfolder, your app will get reloaded
I start pm2 as a root, but I start jobs run under another user.
I can't make pm2 autostart to respect this choice under CentOS 7.
Please, provide a step-by-step guide on how to make pm2 be autostarted by root and its job be autostarted by another user.
The problem is that pm2 never saves dumps to user's home dir, but pm2 autostart results into a .service pointing to the user's home dir and thus of course it fails to find the absent files upon startup.
Hey,
I'm using pm2 since some months now and its great for hosting scripts.
I tried to upload a script which uses fs and I got errors that it cant open the path.
I started it with node direct and it worked.
It's my first Raspberry pi (4b, 4GB) with Linux OS (Raspberry pi OS Lite 32-bit) so
Update:
Found out its the dictionary which causes my issue
Node/JavaScript don't find the library because you have to cd in the library and start the script then
Found out because node /home/pi/FTP.../index.js
didn't work but cd /home/pi/FTP...
and node index.js
did
Is there some way to fix this?
At present, HTTPS serving is available and working for the pm2 docs at https://pm2.keymetrics.io/ but the site is served over insecure HTTP by default (http://pm2.keymetrics.io/)
As Firefox/Chrome etc continue to mark more uses of HTTP as insecure (Chrome, Firefox), it would be great if the docs could switch to being HTTPS-only -- eg doing a 301 redirect to HTTPS by default + sending HSTS headers etc.
Since HTTPS is already up and working for you with Let's Encrypt, the change wouldn't be a major one.
I want to show the Logfiles on my Website; But over PHP i can't access/find the files but the path is definitively correct.
Anyone have a suggestion?
i need to run process like : --env production
how can i do this with pm2 Api ( pm2.start(opt ,err))
The PM2 slack channel (http://slack.pm2.io/) should be added on the topbar.
We could use the same badge than in the pm2 README.md
Need to replace "baically" to "basically" , here : https://github.com/pm2-hive/pm2-hive.github.io/blob/master/docs/features/deployment.md
$ sudo apt update
Err:1 http://apt.pm2.io/ubuntu stable InRelease
Could not resolve 'apt.pm2.io'
Hit:2 https://dl.yarnpkg.com/debian stable InRelease
Hit:3 http://mirrors.digitalocean.com/ubuntu focal InRelease
Hit:4 http://mirrors.digitalocean.com/ubuntu focal-updates InRelease
Hit:5 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Hit:6 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Hit:7 https://deb.nodesource.com/node_14.x focal InRelease
Hit:8 http://mirrors.digitalocean.com/ubuntu focal-backports InRelease
Hit:9 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://apt.pm2.io/ubuntu/dists/stable/InRelease Could not resolve 'apt.pm2.io'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Environment:
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Just a heads up that it looks like Disqus has enabled some adverts on your comment form at the bottom of each docs page. E.g.
They've done this without warning before on one of my sites.
Edit: Thought I'd add, just in case: If you purposely enabled them, this is absolutely not a complaint - the PM2 project deserves as much funding as it can get as far as I'm concerned. But if that is the case, Disqus' RPM/CPM is significantly lower than what you'd get from a dev-focused ad network. Though, I'd have guessed that your enterprise revenue would dwarf any possible docs ads revenue.
my Mac info:
macOS Sierra 10.12.5
the message of command print:
[PM2] Init System found: launchd
undefinedReturn code : 3
Im using v-4.5.1
wen i do ( like docs says) :
me@server:~# PORT=3010 pm2 restart my.domain/api --update_env
error: unknown option `--update_env'
me@server:~#
where my.domain/api
is the name of an app runing and managed for pm2.
What's happening folks ?
In the CheatSheet at the end of the quick start page the section on clustering show:
# Cluster mode
pm2 start app.js -i 0 # Will start maximum processes with LB depending on available CPUs
pm2 start app.js -i max # Same as above, but deprecated.
This says that the max argument is deprecated, yet the example in the cluster mode section shows using the max argument. Also the cluster mode page shows using max and makes no mention of this argument being deprecated.
So is max
really deprecated or is that comment a mistake?
I found a link –update-env that links to the address :
http://pm2.keymetrics.io/docs/usage/environment/#while-restarting-reloading-a-process
But i found that this capture is removed from the doc in commit ddd9e18 without commit comment.
Is the feature --update-env
has been removed? or the doc is edited by mistake?
If --update-env
is removed, could i create a PR that removed the dead link from this page? If this capture is removed by mistake, could we revert this commit?
sudo pm2 logrotate -u user
from an account that is not named "user" doesn't do what's expected. For example, if my account name is "pi" and I execute this command, it does the following in lograte.d/:
/home/pi/.pm2/pm2.log /home/pi/.pm2/logs/*.log {
rotate 12
weekly
missingok
notifempty
compress
delaycompress
create 0640 user user
}
Edit this page: http://pm2.keymetrics.io/docs/usage/use-pm2-with-cloud-providers/ (or add a new one)
1/ In the package.json in the preinstall directive, add "npm install pm2 -g"
2/ In the Procfile in the start attribute do "pm2 start ecosystem.config.js"
Done! Much simpler than what is explained there: http://pm2.keymetrics.io/docs/usage/use-pm2-with-cloud-providers/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.