본문 바로가기

현재

wsl(windows subsystem for linux)에 pm2 설치 및 환경설정

wsl설치는 검색해서 설정을 했다하고^^

*NVM 및 PM2 설치

  #### nvm 설치 (노드 버전 관리자)

  # curl으로 설치하기

  # > $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.0/install.sh | bash

  # wget으로 설치하기 (local window linux 는 wget으로 성공)

  > $ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

  #### nvm 활성화

  > $ . ~/.nvm/nvm.sh

  #### node.js 설치

  > $ nvm install v9.4.0

  #### node.js 가 설치되었는지 테스트

  > $ node -e "console.log('Running Node.js ' + process.version)"

  #### pm2 설치

  > $ npm install -g pm2@latest

 

* 패키지 업데이트 - 업그레이드 - 자동정리

yhkim@DESKTOP-8SNG3JV:~$ sudo apt -y update

yhkim@DESKTOP-8SNG3JV:~$ sudo apt -y upgrade

yhkim@DESKTOP-8SNG3JV:~$ sudo apt -y autoremove

* jre, jdk, mave 설치

yhkim@DESKTOP-8SNG3JV:~$ sudo apt -y install openjdk-8-jre-headless openjdk-8-jdk-headless maven

*java 버젼확인

yhkim@DESKTOP-8SNG3JV:~$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1ubuntu1-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

*java 위치

yhkim@DESKTOP-8SNG3JV:~$ which java
/usr/bin/java

*windows 마운트위치에서 실행파일 복사

yhkim@DESKTOP-8SNG3JV:/mnt/d/dev$ cp tms.jar /home/yhkim/tms.jar

yhkim@DESKTOP-8SNG3JV:/mnt/d/dev$ cp tmsrun.json /home/yhkim/tmsrun.json

*실행

yhkim@DESKTOP-8SNG3JV:~$ pm2 start tmsrun.json

[PM2][WARN] Applications TMS not running, starting...
[PM2][WARN] Folder does not exist: /home/yhkim/logs
[PM2] Creating folder: /home/yhkim/logs
[PM2] App [TMS] launched (1 instances)
┌────┬────────────────────┬──────────┬──────┬───────────┬──────────┬──────────┐
│ id │ name               │ mode     │ ↺    │ status    │ cpu      │ memory   │
├────┼────────────────────┼──────────┼──────┼───────────┼──────────┼──────────┤
│ 0  │ TMS                │ fork     │ 0    │ online    │ 0%       │ 12.2mb   │
└────┴────────────────────┴──────────┴──────┴───────────┴──────────┴──────────┘