Uptime

install

sudo dnf update -y
mkdir local && cd local/
wget https://nodejs.org/dist/v6.11.3/node-v6.11.3-linux-x64.tar.xz
tar xvf node-v6.11.3-linux-x64.tar.xz
ln -s node-v6.11.3-linux-x64 node
sudo yum groupinstall -y "Development Tools"
sudo yum install git -y
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.4.9.tgz
tar xvfz mongodb-linux-x86_64-amazon-3.4.9.tgz
ln -s mongodb-linux-x86_64-amazon-3.4.9 mongodb
vi ~/.bash_profile
PATH=$PATH:$HOME/.local/bin:$HOME/bin

PATH=$PATH:/home/ec2-user/local/node/bin
PATH=$PATH:/home/ec2-user/local/mongodb/bin
. ~/.bash_profile
mkdir -p ~/local/data
nohup bin/mongod --dbpath /home/ec2-user/local/data &
mongo
use uptime
db.createUser(
   {
     user: "uptime",
     pwd: "uptime",
     roles: [ "readWrite", "dbAdmin" ]
   }
)
npm install -g pm2

uptime

git clone git://github.com/fzaninotto/uptime.git
cd uptime/
npm install
vi config/default.yaml
mongodb:
  server:   localhost
  database: uptime
  user:     uptime
  password: uptime
  connectionString: mongodb://localhost:27017/uptime
cd ~/local/uptime
pm2 start app
pm2 stop app
NODE_ENV=production pm2 start app

ref

What Else?
inflearn react api server -50% 할인쿠폰: 15108-f2af1e086101 buy me a coffee