02
2024
02
00:48:17

Debian Buster 上安装 Proxmox VE 记录



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

介绍

受支持的 Proxmox VE 服务器的安装应通过 Bare-metal_ISO_Installer 完成。 在某些情况下,在正在运行的 Debian Buster 64 位上安装 Proxmox VE 是有意义的,特别是如果您想要自定义分区布局。

对于本指南,我们使用了 10.8 Debian Buster netinst ISO [1] ,但任何官方的 Buster 安装介质都应该可以使用。

安装标准的 Debian Buster (amd64)

安装一个标准的 Debian Buster,详情参见:https://www.debian.org/releases/stable/amd64/index.en.html ,并配置一个静态 IP。 建议只安装“标准”软件包选择,不要安装其他任何东西,因为 Proxmox VE 为 qemu、lxc 带来了自己的软件包。 不需要桌面环境。

配置静态IP示例

  • 配置文件:/etc/network/interfaces

auto eno1

iface eno1 inet static
    address 192.168.1.100/24
    gateway 192.168.1.254
  • 配置文件:/etc/resolv.conf

nameserver 192.168.1.10
nameserver 192.168.1.11

为您的 IP 地址添加 /etc/hosts 条目

127.0.0.1 localhost.localdomain localhost
192.168.1.100 pve.localdomain pve

测试:

hostname --ip-address192.168.1.100 # should return your IP address here

安装 Proxmox VE

调整您的 sources.list

  • 配置文件:/etc/apt/sources.list

Debian官方存储库:

deb http://ftp.debian.org/debian buster main contribdeb http://ftp.debian.org/debian buster-updates main contrib# security updates#deb http://security.debian.org/debian-security buster-security main contrib

科大镜像存储库:

deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free# deb-src http://mirrors.ustc.edu.cn/debian buster main contrib non-freedeb http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free# deb-src http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free#deb http://mirrors.ustc.edu.cn/debian-security/ buster-security main non-free contrib# deb-src http://mirrors.ustc.edu.cn/debian-security/ buster-security main non-free contrib
  • 添加 Proxmox VE 存储库

PVE官方非订阅存储库:

deb http://download.proxmox.com/debian/pve buster pve-no-subscription

科大镜像存储库:

CODENAME=`cat /etc/os-release |grep CODENAME |cut -f 2 -d "="`echo "deb http://mirrors.ustc.edu.cn/proxmox/debian $CODENAME pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
  • 添加 Proxmox VE 存储库密钥

wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpgchmod +r /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg  # optional, if you have a non-default umask
  • 添加 Ceph 存储库

PVE存储库:

deb http://download.proxmox.com/debian/ceph-octopus buster main

科大镜像存储库:

echo "deb http://mirrors.ustc.edu.cn/proxmox/debian/ceph-octopus/ buster main" > /etc/apt/sources.list.d/ceph_mirror.list
  • 通过运行更新您的存储库和系统

apt updateapt dist-upgrade

安装 Proxmox VE 包

安装 Proxmox VE 软件包:

apt install proxmox-ve postfix open-iscsi

根据您的需要配置需要用户在安装时输入的包(例如 Samba 询问 WINS/DHCP 支持)。 如果您的网络中有邮件服务器,您应该将 postfix 配置为 satellite 系统 , 您现有的邮件服务器将成为 中继主机 ,它将路由由 Proxmox 服务器到他们的最终收件人。

如果您不知道在此处输入什么,请选择 local only 并保留 系统名称 。

最后,重新启动系统,新的 Proxmox VE 内核应该会在 GRUB 菜单中自动选择。

推荐:删除 os-prober 包

os-prober 包扫描你主机的所有分区, 包括分配给来宾 VM 的那些,以创建双引导 GRUB 条目。 如果您没有将 Proxmox VE 安装为另一个旁边的双启动 操作系统,您可以安全地删除 os-prober 包。

apt remove os-prober

安装必要包

apt install ifupdown2 chrony

CLI 安装 Ceph 包(可选)

pveceph install

连接到 Proxmox VE 网络界面

