<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>orhan.cn - 部署</title>
    <link rel="self" type="application/atom+xml" href="https://orhan.cn/tags/bu-shu/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://orhan.cn"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-05-20T00:00:00+00:00</updated>
    <id>https://orhan.cn/tags/bu-shu/atom.xml</id>
    <entry xml:lang="en">
        <title>PM2 常用命令：Node、Rust、Go 后台服务进程管理</title>
        <published>2026-05-20T00:00:00+00:00</published>
        <updated>2026-05-20T00:00:00+00:00</updated>
        
        <author>
          <name>
            
              menzil
            
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://orhan.cn/posts/pm2-common-commands/"/>
        <id>https://orhan.cn/posts/pm2-common-commands/</id>
        
        <summary type="html">&lt;p&gt;PM2 很多人以为只能管 Node.js，其实它本质上是一个进程管理器。只要是能在命令行启动的长期运行程序，PM2 都可以托管，比如 Node.js、Rust 编译出来的二进制、Go 服务、Python 脚本、Shell 脚本等。&lt;&#x2F;p&gt;
&lt;p&gt;例如一个 Rust 后端服务，可以这样启动：&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; style=&quot;background-color:#2b303b;color:#c0c5ce;&quot; class=&quot;language-bash &quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;pm2&lt;&#x2F;span&gt;&lt;span&gt; start .&#x2F;target&#x2F;release&#x2F;gateway \
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;    --name&lt;&#x2F;span&gt;&lt;span&gt; bazar-api \
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;    --cwd&lt;&#x2F;span&gt;&lt;span&gt; &#x2F;var&#x2F;www&#x2F;bazar_api \
&lt;&#x2F;span&gt;&lt;span style=&quot;color:#bf616a;&quot;&gt;    --update-env
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;这篇整理一下 PM2 的常用命令、参数含义和部署时经常会用到的操作。&lt;&#x2F;p&gt;</summary>
        
    </entry>
</feed>
