Cov txheej txheem:

Pm2 runtime yog dab tsi?
Pm2 runtime yog dab tsi?

Video: Pm2 runtime yog dab tsi?

Video: Pm2 runtime yog dab tsi?
Video: Build MEVN Stack Web App With GraphQL & Deploy | GraphQL, MongoDB, Express.js, Vue.js, Node.js 2024, Kaum ib hlis
Anonim

PM2 Runtime yog Tus Thawj Tswj Txheej Txheem Ntau Lawm rau Node. js daim ntawv thov nrog lub hauv paus Load Balancer. Nws tso cai rau koj ua kom cov ntawv thov muaj sia nyob mus ib txhis, rov rub lawv yam tsis muaj sijhawm poob thiab txhawb nqa Devops kev ua haujlwm tsis tu ncua. Pib koj daim ntawv thov hauv hom ntau lawm yog yooj yim li: pm2 ua pib app.js.

Tib neeg kuj nug, pm2 rau dab tsi?

PM2 yog tus thawj tswj txheej txheem tsim khoom rau Node. js daim ntawv thov nrog ib tug built-in load balancer. Nws tso cai rau koj khaws cov ntawv thov nyob mus ib txhis, rov rub lawv yam tsis muaj kev poob qis thiab pab txhawb kev ua haujlwm ntawm cov haujlwm ua haujlwm.

Ib yam li ntawd, puas yog pm2 pib pib dua? Yog, nws ua qhov no los ntawm lub neej ntawd thiab muaj txawm tias muaj kev xaiv saib rau rov pib dua ntawm kev hloov.

Ua li no, koj ua li cas pm2?

Pib ib txheej txheem:

  1. pm2 pib app.js --name "my-api" pm2 pib web.js --name "web-interface"
  2. pm2 nres web-interface.
  3. pm2 restart web-interface.
  4. pm2 rho tawm web-interface.
  5. pm2 rov pib dua /http-[1, 2]/
  6. pm2 list # Los yog pm2 [list|ls|l|status]
  7. pm2 pom 0.

Qhov twg yog pm2 ntsia?

Thaum koj nruab PM2 (npm nruab -g pm2 ua ), nws tsim lub neej ntawd PM2 home folder (hauv C:Users. pm2 ua ) uas yuav khaws cia PM2 cov ntaub ntawv cuam tshuam, zoo li cov cav (yog, tib yam koj pom khiav pm2 ua log), txheej txheem pid lossis cov pob tseg uas tsim thaum koj khiav pm2 ua cawm.

Pom zoo: