Pragmatic Idealist

静 敬 淡 一


  • Home

  • About

  • { L & C }

  • Tags

  • Archives

  • Search

Running Node.js on Linux with systemd

Posted on 2018-06-14

今天在思考如何在Linux服务器上不依赖PM2部署直接部署Python Web服务时,碰巧搜到的这片文章。作为一片入门教程,作者给出了非常明确的思路和操作示例,并在字里行间和文末明列出了推荐阅读材料。为推荐给各位阅读,这里我做了全文的复制,原文链接。

感谢作者Luke Bond,有机会我会将全文翻译成中文。


The Node.js community has embraced process monitoring tools such as PM2, Nodemon, and Forever, which is understandable. For example, in addition to process monitoring, PM2 also boasts features around logging and port-sharing or clustering.

However, I’m a firm believer in using the Linux init system for process monitoring. In this blog post, I’ll show you how to recreate process management, logging and clustering functionality using the Linux init system, systemd, and I’ll make the case for this being a superior approach.

Please note that I’ve no intention of casting aspersions on any of the tools I’ve mentioned. But I think gaining familiarity with Linux is important for Node.js developers; it’s important to use standard tools that are well-proven and widely understood by sysadmins everywhere.

Read more »

CentOS7中安装MongoDB

Posted on 2018-04-16 | Edited on 2018-06-14

本文概述了自己在CentOS7操作系统的服务器上安装配置MongoDB的一些基本步骤,供读者参考。

删除旧版本

如果系统中已经装有旧版本,请重点关注以下步骤。如果没有旧版本可以直接跳过本章节。

Step 1: 配置文件备份

一般当前的配置文件会存放在 /etc/mongod.conf 中。通过查阅该文件也可以定位数据文件和日志文件的存放位置。

Step 2: 数据文件备份

备份,备份,备份!(重要的事情说三遍)。建议使用mongodumps -o some_dir命令来备份。由于导出的是bson文件,相比较mongoexport效率更高。

Step 3: 删除旧版本

1
2
yum remove mongodb-org
yum autoremove

安装

这里通过官方安装源安装,虽然速度慢,但步骤非常简洁。

创建 /etc/yum.repos.d/mongodb-org-3.6.repo 文件,添加一下内容:

1
2
3
4
5
6
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

随后运行安装命令

1
yum install -y mongodb-org
Read more »

IPTables HowTos

Posted on 2018-04-11 | Edited on 2018-06-14

This article describes basic usage of linux iptables.

Read more »

JKOM CentOS VM Setup

Posted on 2018-04-11 | Edited on 2018-06-14

This article describes the steps of initiating a CentOS VM normally used with JKOM’s private network.

Here are the technical requirements:

  • create user jk with root privilage
  • disable root login from remote
  • disable firewall as it’s in local network
  • dev-tools such as git
  • python 3.6
  • node 8.9.3
Read more »
Chase Liu

Chase Liu

To see a world in a grain of sand
and a heaven in a wild flower
Hold infinity in the palm of your hand
and eternity in an hour

4 posts
8 tags
GitHub Instagram
© 2019 Chase Liu