diff --git a/content/post/incus-install.md b/content/post/incus-install.md index 347d5fe..c31b261 100644 --- a/content/post/incus-install.md +++ b/content/post/incus-install.md @@ -6,7 +6,13 @@ tags: ["kvm", "虚拟化", "容器"] categories: ["kvm", "container"] --- -## Rocky9 配置 +## 单机环境 +### 服务器 +处理器 | 内存 | 系统盘 | 数据盘 | 操作系统 +---- | ---- | ---- | ---- | ---- +4核 | 8GB | 30GB | 30GB | Rocky9 + +### 操作系统配置 - 禁用 selinux ```BASH sed -i '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config @@ -60,7 +66,7 @@ categories: ["kvm", "container"] - 重启操作系统 -## 安装 incus 环境 +### 安装 incus 环境 - 安装 incus 包 ```BASH dnf copr enable neil/incus @@ -95,12 +101,6 @@ categories: ["kvm", "container"] incus remote list # 查看镜像源 ``` -## 单机环境 -### 服务器 -处理器 | 内存 | 系统盘 | 数据盘 ----- | ---- | ---- | ---- -4核 | 8GB | 30GB | 30GB - ### 初始化 incus 单机环境 - 初始化 incus ```BASH @@ -142,11 +142,17 @@ categories: ["kvm", "container"] ## 集群环境 ### 服务器 -主机名 | 服务器网卡 IP | 集群网卡 IP | 处理器 | 内存 | 系统盘 | 数据盘 | /etc/hosts ----- | ---- | ---- | ---- | ---- | ---- | ---- | ---- -incus1 | eth0: 192.168.1.1 | eth1: 10.10.10.1 | 4核 | 8GB | sda: 30G | sdb: 30G | 10.10.10.1 incus1 -incus2 | eth0: 192.168.1.2 | eth1: 10.10.10.2 | 4核 | 8GB | sda: 30G | sdb: 30G | 10.10.10.2 incus2 -incus3 | eth0: 192.168.1.3 | eth1: 10.10.10.3 | 4核 | 8GB | sda: 30G | sdb: 30G | 10.10.10.3 incus3 +主机名 | 服务器网卡IP | 集群网卡IP | 操作系统 | 数据盘 | /etc/hosts +---- | ---- | ---- | ---- | ---- | ---- +incus1 | eth0: 192.168.1.1 | 10.10.10.1 | Rocky9 | /dev/sdb | 10.10.10.1 incus1 +incus2 | eth0: 192.168.1.2 | 10.10.10.2 | Rocky9 | /dev/sdb | 10.10.10.2 incus2 +incus3 | eth0: 192.168.1.3 | 10.10.10.3 | Rocky9 | /dev/sdb | 10.10.10.3 incus3 + +### 操作系统配置 +- [每台服务器的操作与单机环境完全一致](#os) + +### 安装 incus 环境 +- [每台服务器的操作与单机环境完全一致](#incus) ### 创建网桥和 lvm 卷组 - **在每台服务器里执行下面操作** @@ -157,9 +163,11 @@ incus3 | eth0: 192.168.1.3 | eth1: 10.10.10.3 | 4核 | 8GB | sda: 30G | sdb: ifname incusbr \ con-name incusbr \ autoconnect yes \ - ipv4.addr 192.168.1.1/24 \ + ipv4.addr ${eth0_ip}/24 \ ipv4.gateway 192.168.1.254 \ ipv4.method manual + # 把 ${eth0_ip} 替换成对应服务器的 eth0 网卡 ip + nmcli c add type bridge-slave con-name incusbr-eth0 ifname eth0 master incusbr ```