分类 VPS相关 下的文章

qBittorrent在编译安装或者docker安装的时候经常会碰到一些问题:

1、unauthorized

在config文件中添加:

WebUI\HostHeaderValidation=false
WebUI\CSRFProtection=false

2、invalid Username or Password

遇到这个问题,首先可以更换浏览器尝试,有的更换浏览器就可以正常登录了,如果不行,修改config文件,添加一行:

WebUI\Password_PBKDF2="@ByteArray(ARQ77eY1NUZaQsuDHbIMCA==:0WMRkYTUWVT9wVvdDtHAjU9b3b7uB8NR1Gur2hmQCvCDpm39Q+PsJRJPaCU51dEiz+dTzh8qbPsL8WkFljQYFQ==)"

这样用户名密码就初始化为admin adminadmin
enjoy!

脚本自动检测:一键给PVE增加温度和cpu频率显示,NVME,机械固态硬盘信息

理论上适合任何设备
自动适配传感器数据
自动检测NVME硬盘数量
自动检测机械,固态硬盘数量
自动检测CPU核心数量
微信截图_20231120165427.png

使用方法:

可以一键执行下面:

(curl -Lf -o /tmp/temp.sh https://raw.githubusercontent.com/a904055262/PVE-manager-status/main/showtempcpufreq.sh || curl -Lf -o /tmp/temp.sh https://ghproxy.com/https://raw.githubusercontent.com/a904055262/PVE-manager-status/main/showtempcpufreq.sh) && chmod +x /tmp/temp.sh && /tmp/temp.sh remod

没有显示功耗的,请执行下面的命令安装依赖,请确保安装成功,就是最后的一行的输出,必须为 “成功!” 才表示安装成功了。

apt update ; apt install linux-cpupower && modprobe msr && echo msr > /etc/modules-load.d/turbostat-msr.conf && chmod +s /usr/sbin/turbostat && echo 成功!

如果你已经用别人的脚本之类的修改过页面,请先用下面命令先回复官方设置之后,才可以运行本脚本:

apt update
apt install pve-manager  proxmox-widget-toolkit  --reinstall
rm -f /usr/share/perl5/PVE/API2/Nodes.pm*bak
rm -f  /usr/share/pve-manager/js/pvemanagerlib.js*bak
rm -f /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js*bak

另外:每次pve升级之后都需要执行一次脚本,因为升级后PVE会自己还原文件

以上内容转自MJJ论坛:https://www.right.com.cn/forum/thread-6754687-1-1.html

root@truenas[~]#  zfs destroy -f Data/vmdisk/onething_data
cannot destroy 'Data/vmdisk/onething_data': dataset is busy
root@truenas[~]# zfs unmount Data/vmdisk/onething_data
cannot open 'Data/vmdisk/onething_data': operation not applicable to datasets of this type
root@truenas[~]#  zfs destroy -vrRf Data/vmdisk/onething_data
will destroy Data/vmdisk/onething_data
cannot destroy 'Data/vmdisk/onething_data': dataset is busy
root@truenas[~]# vgdisplay
  --- Volume group ---
  VG Name               XRVDDGN6WDVUD0PT_0641_vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  145
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                22
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <4.00 TiB
  PE Size               4.00 MiB
  Total PE              1048575
  Alloc PE / Size       344576 / 1.31 TiB
  Free  PE / Size       703999 / <2.69 TiB
  VG UUID               XD7g3j-JauF-72VG-TvLm-FWM1-jTcM-1iC0Ee

root@truenas[~]# vgremove XRVDDGN6WDVUD0PT_0641_vg
Do you really want to remove volume group "XRVDDGN6WDVUD0PT_0641_vg" containing 22 logical volumes? [y/n]: y
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/XRVDDGN6WDVUD0PT_0641_vg_lv? [y/n]: y
  Logical volume "XRVDDGN6WDVUD0PT_0641_vg_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620.1_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620.1_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620.2_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620.2_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91.1_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91.1_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91.2_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91.2_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91.3_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91.3_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91.4_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91.4_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91.5_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91.5_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91.6_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91.6_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/99ac742d39f5d3909414d4351ce7af91.7_lv? [y/n]: y
  Logical volume "99ac742d39f5d3909414d4351ce7af91.7_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/5b442b259766008357b638af7d07d18a_lv? [y/n]: y
  Logical volume "5b442b259766008357b638af7d07d18a_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/5b442b259766008357b638af7d07d18a.1_lv? [y/n]: y
  Logical volume "5b442b259766008357b638af7d07d18a.1_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/4738c6ccc7add075d29a891cb2e4578c_lv? [y/n]: y
  Logical volume "4738c6ccc7add075d29a891cb2e4578c_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/2b94f59b1e4d410cc3d338d5043cd10e_lv? [y/n]: y
  Logical volume "2b94f59b1e4d410cc3d338d5043cd10e_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/2b94f59b1e4d410cc3d338d5043cd10e.1_lv? [y/n]: y
  Logical volume "2b94f59b1e4d410cc3d338d5043cd10e.1_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620.3_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620.3_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620.4_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620.4_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620.5_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620.5_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620.6_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620.6_lv" successfully removed
Do you really want to remove active logical volume XRVDDGN6WDVUD0PT_0641_vg/db55d8856e8c789e62fa3263dd1d7620.7_lv? [y/n]: y
  Logical volume "db55d8856e8c789e62fa3263dd1d7620.7_lv" successfully removed
  Volume group "XRVDDGN6WDVUD0PT_0641_vg" successfully removed
root@truenas[~]#  zfs destroy -vrRf Data/vmdisk/onething_data
will destroy Data/vmdisk/onething_data
root@truenas[~]#

安装温度检测工具

CPU 及主板温度检测:lm-sensors

user@pve:~$ sudo apt install lm-sensors

安装完成后执行 sensors-detect 进行传感器探测,通常情况下全部按默认选择 yes 即可

探测完成后执行 sensors -j 测试传感器(参数 -j 使其以 JSON 格式输出)

user@pve:~$ sensors -j
{
   "coretemp-isa-0000":{
      "Adapter": "ISA adapter",
      "Package id 0":{
         "temp1_input": 69.000,
         "temp1_max": 84.000,
         "temp1_crit": 100.000,
         "temp1_crit_alarm": 0.000
      },
      "Core 0":{
         "temp2_input": 69.000,
         "temp2_max": 84.000,
         "temp2_crit": 100.000,
         "temp2_crit_alarm": 0.000
      },
      // ...[OMITTED]...
   },
   "acpitz-acpi-0":{
      "Adapter": "ACPI interface",
      "temp1":{
         "temp1_input": 68.000,
         "temp1_crit": 120.000
      }
   }
}

在如上输出中,['acpitz-acpi-0']['temp1']['temp1_input'] 是主板温度,['coretemp-isa-0000']['Package id 0']['temp1_input'] 是 CPU 温度

硬盘温度检测:hddtemp

user@pve:~$ sudo apt install hddtemp

安装完成后执行 hddtemp /dev/sd? 测试传感器

user@pve:~$ sudo hddtemp /dev/sd?
/dev/sda: WDC WD40EZRZ-00WN9B0: 29°C
/dev/sdb: ADATA SP600: 26°C
/dev/sdc: WD2500: 29°C
/dev/sdd: ADATA SP900: 38°C

由于 PVE 的 web 服务以用户 www-data 身份运行,需要修改 hddtemp 的权限

user@pve:~$ sudo chmod +s /usr/sbin/hddtemp

编辑 PVE web 服务文件

Nodes.pm

编辑文件 /usr/share/perl5/PVE/API2/Nodes.pm,跳转到 my $dinfo = df('/', 1); 位置,编辑成如下所示

# ...[OMITTED]...
        $res->{pveversion} = PVE::pvecfg::package() . "/" .
            PVE::pvecfg::version_text();

        $res->{thermal} = `sensors -j`;  # 添加此行以获取 CPU 与主板等温度
        $res->{thermal_hdd} = `hddtemp /dev/sd?`;  # 添加此行以获取硬盘温度

        my $dinfo = df('/', 1);     # output is bytes
# ...[OMITTED]...

pvemanagerlib.js

修改页面样式以完整显示数据

编辑文件 /usr/share/pve-manager/js/pvemanagerlib.js,跳转到 gettext('Status') + ': ' + zpool, 位置,编辑成如下所示

// ...[OMITTED]...
 var win = Ext.create('Ext.window.Window', {
            modal: true,
            width: 800,
            height: 500,  // 原始值为 400
            resizable: true,
            layout: 'fit',
            title: gettext('Status') + ': ' + zpool,
            items:[{
// ...[OMITTED]...

跳转到 widget.pveNodeStatus 位置,编辑成如下所示

// ...[OMITTED]...
Ext.define('PVE.node.StatusView', {
    extend: 'PVE.panel.StatusView',
    alias: 'widget.pveNodeStatus',

    height: 400,  // 原始值为 300
    bodyPadding: '20 15 20 15',

    layout: {
// ...[OMITTED]...

两处 height 的值需按情况修改,每多一行数据增加 20

例如有 1 行 CPU 与主板温度数据、3 行硬盘温度数据(3 块硬盘),即为 480 与 380

添加显示内容

跳转到 PVE Manager Version 位置,编辑成如下所示

// ...[OMITTED]...
        {
            itemId: 'version',
            colspan: 2,
            printBar: false,
            title: gettext('PVE Manager Version'),
            textField: 'pveversion',
            value: ''
        },  // 注意添加逗号
        {
            itemId: 'thermal',
            colspan: 2,
            printBar: false,
            title: gettext('Thermal Status'),
            textField: 'thermal',
            renderer: function(value) {
              value = JSON.parse(value.replaceAll('Â', ''));
              const cpu0 = value['coretemp-isa-0000']['Package id 0']['temp1_input'].toFixed(1);
              const board = value['acpitz-acpi-0']['temp1']['temp1_input'].toFixed(1);
              // ...获取其他传感器数据

              return `CPU: ${cpu0}°C | Board: ${board}°C`;  // 自行修改输出格式
            }
        },
        {
            itemId: 'thermal-hdd',
            colspan: 2,
            printBar: false,
            title: gettext('HDD Thermal Status'),
            textField: 'thermal_hdd',
            renderer: function(value) {
                value = value.replaceAll('Â', '');
                return value.replaceAll('\n', '<br>');
            }
        }
    ],
// ...[OMITTED]...

其中获取 JSON 数值的表达式(value['...']...['...'].toFixed(1))与最后输出字符串(result)的格式需按实际情况和需求进行修改

完成

执行 systemctl restart pveproxy 重启 PVE web 服务

在浏览器中清除 PVE 控制台的缓存,重新加载即可在节点概要显示温度信息


转自:https://zry.io/archives/285

     Debian10有个很不好的地方,就是命令行安装的时候,如果直接设置的是公网ip,子网为32的时候,是ping通网关的,智能跳过网络设置安装完系统。这样就造成一个问题,安装好的debian10,软件源是不完整的,这时需要我们进行网络设置并手工添加官方软件源。

网络设置

1、查看网卡信息

root@localhost:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 92:5d:68:2d:24:b5 brd ff:ff:ff:ff:ff:ff
    inet xx.xx.xx.xx/32 brd xx.xx.xx.xx scope global ens18
       valid_lft forever preferred_lft forever
    inet6 fe80::905d:68ff:fe2d:24b5/64 scope link
       valid_lft forever preferred_lft forever
3: ens19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 22:94:4f:27:91:a8 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.200/24 brd 10.0.0.255 scope global ens19
       valid_lft forever preferred_lft forever
    inet6 fe80::2094:4fff:fe27:91a8/64 scope link
       valid_lft forever preferred_lft forever
root@localhost:~#

我这是已经配置好的,没有配置应该只显示ens18,ens19接口名字,是没有IP地址的,记下网路接口名称。

2、设置网络

root@localhost:~# nano /etc/network/interfaces

打开文件后加入设置


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
address xx.xx.xx.xx
netmask 255.255.255.255
gateway 100.64.xx.xx

auto ens19
iface ens19 inet dhcp

以上设置根据需求,ens18为静态地址,ens19为dhcp自动获取

添加软件园

nano /etc/apt/sources.list

打开文件后加入以下内容

deb http://ftp.debian.org/debian/ buster main contrib non-free
deb-src http://ftp.debian.org/debian/ buster main contrib non-free
deb http://ftp.debian.org/debian/ buster-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ buster-updates main contrib non-free
deb http://ftp.debian.org/debian/ buster-backports main contrib non-free
deb-src http://ftp.debian.org/debian/ buster-backports main contrib non-free

deb http://security.debian.org/ buster/updates main contrib non-free
deb-src http://security.debian.org/ buster/updates main contrib non-free

如果时国内的主机,也可以找国内的源替换

常用安装源站点列表

163镜像站

deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

deb-src http://mirrors.163.com/debian/ buster main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

华为云镜像站

deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free

deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free 

腾讯云镜像站

deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

中科大镜像站

deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

deb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

阿里云镜像站

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

清华大学镜像站

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free

deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free

兰州大学镜像站

deb http://mirror.lzu.edu.cn/debian stable main contrib non-free
deb http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
deb http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
deb http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free

deb-src http://mirror.lzu.edu.cn/debian stable main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
deb-src http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free

上海交大镜像站

deb https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
deb https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free

deb-src https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
deb-src https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free