{"slug":"aliyun-ecs-4rm","title":"什么？4元每月200G的服务器？还是阿里的？还有联通9929精品回程？？","description":"通过创建抢占型实例+每月免费CDT 200G流量包，你几乎只需要付很少的硬盘费！","coverImage":"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm.webp","coverWidth":362,"coverHeight":279,"date":"2026-01-16","tags":["服务器"],"pinned":false,"wordCount":2048,"html":"<h2 id=\"正式开始\">正式开始</h2><aside class=\"markdown-alert markdown-alert--caution\"><div class=\"markdown-alert-title\"><svg class=\"markdown-alert-icon\" aria-hidden=\"true\" width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 16h.01\"></path><path d=\"M12 8v4\"></path><path d=\"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z\"></path></svg><span>注意</span></div><div class=\"markdown-alert-body\"><p>抢占型实例在高峰期可能会进行回收，不要跑生产业务</p>\n</div></aside><aside class=\"markdown-alert markdown-alert--note\"><div class=\"markdown-alert-title\"><svg class=\"markdown-alert-icon\" aria-hidden=\"true\" width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><path d=\"M12 16v-4\"></path><path d=\"M12 8h.01\"></path></svg><span>备注</span></div><div class=\"markdown-alert-body\"><p>下文都是以 <strong>阿里云国内版</strong> 演示的，注意在国内版按量付费业务需要账户内可用余额要 &gt;=100 CNY。国际版无限制，但是要海外手机号+海外卡，有可能还需要KYC</p>\n</div></aside><h4 id=\"下载alpine镜像\">下载Alpine镜像</h4><blockquote>\n<p>由于我们主要的成本在硬盘上面，所以呢为了极致压缩空间，我们需要一个非常小巧的Linux镜像，以便我们可以用1G的 ESSD 云盘来安装。如果你也是极致玩家，仅用1G盘装系统，那么一定就要用我下面给你的Alpine镜像\n如果你财大气粗，不在乎，或者说想跑一些正常业务，想用Debian或Ubuntu，那就10G起步，也不需要自定义镜像了</p>\n</blockquote>\n<p>Alpine 60M镜像链接</p>\n<div class=\"markdown-code\" data-language=\"bash\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 19h8\"></path><path d=\"m4 17 6-6-6-6\"></path></svg><span>bash</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-bash\">https://dl-cdn.alpinelinux.org/alpine/v3.23/releases/x86_64/alpine-virt-3.23.2-x86_64.iso</code></pre></div><h4 id=\"将镜像上传至阿里云oss\">将镜像上传至阿里云OSS</h4><blockquote>\n<p>由于我们需要自定义镜像，但是镜像又必须要通过OSS提供，所以我们需要临时性的创建一个OSS Bucket实例，来上传我们的ISO镜像。在实例成功创建后，我们可以将其删除，以避免不必要的扣费</p>\n</blockquote>\n<p>首先，来到 <a href=\"https://oss.console.aliyun.com/bucket\" target=\"_blank\" rel=\"noopener noreferrer\">OSS管理控制台</a> ，创建一个 Bucket，<strong>地域一定要选中国香港</strong> ，并且上传ISO，最后，复制URL备用</p>\n<p><img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-1.webp\" alt=\"\" width=\"2537\" height=\"1260\" loading=\"eager\" decoding=\"async\" /></p>\n<h4 id=\"导入镜像\">导入镜像</h4><p>前往 <a href=\"https://ecs.console.aliyun.com/image/region/cn-hongkong\" target=\"_blank\" rel=\"noopener noreferrer\">云服务器管理控制台</a> ，选择右上角的 导入镜像\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-2.webp\" alt=\"\" width=\"572\" height=\"235\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>注意需要授权ECS访问OSS业务\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-3.webp\" alt=\"\" width=\"850\" height=\"814\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>然后正常填写，<strong>取消勾选“导入后执行检测”</strong> ，先不要点下一步</p>\n<p><img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-4.webp\" alt=\"\" width=\"852\" height=\"1031\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>接下来勾选配置云盘属性，并且将 <strong>云盘容量设置为1GB</strong> ，确认无误，导入\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-5.webp\" alt=\"\" width=\"832\" height=\"556\" loading=\"lazy\" decoding=\"async\" /></p>\n<h4 id=\"创建ecs抢占型实例\">创建ECS抢占型实例</h4><p>前往 <a href=\"https://ecs.console.aliyun.com/server/\" target=\"_blank\" rel=\"noopener noreferrer\">云服务器管理控制台</a> ，创建 <strong>中国香港</strong> 实例，注意红框区域要保持一致</p>\n<p>另外，对于 <strong>网络及可用区</strong> ，香港一共有 <strong>B、C、D</strong> 三个区，D区比B、C区贵不少，可以都开开测个速，留下最好的\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-ALIECSSNPSHOT.webp\" alt=\"\" width=\"2552\" height=\"3307\" loading=\"lazy\" decoding=\"async\" /></p>\n<h4 id=\"开通cdt\">开通CDT</h4><p>前往 <a href=\"https://cdt.console.aliyun.com/overview\" target=\"_blank\" rel=\"noopener noreferrer\">云数据传输</a> 将升级状态全部变为已升级即可\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-6.webp\" alt=\"\" width=\"1807\" height=\"657\" loading=\"lazy\" decoding=\"async\" /></p>\n<h4 id=\"创建-绑定弹性公网ip并且挂上cdt\">创建&amp;绑定弹性公网IP并且挂上CDT</h4><blockquote>\n<p>因为弹性公网IP可以绑定CDT的每月200G免费流量，并且在绑定实例后，弹性公网IP将不会再扣费。如果后续删机的时候不要忘记释放弹性公网IP，否则会一直扣费</p>\n</blockquote>\n<p>进入 <a href=\"https://vpc.console.aliyun.com/eip/cn-hongkong/eips\" target=\"_blank\" rel=\"noopener noreferrer\">专有网络管理控制台</a> 如图选择，然后购买即可（这里显示的费用是纯持有不绑定的费用，一旦绑定就不计费了）\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-7.webp\" alt=\"\" width=\"1647\" height=\"1161\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>接下来绑定弹性公网IP（因为我绑定过了，所以是解绑）\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-8.webp\" alt=\"\" width=\"791\" height=\"691\" loading=\"lazy\" decoding=\"async\" /></p>\n<p>接下来在这里绑定CDT，带宽最高可以拉到 2000Mbps，但是不推荐，一般300M够用了\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-9.webp\" alt=\"\" width=\"2274\" height=\"320\" loading=\"lazy\" decoding=\"async\" /></p>\n<h4 id=\"配置alpine\">配置Alpine</h4><blockquote>\n<p>如果你安装了Alpine，默认是需要VNC进入手动配置系统的。如果是公共镜像，则已经可以用了，但不要忘了保证系统纯净</p>\n</blockquote>\n<p>进入 <a href=\"https://ecs.console.aliyun.com/server/\" target=\"_blank\" rel=\"noopener noreferrer\">云服务器管理控制台</a> 选择你刚买的ECS，接下来点击 <strong>远程连接</strong> ，展开更多，选择 <strong>通过VNC远程连接</strong></p>\n<p>接下来就是愉快的敲命令环节~ （方括号内为默认值，你可以输入新值回车覆盖也可以直接回车应用默认值）</p>\n<ul>\n<li>启动 Alpine 安装程序</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">localhost:<span class=\"hljs-operator\">~</span># setup<span class=\"hljs-operator\">-</span>alpine</code></pre></div><ul>\n<li>选择键盘布局</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">Select</span> keyboard layout: [<span class=\"hljs-keyword\">none</span>] us\n<span class=\"hljs-keyword\">Select</span> variant: [us]</code></pre></div><ul>\n<li>设置主机名</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Enter <span class=\"hljs-keyword\">system</span> hostname (fully qualified form, e.g. <span class=\"hljs-string\">'foo.example.org'</span>) [localhost] alpine<span class=\"hljs-operator\">-</span>vps</code></pre></div><ul>\n<li>设置网卡</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Available interfaces <span class=\"hljs-keyword\">are</span>: eth0 lo\nWhich <span class=\"hljs-keyword\">one</span> do you want <span class=\"hljs-keyword\">to</span> initialize? [eth0]</code></pre></div><ul>\n<li>设置 IP 获取方式</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Ip address <span class=\"hljs-keyword\">for</span> eth0? (<span class=\"hljs-keyword\">or</span> <span class=\"hljs-string\">'dhcp'</span>, <span class=\"hljs-string\">'none'</span>, <span class=\"hljs-string\">'manual'</span>) [dhcp]</code></pre></div><ul>\n<li>是否进行手动网络配置</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Do you want <span class=\"hljs-keyword\">to</span> do <span class=\"hljs-keyword\">any</span> manual network configuration? [<span class=\"hljs-keyword\">no</span>]</code></pre></div><ul>\n<li>设置 root 密码（输入时不会显示）</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">New</span> password:\nRetype password:</code></pre></div><ul>\n<li>设置时区，或者（PRC）</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Which timezone <span class=\"hljs-keyword\">are</span> you <span class=\"hljs-keyword\">in</span>? (<span class=\"hljs-string\">'?'</span> <span class=\"hljs-keyword\">for</span> list) [UTC] Asia<span class=\"hljs-operator\">/</span>Shanghai</code></pre></div><ul>\n<li>设置代理</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">HTTP<span class=\"hljs-operator\">/</span>FTP proxy URL? [<span class=\"hljs-keyword\">none</span>]</code></pre></div><ul>\n<li>选择软件仓库镜像。这个地方建议先输入 <code>s</code> 列出所有镜像，然后上下翻找找到阿里云镜像源，然后输入对应镜像源编号，否则选错了你后续通过apk安装软件的时候不会免流</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Which mirror do you want <span class=\"hljs-keyword\">to</span> use? (<span class=\"hljs-keyword\">or</span> <span class=\"hljs-string\">'?'</span> <span class=\"hljs-keyword\">or</span> <span class=\"hljs-string\">'done'</span>) [<span class=\"hljs-number\">44</span>] </code></pre></div><ul>\n<li>不创建普通用户</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Setup a <span class=\"hljs-keyword\">user</span>? (enter a username, <span class=\"hljs-keyword\">or</span> <span class=\"hljs-string\">'no'</span>) [<span class=\"hljs-keyword\">no</span>] <span class=\"hljs-keyword\">no</span></code></pre></div><ul>\n<li>选择 SSH 服务</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Which SSH server? (<span class=\"hljs-string\">'openssh'</span>, <span class=\"hljs-string\">'dropbear'</span>, <span class=\"hljs-keyword\">or</span> <span class=\"hljs-string\">'none'</span>) [openssh]</code></pre></div><ul>\n<li>是否允许 root 通过 SSH 登录</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Allow root ssh login? (<span class=\"hljs-string\">'?'</span> <span class=\"hljs-keyword\">for</span> help) [prohibit<span class=\"hljs-operator\">-</span>password] yes</code></pre></div><ul>\n<li>没有找到磁盘，是否安装至 vda 云盘，是</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">No</span> disk available, Try boot media <span class=\"hljs-operator\">/</span>media<span class=\"hljs-operator\">/</span>vda ? (y<span class=\"hljs-operator\">/</span>n) [n] y</code></pre></div><ul>\n<li>选择要安装的磁盘</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Which disk(s) would you <span class=\"hljs-keyword\">like</span> <span class=\"hljs-keyword\">to</span> use? (<span class=\"hljs-keyword\">or</span> <span class=\"hljs-string\">'?'</span> <span class=\"hljs-keyword\">for</span> help <span class=\"hljs-keyword\">or</span> <span class=\"hljs-string\">'none'</span>) [<span class=\"hljs-keyword\">none</span>] vda</code></pre></div><ul>\n<li>选择磁盘使用方式</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">How would you <span class=\"hljs-keyword\">like</span> <span class=\"hljs-keyword\">to</span> use it? (<span class=\"hljs-string\">'sys'</span>, <span class=\"hljs-string\">'data'</span>, <span class=\"hljs-string\">'crypt'</span>, <span class=\"hljs-string\">'lvm'</span>) [sys]</code></pre></div><ul>\n<li>确认格式化磁盘</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">WARNING: Erase the above disk(s) <span class=\"hljs-keyword\">and</span> continue? [y<span class=\"hljs-operator\">/</span>N] y</code></pre></div><ul>\n<li>安装系统</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Installing <span class=\"hljs-keyword\">system</span> <span class=\"hljs-keyword\">on</span> <span class=\"hljs-operator\">/</span>dev<span class=\"hljs-operator\">/</span>sda:\n  Installing alpine<span class=\"hljs-operator\">-</span>base...\n  Installing busybox...\n  Installing openssh...\n  Installing openrc...</code></pre></div><ul>\n<li>安装完成提示</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">Installation <span class=\"hljs-keyword\">is</span> complete. Please reboot.</code></pre></div><ul>\n<li>重启系统</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">localhost:<span class=\"hljs-operator\">~</span># reboot</code></pre></div><ul>\n<li>重启后登录</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">alpine<span class=\"hljs-operator\">-</span>vps login: root\nPassword:</code></pre></div><ul>\n<li>设置DNS（Cloudflare &amp; Google DNS）</li>\n</ul>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">alpine<span class=\"hljs-operator\">-</span>vps:<span class=\"hljs-operator\">~</span># setup<span class=\"hljs-operator\">-</span>dns\nDNS Domain name? (e.g. <span class=\"hljs-string\">'bar.com'</span>) nameserver\nDNS nameserver(s)? [<span class=\"hljs-number\">223.5</span><span class=\"hljs-number\">.5</span><span class=\"hljs-number\">.5</span>] <span class=\"hljs-number\">1.1</span><span class=\"hljs-number\">.1</span><span class=\"hljs-number\">.1</span> <span class=\"hljs-number\">8.8</span><span class=\"hljs-number\">.8</span><span class=\"hljs-number\">.8</span></code></pre></div><p>Alpine的软件包管理器为 <strong>APK</strong> ，首先我们先更新软件源</p>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">apk <span class=\"hljs-keyword\">update</span></code></pre></div><p>接下来，安装一些基本的软件包</p>\n<div class=\"markdown-code\" data-language=\"sql\"><div class=\"markdown-code-header\"><span class=\"markdown-code-language\"><svg class=\"code-language-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path></svg><span>sql</span></span><button type=\"button\" class=\"code-block-copy\" aria-label=\"复制代码\" title=\"复制代码\"><svg class=\"code-block-copy-icon\" aria-hidden=\"true\" width=\"16\" height=\"16\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"></rect><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"></path></svg></button></div><pre><code class=\"hljs language-sql\">apk <span class=\"hljs-keyword\">add</span> curl unzip jq openssl tar iproute2 bash</code></pre></div><h4 id=\"设置保活-用量封顶策略\">设置保活&amp;用量封顶策略</h4><p>虽然我们将弹性公网IP连接了CDT，默认流量会从CDT的免费流量份额里面扣</p>\n<p>但是一旦超出上限，那就会扣我们的真金白银了</p>\n<p>所以，我们需要一个定时监测的服务，发现CDT流量快用完了立即停机</p>\n<p>那么...让我们请出 Cloudflare Worker！</p>\n<p><a href=\"https://github.com/afoim/cf-worker-aliyun-cdt-tracker\" target=\"_blank\" rel=\"noopener noreferrer\">afoim/cf-worker-aliyun-cdt-tracker</a></p>\n<p>在Cloudflare Worker的仪表盘配置五个机密环境变量即可\n以下是需要配置的机密环境变量 (Secrets)：</p>\n<table>\n<thead>\n<tr>\n<th>变量名</th>\n<th>描述</th>\n<th>示例 / 备注</th>\n</tr>\n</thead>\n<tbody><tr>\n<td><code>ACCESS_KEY_ID</code></td>\n<td>阿里云账号的 AccessKey ID</td>\n<td><code>LTAIxxxxxxxxxxxx</code></td>\n</tr>\n<tr>\n<td><code>ACCESS_KEY_SECRET</code></td>\n<td>阿里云账号的 AccessKey Secret</td>\n<td><code>xxxxxxxxxxxxxxxxxxxxxxxx</code></td>\n</tr>\n<tr>\n<td><code>REGION_ID</code></td>\n<td>ECS 实例所在的区域 ID。</td>\n<td>cn-hongkong</td>\n</tr>\n<tr>\n<td><code>ECS_INSTANCE_ID</code></td>\n<td>需要控制的 ECS 实例 ID。在控制台获取</td>\n<td>i-xxxxxxxxxxxx</td>\n</tr>\n<tr>\n<td><code>TRAFFIC_THRESHOLD_GB</code></td>\n<td>流量阈值（单位：GB），超过此值将停止实例</td>\n<td><code>180</code> (默认为 180)</td>\n</tr>\n</tbody></table>\n<p>我们需要前往 <a href=\"https://ram.console.aliyun.com/profile/access-keys\" target=\"_blank\" rel=\"noopener noreferrer\">https://ram.console.aliyun.com/profile/access-keys</a> 创建一个RAM用户，你就会得到 <code>ACCESS_KEY_ID</code> 和 <code>ACCESS_KEY_SECRET</code> ，并且分配权限：<code>AliyunECSFullAccess</code>  `AliyunCDTFullAccess</p>\n<p>部署成功后，Cloudflare Worker将在每分钟检查一次CDT，如果超出流量阈值，会将指定ID的ECS停止\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-aliyun-ecs-4rm-10.webp\" alt=\"\" width=\"986\" height=\"428\" loading=\"lazy\" decoding=\"async\" /></p>\n<h2 id=\"计费流程图\">计费流程图</h2><p>带宽费（按固定带宽计费收取）：根据您指定的带宽峰值和计费时长后付费，与实际使用的流量无关。</p>\n<p>流量费（按使用流量计费收取）：根据每小时公网的实际流量计费。</p>\n<p>最终，抢占型ECS实例每个小时扣费 <strong>0.005528 元</strong> ，按照一个月31天，每月扣费 <strong>4.112832 元</strong> ，而弹性公网IP一经绑定便不再计费，CDT每月免费200G海外流量，不超出不计费，OSS免费存储5G，传入流量不计费，我们也没有传出流量，或者保险起见你也可以将其删除</p>\n<p><strong>最终每月成本：不到5元！</strong>\n<img src=\"https://b.acofork.com/img/aliyun-ecs-4rm-4411ab2fe9dfe7df65472e5b426af5671.webp\" alt=\"\" width=\"979\" height=\"653\" loading=\"lazy\" decoding=\"async\" /></p>\n","toc":[{"id":"正式开始","text":"正式开始","depth":2},{"id":"下载alpine镜像","text":"下载Alpine镜像","depth":4},{"id":"将镜像上传至阿里云oss","text":"将镜像上传至阿里云OSS","depth":4},{"id":"导入镜像","text":"导入镜像","depth":4},{"id":"创建ecs抢占型实例","text":"创建ECS抢占型实例","depth":4},{"id":"开通cdt","text":"开通CDT","depth":4},{"id":"创建-绑定弹性公网ip并且挂上cdt","text":"创建&绑定弹性公网IP并且挂上CDT","depth":4},{"id":"配置alpine","text":"配置Alpine","depth":4},{"id":"设置保活-用量封顶策略","text":"设置保活&用量封顶策略","depth":4},{"id":"计费流程图","text":"计费流程图","depth":2}]}