pm2에서 프로그램 실행시 인자 전달

2023-03-22

pm2 에서는 순서가 안맞으면 이상하기 떄문에 아래와 같이 해줘야 합니다.

pm2 start index.js --name [name] -- [arg1] -> name이라는 이름으로 arg1의 인자를 가지고 index.js를 실행!!!!!

아래는 예시 입니다.

mqtt 서버

pm2 start ~/iiot_mqtt_client_gateway/index.js --name iiot_mqtt_client_gateway[publish] -- publish
pm2 start ~/iiot_mqtt_client_gateway/index.js --name iiot_mqtt_client_gateway[subscribe] -- subscribe
pm2 start ~/iiot_mockup_service/app.js --name iiot_mockup_service

core 서버

pm2 start ~/iiot/iiot_core/mobius.js --name iiot_core
pm2 start ~/iiot/iiot_dms/index.js --name iiot_dms
pm2 start ~/iiot/iiot_logcollector/index.js --name iiot_logcollector
pm2 start ~/iiot/iiot_scheduler/index.js --name iiot_scheduler
pm2 start ~/iiot/iiot_sender/index.js --name iiot_sender

results matching ""

    No results matching ""

    99 other / uml

    04 react / JSX