ECS 使用PVE7 孵化CT容器

上一篇中,已经绑定好了域和限定来源,方便访问……那么本文主要记录:创建在ECS部署完PVE环境后,孵化CT容器以及部署lnmp环境……

简述

  • 宿主机器类型:ECS(4C16G)
  • CT容器系统:Debian 11

下载CT模板

由于是国内机器,那么就需要使用国内的源来拉,不然太慢了,还容易失败。具体的可以参考:PVE7下载CT模板失败?尝试手动下载

创建虚拟网卡

由于仅有ipv4网络,所以可以参考这两篇文章:Debian 11 PVE7 添加网卡 (仅NAT IPV4)

配置宿主机网卡

同样的,这里就不再重复记录了:Debian 11 PVE7 配置网络 实现NAT IPV4 (不含IPV6网络)

创建CT容器

可以参考:Debian 11 使用 PVE7 部署CT容器 孵化小鸡

这里一定一定一定一定一定要特别注意:ECS不是轻量,长时间占用cpu性能会被kill进程,不管是dd过的还没dd过的。所以分配cpu的时候要特别注意一下,如果不想限制性能,那就cpu对半分,比如这里的4核心只分配2核心。
另外,通过测试发现:必须要开启嵌套功能,否则,每次使用ssh登录root的时候需要响应很长的时间……

部署LNMP

换成国内的源,至于换dns就不用了,部署ct容器的时候有选项的,不填的话直接默认调用宿主机的。

cat > /etc/apt/sources.list <<EOF
deb http://mirrors.aliyun.com/debian bullseye main
deb http://mirrors.aliyun.com/debian bullseye-updates main
deb http://mirrors.aliyun.com/debian-security bullseye-security main
deb http://mirrors.aliyun.com/debian bullseye-backports main
EOF

然后更新一下 apt -y update

之后也不管有没有了,直接装一下 apt -y install wget curl screen

然后开始部署lnmp1.9环境,习惯性的使用 scrren -S lnmp  开个窗口防止网络问题导致ssh断开。

按照自己的需求来,这里记录的只是随便选的……

+------------------------------------------------------------------------+
|          LNMP V1.9 for Debian Linux Server, Written by Licess          |
+------------------------------------------------------------------------+
|        A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux       |
+------------------------------------------------------------------------+
|           For more information please visit https://lnmp.org           |
+------------------------------------------------------------------------+
You have 11 options for your DataBase install.
1: Install MySQL 5.1.73
2: Install MySQL 5.5.62 (Default)
3: Install MySQL 5.6.51
4: Install MySQL 5.7.38
5: Install MySQL 8.0.30
6: Install MariaDB 5.5.68
7: Install MariaDB 10.3.35
8: Install MariaDB 10.4.25
9: Install MariaDB 10.5.16
10: Install MariaDB 10.6.8
0: DO NOT Install MySQL/MariaDB
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or 0): 5
Using Generic Binaries [y/n]: n
You will install MySQL 8.0.30 from Source.
===========================
Please setup root password of MySQL.
Please enter: xxxxxxx
MySQL root password: xxxxxxx
===========================
Do you want to enable or disable the InnoDB Storage Engine?
Default enable,Enter your choice [Y/n]: 
No input,The InnoDB Storage Engine will enable.
===========================
You have 9 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.45
4: Install PHP 5.5.38
5: Install PHP 5.6.40 (Default)
6: Install PHP 7.0.33
7: Install PHP 7.1.33
8: Install PHP 7.2.34
9: Install PHP 7.3.33
10: Install PHP 7.4.30
11: Install PHP 8.0.20
12: Install PHP 8.1.7
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12): 12
You will install PHP 8.1.7
===========================
You have 3 options for your Memory Allocator install.
1: Don't install Memory Allocator. (Default)
2: Install Jemalloc
3: Install TCMalloc
Enter your choice (1, 2 or 3): 
No input,You will not install Memory Allocator.

Press any key to install...or Press Ctrl+c to cancel

然后?就可以ctrl+A+D退出窗口,等个十几二十分钟再回来使用screen -r lnmp查看安装完了没。。。

碎碎念

以后套路云如果只是短期用,还是买抢占实例吧,实在不行正价买个月付的,太折腾了这玩意儿。关键客服一个个水平差的要命,越来越倒退……

阅读剩余
THE END