kitty
kitty14mo ago

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

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?
3 Replies
raunioroo
raunioroo14mo ago
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.
Deno AI Helper
Deno AI Helper14mo ago
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.
javi
javi14mo ago
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

Did you find this page helpful?