当前位置: 首页 > news >正文

做视频剪辑接私活的网站加盟培训网站建设

做视频剪辑接私活的网站,加盟培训网站建设,小说网站开发数据库,一个公司建设网站Node-RED 介绍Node-RED 是一种基于流程的编程工具由 IBM 的新兴技术服务团队原创开发Node-RED 是一种事件触发工具#xff0c;和 StackStorm 类似, 可以归类为上层的自动化工具#xff0c;可以用来触发与之相对应的下层自动化工具#xff0c;比如 ansible#xff0c;来更加…Node-RED 介绍Node-RED 是一种基于流程的编程工具由 IBM 的新兴技术服务团队原创开发Node-RED 是一种事件触发工具和 StackStorm 类似, 可以归类为上层的自动化工具可以用来触发与之相对应的下层自动化工具比如 ansible来更加优化的完成自动化任务。Node-RED 环境我们首先需要明白 Node-RED 是基于Node.js来运行的。我们可以使用 Web 浏览器来访问到流程编辑器。我们可以使用拖拽和连线的方式来创建应用也就是将所需的节点从面板拖拽到工作区中然后用连接这些节点到一起。通过一键部署方式可以自动将已经创建好的应用部署和运行。Node-RED 安装 之前 - 在 CentOS 中安装Node.js添加 node.js yum repository首先我们需要将 node.js 的 yum repository 添加到我们的系统中它来源于nodejs的官方网站。当前 LTS 版本是版本 14。Index of /download/release/latest-v14.x/​nodejs.org如果您想安装版本 8只需在下面的命令中更改setup_14 到 setup_8 x。[alickdevnet ~]# curl -sL https://rpm.nodesource.com/setup_14.x | sudo -E bash -其他组件如下## You may also need development tools to build native addons: [alickdevnet ~]# sudo yum install -y gcc-c make## To install the Yarn package manager, run: [alickdevnet ~]# curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo [alickdevnet ~]# sudo yum install yarn安装 node.js 和 NPM查看将要安装的版本[alickdevnet ~]# sudo yum list available nodejs Loaded plugins: fastestmirror, langpacks Repository epel is listed more than once in the configuration Repository epel-debuginfo is listed more than once in the configuration Repository epel-source is listed more than once in the configuration Loading mirror speeds from cached hostfile Available Packages nodejs.x86_64 2:14.5.0-1nodesource 然后安装 node.js 包和 NPM 包运行以下命令执行此操作。## Run sudo yum install -y nodejs to install Node.js 14.x and npm. [alickdevnet ~]# sudo yum install -y nodejs如果你装错了版本或者你要从旧版本升级你可以使用如下的命令[alickdevnet ~]# rm -f /etc/yum.repos.d/nodesource-el* [alickdevnet ~]# curl -sL https://rpm.nodesource.com/setup_14.x | bash - [alickdevnet ~]# sudo yum install -y nodejs查看 node.js 和 npm 版本使用如下命令来查看 node 和 npm 的版本[alickdevnet ~]# node -v v14.5.0[alickdevnet ~]# npm -v 6.14.5使用简单的 javascript 代码来测试安装环境我们创建一个文件 devnet.js其中 192.168.100.100 你可以改为你 centos 的 ip 地址12345 可以改为你需要访问的端口。[alickdevnet ~]# cat devnet.js var http require(http); http.createServer(function (req, res) {res.writeHead(200, {Content-Type: text/plain});res.end(Welcome to DevNet SG); }).listen(12345, 192.168.100.100); console.log(Server running at http://192.168.100.100:12345/);然后使用下面的代码来运行[alickdevnet ~]# node --inspect devnet.js Debugger listening on ws://127.0.0.1:9229/b7c74321-a226-4bcb-9e1d-bc0e1c90379d For help, see: https://nodejs.org/en/docs/inspector Server running at http://192.168.100.100:12345/可以在浏览器中访问运行成功Node-RED 正式安装这个时候 node.js 的环境已经安装完成下面将开始安装 Node-RED直接执行下面命令即可[alickdevnet ~]# sudo npm install -g node-red然后我们运行 node-red 可以看到一些输出信息[alickdevnet ~]# node-red 9 Jul 18:34:12 - [info] Welcome to Node-RED 9 Jul 18:34:12 - [info] Node-RED version: v1.1.1 9 Jul 18:34:12 - [info] Node.js version: v14.5.0 9 Jul 18:34:12 - [info] Linux 3.10.0-1062.el7.x86_64 x64 LE 9 Jul 18:34:12 - [info] Loading palette nodes 9 Jul 18:34:13 - [info] Settings file : /root/.node-red/settings.js 9 Jul 18:34:13 - [info] Context store : default [modulememory] 9 Jul 18:34:13 - [info] User directory : /root/.node-red 9 Jul 18:34:13 - [warn] Projects disabled : editorTheme.projects.enabledfalse 9 Jul 18:34:13 - [info] Flows file : /root/.node-red/flows_Al-TERAFORM-CENTOS-1.json 9 Jul 18:34:13 - [info] Creating new flow file 9 Jul 18:34:13 - [warn] --------------------------------------------------------------------- Your flow credentials file is encrypted using a system-generated key.If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials.You should set your own key using the credentialSecret option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change. ---------------------------------------------------------------------9 Jul 18:34:13 - [info] Server now running at http://127.0.0.1:1880/ 9 Jul 18:34:13 - [info] Starting flows 9 Jul 18:34:13 - [info] Started flowsPM2是Node.js的进程管理工具利用它可以非常容易地实现开机应用自动启动以及必要时自动启动的功能。然后我们可以使用 pm2 来守护进程[alickdevnet ~]# sudo npm install -g pm2然后我们启动 node-red[alickdevnet ~]# pm2 start node-red-------------__/____/____________/____/______//_/________/______/_______/_///____///_///______//___//__//_/___________//____//____/_____/________///______/_____________/____///_____/_____///_________/_____________/_____________/___//____________/_____________/_____________/__/__///______________///______________///__///__Runtime EditionPM2 is a Production Process Manager for Node.js applicationswith a built-in Load Balancer.Start and Daemonize any application:$ pm2 start app.jsLoad Balance 4 instances of api.js:$ pm2 start api.js -i 4Monitor in production:$ pm2 monitorMake pm2 auto-boot at server restart:$ pm2 startupTo go further checkout:http://pm2.io/-------------[PM2] Spawning PM2 daemon with pm2_home/root/.pm2 [PM2] PM2 Successfully daemonized [PM2] Starting /usr/bin/node-red in fork_mode (1 instance) [PM2] Done. ┌─────┬─────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ ├─────┼─────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ │ 0 │ node-red │ default │ N/A │ fork │ 24229 │ 0s │ 0 │ online │ 0% │ 13.5mb │ root │ disabled │ └─────┴─────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘然后我们重启所有 ProcessId[alickdevnet ~]# pm2 restart all Use --update-env to update environment variables [PM2] Applying action restartProcessId on app [all](ids: [ 0 ]) [PM2] [node-red](0) ✓ ┌─────┬─────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ ├─────┼─────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ │ 0 │ node-red │ default │ N/A │ fork │ 24257 │ 0s │ 1 │ online │ 0% │ 13.2mb │ root │ disabled │ └─────┴─────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘我们可以查看 node-red 相关系统信息如下[alickdevnet ~]# pm2 info node-redDescribing process with id 0 - name node-red ┌───────────────────┬────────────────────────────────────┐ │ status │ online │ │ name │ node-red │ │ namespace │ default │ │ version │ N/A │ │ restarts │ 1 │ │ uptime │ 64s │ │ script path │ /usr/bin/node-red │ │ script args │ N/A │ │ error log path │ /root/.pm2/logs/node-red-error.log │ │ out log path │ /root/.pm2/logs/node-red-out.log │ │ pid path │ /root/.pm2/pids/node-red-0.pid │ │ interpreter │ node │ │ interpreter args │ N/A │ │ script id │ 0 │ │ exec cwd │ /root │ │ exec mode │ fork_mode │ │ node.js version │ 14.5.0 │ │ node env │ N/A │ │ watch reload │ ✘ │ │ unstable restarts │ 0 │ │ created at │ 2020-07-09T10:38:40.795Z │ └───────────────────┴────────────────────────────────────┘Actions available ┌────────────────────────┐ │ km:heapdump │ │ km:cpu:profiling:start │ │ km:cpu:profiling:stop │ │ km:heap:sampling:start │ │ km:heap:sampling:stop │ └────────────────────────┘Trigger via: pm2 trigger node-red action_nameCode metrics value ┌────────────────────────┬───────────┐ │ Heap Size │ 26.41 MiB │ │ Heap Usage │ 93.64 % │ │ Used Heap Size │ 24.73 MiB │ │ Active requests │ 0 │ │ Active handles │ 4 │ │ Event Loop Latency │ 0.45 ms │ │ Event Loop Latency p95 │ 1.55 ms │ └────────────────────────┴───────────┘Divergent env variables from local env Add your own code metrics: http://bit.ly/code-metricsUse pm2 logs node-red [--lines 1000] to display logsUse pm2 env 0 to display environment variablesUse pm2 monit to monitor CPU and Memory usage node-red我们可以查看 node-red 相关日志信息如下[alickdevnet ~]# pm2 logs node-red [TAILING] Tailing last 15 lines for [node-red] process (change the value with --lines option) /root/.pm2/logs/node-red-error.log last 15 lines: /root/.pm2/logs/node-red-out.log last 15 lines: 0|node-red | --------------------------------------------------------------------- 0|node-red | Your flow credentials file is encrypted using a system-generated key. 0|node-red | 0|node-red | If the system-generated key is lost for any reason, your credentials 0|node-red | file will not be recoverable, you will have to delete it and re-enter 0|node-red | your credentials. 0|node-red | 0|node-red | You should set your own key using the credentialSecret option in 0|node-red | your settings file. Node-RED will then re-encrypt your credentials 0|node-red | file using your chosen key the next time you deploy a change. 0|node-red | --------------------------------------------------------------------- 0|node-red | 0|node-red | 9 Jul 18:38:45 - [info] Starting flows 0|node-red | 9 Jul 18:38:45 - [info] Started flows 0|node-red | 9 Jul 18:38:45 - [info] Server now running at http://127.0.0.1:1880/我们保存现在的 process 信息然后设置为开机启动[alickdevnet ~]# pm2 save [PM2] Saving current process list... [PM2] Successfully saved in /root/.pm2/dump.pm2[alickdevnet ~]# pm2 startup [PM2] Init System found: systemd Platform systemd Template [Unit] DescriptionPM2 process manager Documentationhttps://pm2.keymetrics.io/ Afternetwork.target[Service] Typeforking Userroot LimitNOFILEinfinity LimitNPROCinfinity LimitCOREinfinity EnvironmentPATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin EnvironmentPM2_HOME/root/.pm2 PIDFile/root/.pm2/pm2.pid Restarton-failureExecStart/usr/lib/node_modules/pm2/bin/pm2 resurrect ExecReload/usr/lib/node_modules/pm2/bin/pm2 reload all ExecStop/usr/lib/node_modules/pm2/bin/pm2 kill[Install] WantedBymulti-user.targetTarget path /etc/systemd/system/pm2-root.service Command list [ systemctl enable pm2-root ] [PM2] Writing init configuration in /etc/systemd/system/pm2-root.service [PM2] Making script booting at startup... [PM2] [-] Executing: systemctl enable pm2-root... Created symlink from /etc/systemd/system/multi-user.target.wants/pm2-root.service to /etc/systemd/system/pm2-root.service. [PM2] [v] Command successfully executed. --------------------------------------- [PM2] Freeze a process list on reboot via: $ pm2 save[PM2] Remove init script via: $ pm2 unstartup systemd访问浏览器界面我们可以通过 1880 端口来正常访问 Node-RED 了。访问的链接为 http://{Node-RED-machine-ip-address}:1880到这里通过这篇详细的教程相信大家已经了解如何安装 Node-RED 了欢迎关注我们将继续分享和深入学习。
http://www.zqtcl.cn/news/241675/