连接到管理 Web 界面 (https://youripaddress:8006)。 如果你是全新安装并且还没有添加任何用户,你应该使用 root 帐户和你的 linux root 密码,并选择“PAM Authentication”登录。

登录后,创建一个名为 vmbr0 的 Linux Bridge,并向其中添加您的第一个网络接口。

故障排除

resolv.conf 被覆盖

PVE GUI 期望控制 DNS 管理,并且不再从 /etc/network/interfaces 获取其 DNS 设置。 任何自动生成(覆盖) /etc/resolv.conf 的包都会导致 DNS 失败, 例如,用于 IPv4 的包“resolvconf”和用于 IPv6 的包“rdnssd”。

ipcc_send_rec[1] failed

如果你看到:

ipcc_send_rec[1] failed: Connection refused

那么您应该检查您的 /etc/hosts 根据上述说明文件。

可选步骤

可选:删除 Debian 内核

apt remove linux-image-amd64 'linux-image-4.19*'

通过运行更新和检查 grub2 配置:

update-grub

附1:集群 Crush 操作

# 修改OSD设备类为ssdceph osd crush rm-device-class osd.0ceph osd crush set-device-class ssd osd.0# 创建存储池规则ceph osd crush rule create-replicated hdd_rule default host hdd  ## 规则名为hdd_rule,root为default,故障域为host,osd设备类型为hddceph osd crush rule create-replicated ssd_rule default host ssd  ## 规则名为ssd_rule,root为default,故障域为host,osd设备类型为ssd# 创建存储池ceph osd pool create hdd_data hdd_rule  ## 存储池名为hdd_data,使用规则为hdd_ruleceph osd pool create ssd_data ssd_rule  ## 存储池名为ssd_data,使用规则为ssd_rule# 启用存储池ceph osd pool application enable hdd_data hdd_data
ceph osd pool application enable ssd_rule ssd_rule

附2:脚本安装示例分享

#!/bin/bash## 脚本名:init_os.sh## 描述:#   - 注意:重复执行此脚本是幂等的#   - 此脚本用于初始化配置 Debian 操作系统,并安装配置所需软件#   - 执行此脚本之前必须保持外网网络畅通,否则无法更新系统和安装软件#   - 运行脚本时,建议使用 tee 命令将输出结果保存一份至日志文件,以便之后排查问题,例如执行:./init_os.sh | tee init_os.log## 作者:Varden### 脚本开始set -uecho "***获取Debian发行版代号***"CODE_NAME=`lsb_release -sc`echo ${CODE_NAME}echo "***指定安装的Ceph发行版代号***"CEPH_CODENAME=pacificecho ${CEPH_CODENAME}## 添加存储库并更新配置系统echo "***添加Debian存储库***"cat << EOF > /etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/debian ${CODE_NAME} main contrib non-free
deb http://mirrors.ustc.edu.cn/debian ${CODE_NAME}-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ ${CODE_NAME}-security main non-free contrib
EOFcat /etc/apt/sources.listecho "***添加Proxmox VE存储库密钥***"if [ ! -e /etc/apt/trusted.gpg.d/proxmox-release-${CODE_NAME}.gpg ];then
    wget https://enterprise.proxmox.com/debian/proxmox-release-${CODE_NAME}.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-${CODE_NAME}.gpg    echo "密钥已下载"else
    echo "密钥已存在"fiecho "***添加Proxmox VE存储库***"echo "deb http://mirrors.ustc.edu.cn/proxmox/debian ${CODE_NAME} pve-no-subscription" | tee /etc/apt/sources.list.d/pve-no-subscription.listif [ -e /etc/apt/sources.list.d/pve-enterprise.list ];then
    rm -f /etc/apt/sources.list.d/pve-enterprise.listfiecho "***添加Ceph存储库***"echo "deb http://mirrors.ustc.edu.cn/proxmox/debian/ceph-${CEPH_CODENAME}/ ${CODE_NAME} main" | tee /etc/apt/sources.list.d/ceph_mirror.listecho "***更新系统***"apt update
apt -y upgradeecho "***安装常用工具***"apt install -y net-tools tree vim wget curl apt-transport-https chronyecho "***修改时区***"timedatectl set-timezone Asia/Shanghai
timedatectl## 安装Proxmox VEecho "***安装Proxmox VE***"apt install -y proxmox-ve postfix open-iscsi## 安装Cephecho "***安装Ceph***"echo 'y' | pveceph install --version ${CEPH_CODENAME}## 移除旧安装包echo "***移除旧安装包***"apt autoremove -y## 脚本结束


本文链接:https://hqyman.cn/post/5026.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: