pm2

How Can I run PM2 with Angular-Cli? - Angular2

妖精的绣舞 提交于 2019-11-30 03:02:53
问题 How can I run: ng serve --prod with pm2? ng serve from angular-cli, Angular2. I'm running on DigitalOcean. I have tried to test with http-server -p 4200 -d false in the dist/ folder after ng build --prod When I request from the domain https://www.unibookkh.com/, i got 404 error: (I've already setup nginx to listen to port 4200. I test with http-server because I think I maybe can run pm2 through this command pm2 start my_app_process.json where my_app_process.json { "apps": [ { "name": "angular

Cluster and Fork mode difference in PM2

烂漫一生 提交于 2019-11-29 19:15:20
I've searched a lot to figure out this question, but I didn't get clear explanation. Is there only one difference thing that clustered app can be scaled out and forked app cannot be? PM2's public site explains Cluster mode can do these feature but no one says about pros of Fork mode (maybe, it can get NODE_APP_INSTANCE variable). I feel like Cluster might be part of Fork because Fork seems like to be used in general. So, I guess Fork means just 'forked process' from the point of PM2 and Cluster means 'forked process that is able to be scaled out'. Then, why should I use Fork mode? The main

liunx下搭建node,pm2环境

北战南征 提交于 2019-11-29 19:04:24
本人服务器系统为 CenterOS 7.5的版本,vm虚出的 本人是把安装目录定在/usr/local 下自己创建了一个node目录(命令: mkdir node)里。完整路径为:/usr/local/node 1.从node官网下载安装包,切记一定要是liunx-64位。本人之前下载的是node-v12.13.1-linux-arm64.tar.gz 安装后./node -v提示不是二进制文件 或者在线下载也可以: wget https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz 2.解压安装 xz -d node-v12.13.1-linux-x64.tar.xz tar -xvf node-v12.13.1-linux-x64.tar 3.进入 node-v12.13.1-linux-x64目录,配置软链接配置 ln -s /usr/local/node/node-v12.13.1/bin/node /usr/local/bin/node ln -s /usr/local/node/node-v12.13.1/bin/npm /usr/local/bin/npm 如果不是第一次安装的话-s 要改为-b ln -b /usr/local/node/node-v12.13.1/bin/node /usr

nodejsNodejs的进程管理工具pm2

笑着哭i 提交于 2019-11-29 15:40:08
生产环境的Nodejs的进程管理工具 https://github.com/Unitech/pm2 pm2 是一个进程管理工具,可以用它来管理你的node进程,并查看node进程的状态,当然也支持性能监控,进程守护,负载均衡等功能。 pm2 是一个带有负载均衡功能的Node应用的进程管理器.当你要把你的独立代码利用全部的服务器上的所有CPU,并保证进程永远都活着,0秒的重载, PM2是一个通用过程管理器,也是一个带有内置Load Balancer的Node.js应用程序的生产运行时。 主要特征: 简单高效的流程管理(启动/停止/重启/删除/显示/监控) 通过自动重启和初始化系统脚本生成,让您的应用始终保持在线状态 集群化Node.js应用程序,无需更改代码以提高性能和可靠性 热重新加载Node.js应用程序,无需额外配置 安装:​ npm install -g pm2 启动进程/应用 pm2 start bin/www 进程/应用重命名 pm2 start app.js --name wb123 添加进程/应用watch pm2 start bin/www --watch 结束进程/应用 pm2 stop www 结束所有进程/应用 pm2 stop all 删除进程/应用 pm2 delete www 删除所有进程/应用 pm2 delete all 列出所有进程/应用 pm2

How to use Grunt/Gulp with pm2?

夙愿已清 提交于 2019-11-29 09:34:19
问题 pm2 is a great tool to manage node apps. How does it work with grunt/glup ? I didn't find any useful clues after Googling for 20 minutes. 回答1: If I understand your question well, it seems you want to deploy your app. Since pm2 0.9 deployment can be done with pm2 deploy see README. In the case of grunt/gulp, I see two options: You've your node_modules comitted. Using pm2 deploy run your gulp process from the post-deploy section: "post-deploy" : "node ./node_modules/gulp/bin/gulp.js ./GulpFile

How to run pm2 so other server users are able to access the process?

烂漫一生 提交于 2019-11-28 20:52:40
问题 When I start my Nodejs app with pm2, other server users are not able to access the process. Even if I start pm2 from a custom directory (not current user's ~/ , what pm2 is using by default): HOME=/var/www pm2 start app.js Directory is accessible by any user (comparing to ~/ , but there's still no way other server user is able to access the process. When other server user does pm2 list , it shows him 0 processes are running – but there are (started by another user). And when other user tries

How to pass arguments to app using pm2?

断了今生、忘了曾经 提交于 2019-11-28 16:29:09
I am using pm2 to start my app but i am not able to pass argument to it. the command I am using is pm2 start app.js -- dev. Though this works with forever. You can do as stated in this ticket: https://github.com/Unitech/pm2/issues/13 Though if you're passing the environment you may want to consider leveraging environment variables. With this you create a variable which can be accessed by any process in that environment with process.env.* . So you have a configuration file config.json : { "dev": { "db": { "hosts":["localhost"], "database": "api" }, "redis": { "hosts": ["localhost"] } },

Cluster and Fork mode difference in PM2

旧城冷巷雨未停 提交于 2019-11-28 14:35:18
问题 I've searched a lot to figure out this question, but I didn't get clear explanation. Is there only one difference thing that clustered app can be scaled out and forked app cannot be? PM2's public site explains Cluster mode can do these feature but no one says about pros of Fork mode (maybe, it can get NODE_APP_INSTANCE variable). I feel like Cluster might be part of Fork because Fork seems like to be used in general. So, I guess Fork means just 'forked process' from the point of PM2 and

微信公众号授权--后端

青春壹個敷衍的年華 提交于 2019-11-28 13:14:43
后台部署 参数 服务器 腾讯 linux 语言 node 部署 pm2 部署流程 ssh远端连接服务器 会经常碰到 Permission denied, please try again. link 注意登录时用得用户名跟自己需要的是否一致 pm2配置 目前而言,pm2需要开发跟生产都需要安装,开发用来部署,生产用来记录日志等 安装 npm i pm2 -S pm2 ecosystem | pm2 init 生成 ecosystem.config.js 配置 ecosystem.config.js ` 发布 pm2 deploy production setup 更新 pm2 deploy production update 微信后台代码 因为需要调用微信的api,因而需要一台服务器,目前可以两种选择。 vue开发环境配置 node 代理(这样也可以请求到想要的数据,但是没有挑战性,同时也不符合微信开发要求) 购买一台公网服务器(下述都是围绕这进行开展的) 微信开发准备 绑定公网 此处需要注意, 端口号需要是 80 ,同时腾讯服务器可以访问到,主要是为了确保腾讯服务器能跟自己的服务器进行正常沟通 api (获取用户信息) 利用前台传入的 code 来换取 token https://api.weixin.qq.com/sns/oauth2/access_token?appid

李宏毅 线性回归预测PM2.5

青春壹個敷衍的年華 提交于 2019-11-28 08:13:22
作业说明   给定训练集train.csv,要求根据前9个小时的空气监测情况预测第10个小时的PM2.5含量。 训练集介绍:   (1):CSV文件,包含台湾丰原地区240天的气象观测资料(取每个月前20天的数据做训练集,12月X20天=240天,每月后10天数据用于测试,对学生不可见);   (2):每天的监测时间点为0时,1时......到23时,共24个时间节点;   (3):每天的检测指标包括CO、NO、PM2.5、PM10等气体浓度,是否降雨、刮风等气象信息,共计18项; (4):数据集 https://github.com/datawhalechina/leeml-notes/blob/master/docs/Homework/HW_1/Dataset 数据处理 【下文中提到的“数据帧”并非指pandas库中的数据结构DataFrame,而是指一个二维的数据包】 根据作业要求可知,需要用到连续9个时间点的气象观测数据,来预测第10个时间点的PM2.5含量。针对每一天来说,其包含的信息维度为(18,24)(18项指标,24个时间节点)。可以将0到8时的数据截 取出来,形成一个维度为(18,9)的数据帧,作为训练数据,将9时的PM2.5含量取出来,作为该训练数据对应的label;同理可取1到9时的数据作为训练用的数据帧,10时的PM2.5含量作为label......以此