相关文章:

  • 河南便宜网站建设价格wordpress页面图片插件
  • 网站生成wordwordpress汽车主题公园
  • 网络营销成功的案例及其原因湖南网站seo地址
  • 潍坊企业网站模板绩效考核表 网站建设
  • 建设企业网站公做深度游网站 知乎
  • 可以做h5的网站韶关网站建设制作
  • 企业网站建设的基本要素有哪些通知模板范文
  • 网站建设计划书范本住房和城乡建设部网站事故快报
  • 西安网站建设公司排家居用品东莞网站建设
  • 网站建设评比文章上海手机网站建设价格
  • 微信手机网站三合一建筑工程网络计划方法
  • 网站上文章分享的代码怎么做的建在线教育网站需要多少钱
  • 如何自己弄网站怎么用手机做网站服务器
  • 如果我的网站被百度收录了_以后如何做更新争取更多收录有做不锈钢工程的网站
  • 适合做公司网站的cms东莞阳光网站投诉平台
  • 建设一个网站的意义印刷东莞网站建设技术支持
  • 80端口被封怎么做网站个人网站做支付接口
  • 如何区分网站开发语言建设网站地图素材
  • 建网站的流程怎么投稿各大媒体网站
  • 品牌推广的步骤和技巧专业seo培训学校
  • 新网站上线怎么做seo网站建设语言什么语言
  • 山东省住房城乡和建设厅网站黄页网站推广下载免费
  • 网站建设与运营的论文的范本百度秒收录蜘蛛池
  • asp.net做音乐网站wordpress伪静态规则iis
  • seo 网站优化2021给个最新网站
  • 做废铝的关注哪个网站好seo推广优化的方法
  • 广州活动网站设计电影网站建设策划书
  • 4a景区网站建设标准网站建设排名优化公司
  • 闲置服务器做网站简单做图网站
  • 网站建设制作软件叫啥网盟推广是什么