D
Deno

help

Is there any way to run deno as a cluster on one machine? (like pm2)

Kkitty11/3/2023
I plan to service with deno, but PM2 does NOT support deno. Is there any way to run deno as a cluster on one machine?
Rraunioroo11/3/2023
Not too familiar with Pup, but maybe it fits the bill for you? https://github.com/Hexagon/pup
GitHub
GitHub - Hexagon/pup: Universal process manager built in Deno
Universal process manager built in Deno. Contribute to Hexagon/pup development by creating an account on GitHub.
DAHDeno AI Helper11/3/2023
The documentation does not provide a clear answer to your question about running Deno as a cluster on one machine similar to PM2. It's important to note that Deno is designed to be secure and simple, and it doesn't natively support clustering like Node.js does with PM2. However, you might be able to achieve similar results with process management tools or containerization, but this is not explicitly supported or mentioned in the documentation.
Jjavi11/3/2023
Create an ecosystem.config.js file and add the following contents:
// change for your values
module.exports = {
apps: [
{
name: "name",
script: "/path/to/source.ts",
interpreter: "/home/user/.deno/bin/deno",
interpreterArgs: "run -A --unstable",
},
],
};
// change for your values
module.exports = {
apps: [
{
name: "name",
script: "/path/to/source.ts",
interpreter: "/home/user/.deno/bin/deno",
interpreterArgs: "run -A --unstable",
},
],
};
Then run
npx pm2 start ecosystem.config.js
npx pm2 start ecosystem.config.js

Looking for more? Join the community!