mirror of
https://github.com/oneclickvirt/oneclickvirt.github.io.git
synced 2026-05-30 14:49:34 +08:00
fix: 分离虚拟内存开设的操作,LXD和Incus不再默认要求开设虚拟内存
This commit is contained in:
@@ -2,18 +2,41 @@
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# incus Installation Guide
|
||||
# Incus
|
||||
|
||||
If your host does not have an IPV6 subnet and you want to assign IPV6 addresses to containers, then please check the ``Customize`` partition in the ``incus`` module for the ``Attach a free IPV6 address segment`` to the host, and attach an IPV6 subnet to the host before installing the environment.
|
||||
If your host does not have an IPV6 subnet and you want to assign IPV6 addresses to containers, then please check the ```Customize``` partition in the ```incus``` module for the ```Attach a free IPV6 address segment``` to the host, and attach an IPV6 subnet to the host before installing the environment.
|
||||
|
||||
## One-Click Installation
|
||||
## Setting up virtual memory (SWAP) (optional, not required)
|
||||
|
||||
:::tip
|
||||
Memory to open some swap lest the machine blow up, if your host computer does not have enough memory and a lot of free hard disk.
|
||||
:::
|
||||
|
||||
Unit conversion: Enter 1024 to generate 1G SWAP-virtual memory, virtual memory occupies hard disk space.
|
||||
|
||||
When the actual memory is not enough, the virtual memory will be automatically used for memory usage, but it will bring high IO usage and CPU performance.
|
||||
|
||||
Refer to the description of the organization's related project [Jump](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md) This opens the size of virtual memory
|
||||
|
||||
| Physical Memory Size | Recommended SWAP Size |
|
||||
| -------------------- | --------------------- |
|
||||
| ≤ 2G | 2x memory size |
|
||||
| 2G < memory ≤ 8G | Equal to physical memory |
|
||||
| ≥ 8G | About 8G is sufficient |
|
||||
| Hibernation needed | At least equal to physical memory |
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
|
||||
```
|
||||
|
||||
## Incus One-Click Installation Guide
|
||||
|
||||
:::warning
|
||||
If this is a new server, make sure that both ```update``` and ```curl``` are working properly before executing this script.
|
||||
:::
|
||||
|
||||
- Prerequisites: Ubuntu 20+(Not recommended to use Incus, please use LXD), Debian 11+(Recommended), RockyLinux 9+, AlmaLinux 9+, Centos 9+
|
||||
- The virtual memory here is talking about the size of the SWAP to be opened, and the storage pool is the sum of the sizes of the disks occupied by all your servers to be opened
|
||||
- During installation, you will be prompted to enter the storage pool creation path as well as the size, and all the VMs or containers you want to open end up taking up space in the storage pool
|
||||
- The server needs to be restarted after the environment installation process to load some default configurations
|
||||
- By default, lxd's lxcfs-related configuration is enabled, so that in-container querying of container information changes to information about the container itself rather than the host
|
||||
- This installer has been tested to work on either physical or non-physical machines
|
||||
@@ -36,7 +59,7 @@ If you don't need to specify the path of a non-system disk as the default storag
|
||||
|
||||
If you need to specify the path of a non-system disk as the default pool, then you need to select ```y``` and enter the corresponding path (the actual absolute path of the disk you mounted).
|
||||
|
||||
If the corresponding disk has 18G of free hard disk space in addition to the occupied space, and you want to open 2G of virtual memory (2048MB of SWAP), 15G of storage pool, according to the prompts on the command line, then enter ```2048``` and ```15``` in turn.
|
||||
If the corresponding disk has 18 Gigabytes of free hard disk space in addition to the occupied space and you want to open a 15 Gigabyte storage pool, follow the command line prompts to enter ```15```.
|
||||
|
||||
:::tip
|
||||
The execution process **may** require a **manual reboot** to load the storage type into the kernel, the installation is completed at the end of the execution will **automatically reboot** the server, the first time after the complete installation of the reboot will take about 400 ~ 500 seconds, please be patient
|
||||
@@ -48,7 +71,7 @@ If you need to open more than 200 Incus containers on a single server, then it i
|
||||
|
||||
## Manual Installation (optional)
|
||||
|
||||
Not recommended, just for some odd environments where one-click scripts won't run.
|
||||
Not recommended, just to install for some oddball environments where one-click scripts won't run, or if you want to understand the most basic Incus installation process.
|
||||
|
||||
### Disable Firewall
|
||||
|
||||
|
||||
@@ -2,11 +2,35 @@
|
||||
outline: deep
|
||||
---
|
||||
|
||||
## LXD Installation Guide
|
||||
## LXD
|
||||
|
||||
If your host does not have an IPV6 subnet and you want to assign IPV6 addresses to containers, then please check the ``Customize`` partition in the ``LXD`` module for the ``Attach a free IPV6 address segment`` to the host, and attach an IPV6 subnet to the host before installing the environment.
|
||||
If your host does not have an IPV6 subnet and you want to assign IPV6 addresses to containers, then please check the ```Customize``` partition in the ```LXD``` module for the ```Attach a free IPV6 address segment``` to the host, and attach an IPV6 subnet to the host before installing the environment.
|
||||
|
||||
### One-Click Installation
|
||||
|
||||
## Setting up virtual memory (SWAP) (optional, not required)
|
||||
|
||||
:::tip
|
||||
Memory to open some swap lest the machine blow up, if your host computer does not have enough memory and a lot of free hard disk.
|
||||
:::
|
||||
|
||||
Unit conversion: Enter 1024 to generate 1G SWAP-virtual memory, virtual memory occupies hard disk space.
|
||||
|
||||
When the actual memory is not enough, the virtual memory will be automatically used for memory usage, but it will bring high IO usage and CPU performance.
|
||||
|
||||
Refer to the description of the organization's related project [Jump](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md) This opens the size of virtual memory
|
||||
|
||||
| Physical Memory Size | Recommended SWAP Size |
|
||||
| -------------------- | --------------------- |
|
||||
| ≤ 2G | 2x memory size |
|
||||
| 2G < memory ≤ 8G | Equal to physical memory |
|
||||
| ≥ 8G | About 8G is sufficient |
|
||||
| Hibernation needed | At least equal to physical memory |
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
|
||||
```
|
||||
|
||||
## LXD One-Click Installation Guide
|
||||
|
||||
:::warning
|
||||
If this is a new server, make sure that both ```apt update``` and ```apt install curl``` are working properly before executing this script.
|
||||
@@ -17,7 +41,7 @@ It's recommended to wait for at least 5 minutes after the system boots up before
|
||||
:::
|
||||
|
||||
- Prerequisites: Ubuntu 18+ (recommended above 22.04), Debian 8+ (recommended above 11)
|
||||
- The virtual memory here is talking about the size of the SWAP to be opened, and the storage pool is the sum of the sizes of the disks occupied by all your servers to be opened
|
||||
- During installation, you will be prompted to enter the storage pool creation path as well as the size, and all the VMs or containers you want to open end up taking up space in the storage pool
|
||||
- The server needs to be restarted after the environment installation process to load some default configurations
|
||||
- By default, lxd's lxcfs-related configuration is enabled, so that in-container querying of container information changes to information about the container itself rather than the host
|
||||
- This installer has been tested to work on either physical or non-physical machines
|
||||
@@ -36,7 +60,11 @@ bash lxdinstall.sh
|
||||
|
||||
Example of initialization configuration:
|
||||
|
||||
If there is 18GB of unused disk space on the system disk, after deducting the space already occupied, and you want to allocate 2GB of virtual memory (2048MB of SWAP) and a 15GB storage pool, then following the prompts in the command line, enter ```2048``` and ```15```.
|
||||
If you don't need to specify the path of a non-system disk as the default storage pool, then you can directly enter or type ```n``` when choosing whether to customize the storage pool path, and you don't need to specify the path.
|
||||
|
||||
If you need to specify the path of a non-system disk as the default pool, then you need to select ```y``` and enter the corresponding path (the actual absolute path of the disk you mounted).
|
||||
|
||||
If the corresponding disk has 18 Gigabytes of free hard disk space in addition to the occupied space and you want to open a 15 Gigabyte storage pool, follow the command line prompts to enter ```15```.
|
||||
|
||||
:::warning
|
||||
If you need to open more than 200 LXD containers on a single server, then it is not recommended to use this project, there may be problems with lxcfs access drift, which generates IO occupancy that cannot be released. (This is a native LXC problem that can't be fixed.)
|
||||
@@ -70,7 +98,7 @@ Better than nothing can only mean that there is no RBAC access control for sub-u
|
||||
|
||||
### Manual installation (optional)
|
||||
|
||||
Not recommended, just for some odd environments where one-click scripts won't run.
|
||||
Not recommended, just to install for some oddball environments where one-click scripts won't run, or if you want to understand the most basic LXD installation process.
|
||||
|
||||
#### Disable Firewall
|
||||
|
||||
|
||||
@@ -47,9 +47,18 @@ If you use IPV6 tunnels for IPV6 subnet attachment on the host, be sure to add t
|
||||
Memory to open some swap lest the machine blow up, if your host computer does not have enough memory and a lot of free hard disk.
|
||||
:::
|
||||
|
||||
Unit conversion: Enter 1024 to generate 1G SWAP-virtual memory, virtual memory takes up hard disk space, when the actual memory is not enough to use the virtual memory will automatically use the virtual memory for memory use, but then bring the IO high occupancy and CPU performance occupancy!
|
||||
Unit conversion: Enter 1024 to generate 1G SWAP-virtual memory, virtual memory occupies hard disk space.
|
||||
|
||||
It is recommended to use only twice the size of the actual memory as virtual memory.
|
||||
When the actual memory is not enough, the virtual memory will be automatically used for memory usage, but it will bring high IO usage and CPU performance.
|
||||
|
||||
Refer to the description of the organization's related project [Jump](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md) This opens the size of virtual memory
|
||||
|
||||
| Physical Memory Size | Recommended SWAP Size |
|
||||
| -------------------- | --------------------- |
|
||||
| ≤ 2G | 2x memory size |
|
||||
| 2G < memory ≤ 8G | Equal to physical memory |
|
||||
| ≥ 8G | About 8G is sufficient |
|
||||
| Hibernation needed | At least equal to physical memory |
|
||||
|
||||
Command:
|
||||
|
||||
|
||||
@@ -2,18 +2,49 @@
|
||||
outline: deep
|
||||
---
|
||||
|
||||
# incus主体安装
|
||||
# Incus
|
||||
|
||||
如果你的宿主机本身没有IPV6的子网又想给容器分配IPV6地址,那么请先查看```incus```模块中的```自定义```分区中的```给宿主机附加免费的IPV6地址段```的内容,给宿主机附加上IPV6子网后再进行环境安装
|
||||
|
||||
## 一键安装
|
||||
## 开设虚拟内存(SWAP)(非必须的可选项)
|
||||
|
||||
:::tip
|
||||
内存开点swap免得机器炸了,如果你的宿主机内存不够用硬盘又很多空闲的话
|
||||
:::
|
||||
|
||||
单位换算:输入 1024 产生 1G SWAP-虚拟内存,虚拟内存占用硬盘空间。
|
||||
|
||||
当实际内存不够用时将自动使用虚拟内存做内存使用,但随之带来IO高占用以及CPU性能占用。
|
||||
|
||||
参考本组织相关项目的说明 [跳转](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md) 这块开设虚拟内存的大小
|
||||
|
||||
| 物理内存大小 | 推荐 SWAP 大小 |
|
||||
| ------------------ | ---------- |
|
||||
| ≤ 2G | 内存的 2 倍 |
|
||||
| 2G < 内存 ≤ 8G | 等于物理内存大小 |
|
||||
| ≥ 8G | 约 8G 即可 |
|
||||
| 需要休眠 (hibernation) | 至少等于物理内存大小 |
|
||||
|
||||
国际
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
|
||||
```
|
||||
|
||||
国内
|
||||
|
||||
```shell
|
||||
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
|
||||
```
|
||||
|
||||
## Incus主体安装
|
||||
|
||||
:::warning
|
||||
如果是全新的服务器,务必保证```curl```命令可用且```update```无问题再执行本脚本。
|
||||
:::
|
||||
|
||||
- 环境要求:Ubuntu 20+(不推荐Incus请使用LXD), Debian 11+(推荐), RockyLinux 9+, AlmaLinux 9+, Centos 9+
|
||||
- 这里的虚拟内存是说要开的SWAP大小,存储池则是你所有要开的服务器占的盘的大小的总和
|
||||
- 安装过程中会提示输入存储池创建路径以及大小,你所有要开的虚拟机或容器最终占用的空间是在存储池中
|
||||
- 环境安装过程后需要重启服务器以加载一些默认配置
|
||||
- 默认启用lxd的lxcfs相关配置,使得容器内查询容器信息变更为容器本身的信息而不是宿主机信息
|
||||
- 实测本安装程序在物理机器或非物理机器上都可使用
|
||||
@@ -42,7 +73,7 @@ bash incus_install.sh
|
||||
|
||||
如果需要指定非系统盘的路径做默认的存储池,那么需要选择```y```,然后输入对应的路径(你挂载的盘的实际的绝对路径)。
|
||||
|
||||
如果对应的盘除去已占用空间还有18G硬盘空余,想开2G虚拟内存(2048MB的SWAP),15G的存储池,按照命令行的提示则依次输入```2048```和```15```
|
||||
如果对应的盘除去已占用空间还有18G硬盘空余,想要开设15G的存储池,按照命令行的提示则输入```15```
|
||||
|
||||
:::tip
|
||||
执行过程中**可能**会要求**手动重启**加载存储类型到内核中,安装完毕执行到最后会**自动进行服务器重启**,首次完整安装完毕后的自动重启最多大概耗时400~500秒,请耐心等待
|
||||
@@ -54,7 +85,7 @@ bash incus_install.sh
|
||||
|
||||
## 手动安装(备选)
|
||||
|
||||
不推荐,只是为了一些奇葩环境一键脚本跑不动的时候进行安装
|
||||
不推荐,只是为了一些奇葩环境一键脚本跑不动的时候进行安装,或则你想要了解最基础的Incus安装流程。
|
||||
|
||||
### 关闭防火墙
|
||||
|
||||
|
||||
@@ -6,6 +6,37 @@ outline: deep
|
||||
|
||||
如果你的宿主机本身没有IPV6的子网又想给容器分配IPV6地址,那么请先查看```LXD```模块中的```自定义```分区中的```给宿主机附加免费的IPV6地址段```的内容,给宿主机附加上IPV6子网后再进行环境安装
|
||||
|
||||
## 开设虚拟内存(SWAP)(非必须的可选项)
|
||||
|
||||
:::tip
|
||||
内存开点swap免得机器炸了,如果你的宿主机内存不够用硬盘又很多空闲的话
|
||||
:::
|
||||
|
||||
单位换算:输入 1024 产生 1G SWAP-虚拟内存,虚拟内存占用硬盘空间。
|
||||
|
||||
当实际内存不够用时将自动使用虚拟内存做内存使用,但随之带来IO高占用以及CPU性能占用。
|
||||
|
||||
参考本组织相关项目的说明 [跳转](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md) 这块开设虚拟内存的大小
|
||||
|
||||
| 物理内存大小 | 推荐 SWAP 大小 |
|
||||
| ------------------ | ---------- |
|
||||
| ≤ 2G | 内存的 2 倍 |
|
||||
| 2G < 内存 ≤ 8G | 等于物理内存大小 |
|
||||
| ≥ 8G | 约 8G 即可 |
|
||||
| 需要休眠 (hibernation) | 至少等于物理内存大小 |
|
||||
|
||||
国际
|
||||
|
||||
```shell
|
||||
curl -L https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
|
||||
```
|
||||
|
||||
国内
|
||||
|
||||
```shell
|
||||
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/addswap/main/addswap.sh -o addswap.sh && chmod +x addswap.sh && bash addswap.sh
|
||||
```
|
||||
|
||||
### LXD主体安装
|
||||
|
||||
:::warning
|
||||
@@ -13,7 +44,7 @@ outline: deep
|
||||
:::
|
||||
|
||||
- 环境要求:Ubuntu 18+(推荐22.04以上),Debian 8+(推荐11以上)
|
||||
- 这里的虚拟内存是说要开的SWAP大小,存储池则是你所有要开的服务器占的盘的大小的总和
|
||||
- 安装过程中会提示输入存储池创建路径以及大小,你所有要开的虚拟机或容器最终占用的空间是在存储池中
|
||||
- 环境安装过程后需要重启服务器以加载一些默认配置
|
||||
- 默认启用lxd的lxcfs相关配置,使得容器内查询容器信息变更为容器本身的信息而不是宿主机信息
|
||||
- 实测本安装程序在物理机器或非物理机器上都可使用
|
||||
@@ -38,7 +69,11 @@ bash lxdinstall.sh
|
||||
|
||||
初始化配置的例子:
|
||||
|
||||
如果系统盘除去已占用空间还有18G硬盘空余,想开2G虚拟内存(2048MB的SWAP),15G的存储池,按照命令行的提示则依次输入```2048```和```15```
|
||||
如果不需要指定非系统盘的路径做默认存储池,那么选择是否自定义存储池路径时直接回车或输入```n```即可,不需要指定路径。
|
||||
|
||||
如果需要指定非系统盘的路径做默认的存储池,那么需要选择```y```,然后输入对应的路径(你挂载的盘的实际的绝对路径)。
|
||||
|
||||
如果对应的盘除去已占用空间还有18G硬盘空余,想要开设15G的存储池,按照命令行的提示则输入```15```。
|
||||
|
||||
:::warning
|
||||
如果你需要在一台服务器上开启超过200个LXD容器,那么不推荐你使用本项目,可能会出现lxcfs访问漂移的问题,产生IO占用无法释放。(系lxc原生问题无法修复)
|
||||
@@ -72,7 +107,7 @@ sudo snap install lxdmosaic
|
||||
|
||||
### 手动安装(备选)
|
||||
|
||||
不推荐,只是为了一些奇葩环境一键脚本跑不动的时候进行安装
|
||||
不推荐,只是为了一些奇葩环境一键脚本跑不动的时候进行安装,或则你想要了解最基础的LXD安装流程。
|
||||
|
||||
#### 关闭防火墙
|
||||
|
||||
|
||||
@@ -49,7 +49,14 @@ outline: deep
|
||||
|
||||
单位换算:输入 1024 产生 1G SWAP-虚拟内存,虚拟内存占用硬盘空间,当实际内存不够用时将自动使用虚拟内存做内存使用,但随之带来IO高占用以及CPU性能占用
|
||||
|
||||
建议只开实际内存大小两倍大小的虚拟内存
|
||||
参考本组织相关项目的说明 [跳转](https://github.com/oneclickvirt/ecs/blob/master/README_NEW_USER.md) 这块开设虚拟内存的大小
|
||||
|
||||
| 物理内存大小 | 推荐 SWAP 大小 |
|
||||
| ------------------ | ---------- |
|
||||
| ≤ 2G | 内存的 2 倍 |
|
||||
| 2G < 内存 ≤ 8G | 等于物理内存大小 |
|
||||
| ≥ 8G | 约 8G 即可 |
|
||||
| 需要休眠 (hibernation) | 至少等于物理内存大小 |
|
||||
|
||||
国际
|
||||
|
||||
|
||||
Reference in New Issue
Block a user