AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-389024

Stonecraft's questions

Martin Hope
Stonecraft
Asked: 2020-10-23 08:20:13 +0800 CST

如何在 nginx 和应用程序之间的后端正确配置 SSL?

  • 0

我正在尝试在后端配置重新加密,以便 nginx 和上游应用程序之间的流量与用户和 nginx 之间的流量分开加密。出于测试示例的目的,我使用的是:https ://github.com/jlengstorf/tutorial-deploy-nodejs-ssl-digitalocean-app.git. 我已经阅读了很多线程,但我总是得到错误 502:错误网关。另外,我不确定它是多么偏执,甚至为此烦恼。一切都在一个主机上,但我将运行多个服务,我的理由是它们中的任何一个都可能存在漏洞,并且每个应用程序都可以通过不同的证书与 nginx 通信来减轻这种风险。为使示例简单,我只对 Everything 使用了一个键。显然,如果我真的这样做,我将为每个重新加密实例制作一个新证书。我是网络托管和考虑安全性的新手,所以如果我在上面说了任何令人毛骨悚然的话,请告诉我。

mydomain.conf

# HTTP — redirect all traffic to HTTPS
server {
    listen 443 ssl;
    server_name 127.0.0.1:5000;
    ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
    root /var/www/html;
    index test_index.html;
    return 301 https://$host$request_uri;
}


# HTTPS — proxy all requests to the Node app
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name mydomain.com;
    root /var/www/html;
    index test_index.html;
    # Use the Let’s Encrypt certificates
    ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
    # Include the SSL configuration from cipherli.st
    include snippets/ssl-params.conf;
    location /app {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass https://localhost:5000/;
        proxy_ssl_verify on;
        proxy_ssl_trusted_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
        proxy_ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;
        proxy_ssl_session_reuse off;
        proxy_set_header Host $http_host;
        proxy_cache_bypass $http_upgrade;
        proxy_redirect off;
    }
}

/var/nginx/error.log 中的相应错误:

2020/10/22 16:17:13 [error] 11311#11311: *1 SSL_do_handshake() failed
(SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
) while SSL handshaking to upstream, client: xx.xxx.xx.xx, server: the
3guys.com, request: "GET /app HTTP/1.1", upstream: "https://127.0.0.1:
5000/", host: "mydomain.com"


在 nginx 站点 conf 中包含的 ssl-params.conf 片段中,我设置为使用我知道的所有 TLS 版本:

ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl nginx reverse-proxy backend
  • 1 个回答
  • 5940 Views
Martin Hope
Stonecraft
Asked: 2020-07-11 05:48:16 +0800 CST

Ubuntu 20.04 时间同步问题和可能不正确的状态信息

  • 5

我在我的 KVM 主机(Lubuntu 20.04)上遇到了一些崩溃问题,在进行故障排除时,我注意到了一些与时间相关的错误。

经过进一步调查,令我惊恐的是,我发现时间没有同步。我确定它是以前设置的,我不知道它是如何变为未设置的。

admin@virtland:~$ sudo timedatectl
[sudo] password for admin: 
               Local time: Fri 2020-07-10 09:14:14 EDT  
           Universal time: Fri 2020-07-10 13:14:14 UTC  
                 RTC time: Fri 2020-07-10 13:14:14      
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: no                           
              NTP service: n/a                          
          RTC in local TZ: no                           
admin@virtland:~$ 

我找到了这个线程并尝试了最佳答案,但无济于事。 https://askubuntu.com/questions/929805/timedatectl-ntp-sync-cannot-set-to-yes

admin@virtland:~$ sudo systemctl stop ntp
admin@virtland:~$ sudo ntpd -gq
10 Jul 09:17:57 ntpd[34358]: ntpd [email protected] (1): Starting
10 Jul 09:17:57 ntpd[34358]: Command line: ntpd -gq
10 Jul 09:17:57 ntpd[34358]: proto: precision = 0.070 usec (-24)
10 Jul 09:17:57 ntpd[34358]: leapsecond file ('/usr/share/zoneinfo/leap-seconds.list'): good hash signature
10 Jul 09:17:57 ntpd[34358]: leapsecond file ('/usr/share/zoneinfo/leap-seconds.list'): loaded, expire=2020-12-28T00:00:00Z last=2017-01-01T00:00:00Z ofs=37
10 Jul 09:17:57 ntpd[34358]: Listen and drop on 0 v6wildcard [::]:123
10 Jul 09:17:57 ntpd[34358]: Listen and drop on 1 v4wildcard 0.0.0.0:123
10 Jul 09:17:57 ntpd[34358]: Listen normally on 2 lo 127.0.0.1:123
10 Jul 09:17:57 ntpd[34358]: Listen normally on 3 enp6s0 10.0.0.18:123
10 Jul 09:17:57 ntpd[34358]: Listen normally on 4 lo [::1]:123
10 Jul 09:17:57 ntpd[34358]: Listen normally on 5 enp6s0 [fe80::7285:c2ff:fe65:9f19%3]:123
10 Jul 09:17:57 ntpd[34358]: Listening on routing socket on fd #22 for interface updates
10 Jul 09:17:58 ntpd[34358]: Soliciting pool server 209.50.63.74
10 Jul 09:17:59 ntpd[34358]: Soliciting pool server 4.53.160.75
10 Jul 09:18:00 ntpd[34358]: Soliciting pool server 69.89.207.199
10 Jul 09:18:00 ntpd[34358]: Soliciting pool server 72.30.35.88
10 Jul 09:18:01 ntpd[34358]: Soliciting pool server 173.0.48.220
10 Jul 09:18:01 ntpd[34358]: Soliciting pool server 162.159.200.1
10 Jul 09:18:01 ntpd[34358]: Soliciting pool server 108.61.73.243
10 Jul 09:18:02 ntpd[34358]: Soliciting pool server 208.79.89.249
10 Jul 09:18:02 ntpd[34358]: Soliciting pool server 208.67.75.242
10 Jul 09:18:02 ntpd[34358]: Soliciting pool server 91.189.94.4
10 Jul 09:18:03 ntpd[34358]: Soliciting pool server 91.189.89.198
10 Jul 09:18:03 ntpd[34358]: Soliciting pool server 67.217.112.181
10 Jul 09:18:04 ntpd[34358]: Soliciting pool server 91.189.89.199
10 Jul 09:18:04 ntpd[34358]: Soliciting pool server 64.225.34.103             
10 Jul 09:18:05 ntpd[34358]: Soliciting pool server 91.189.91.157             
10 Jul 09:18:06 ntpd[34358]: Soliciting pool server 2001:67c:1560:8003::c8    
10 Jul 09:18:06 ntpd[34358]: ntpd: time slew +0.001834 s                      
ntpd: time slew +0.001834s                                                    
admin@virtland:~$ sudo service ntp start                                       
admin@virtland:~$ sudo timedatectl                             
               Local time: Fri 2020-07-10 09:18:21 EDT                        
           Universal time: Fri 2020-07-10 13:18:21 UTC                        
                 RTC time: Fri 2020-07-10 13:18:21                            
                Time zone: America/New_York (EDT, -0400)                      
System clock synchronized: no                                                 
              NTP service: n/a                                                
          RTC in local TZ: no                                                 
admin@virtland:~$                  

我想也许我需要使用一些最新的指令,所以我尝试了这个: https ://linuxconfig.org/how-to-sync-time-on-ubuntu-20-04-focal-fossa-linux

admin@virtland:~$ timedatectl set-ntp off
Failed to set ntp: NTP not supported                                          
admin@virtland:~$ timedatectl set-ntp on
Failed to set ntp: NTP not supported                                          

然后我从另一个线程尝试了这个:

admin@virtland:~$ sudo systemctl status systemd-timesyncd.service
[sudo] password for admin: 
● systemd-timesyncd.service
     Loaded: masked (Reason: Unit systemd-timesyncd.service is masked.)
     Active: inactive (dead)

我从未接触过 timesyncd.conf,但无论如何它都被完全注释掉了:

cat /etc/systemd/timesyncd.conf                         
#  This file is part of systemd.                                              
#                                                                             
#  systemd is free software; you can redistribute it and/or modify it         
#  under the terms of the GNU Lesser General Public License as published by   
#  the Free Software Foundation; either version 2.1 of the License, or        
#  (at your option) any later version.                                        
#                                                                             
# Entries in this file show the compile time defaults.                        
# You can change settings by editing this file.                               
# Defaults can be restored by simply deleting this file.                      
#                                                                             
# See timesyncd.conf(5) for details.                                          
                                                                              
[Time]                                                                        
#NTP=                                                                         
#FallbackNTP=ntp.ubuntu.com                                                   
#RootDistanceMaxSec=5                                                         
#PollIntervalMinSec=32                                                        
#PollIntervalMaxSec=2048 

我再次检查了 timedatectl,现在它打开了,但仍然没有使用 NTP。我知道 NTP 更精确,这在某些情况下可能很重要。不确定带有 pci 直通的虚拟化是否需要非常精确的时间。

从我正在阅读的其他内容中,我认为 NTP 可能与 timesyncd 冲突。所以暂时去掉ntp:

sudo systemctl stop ntp
sudo apt-get purge ntp

但在清除 ntp 后,NTP 显示为活动状态!

admin@virtland:~$ timedatectl
               Local time: Fri 2020-07-10 09:34:52 EDT  
           Universal time: Fri 2020-07-10 13:34:52 UTC  
                 RTC time: Fri 2020-07-10 13:34:52      
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes                          
              NTP service: active                       
          RTC in local TZ: no     

我要疯了吗?NTP 是否还在这里?没有。

admin@virtland:~$ sudo systemctl start ntp
Failed to start ntp.service: Unit ntp.service not found.

很抱歉没有提出更集中的问题,但这里到底发生了什么?

我很好,真的迷路了。另外,我稍后会编辑这篇文章,并就删除 NTP(并因此激活它?!)是否解决了导致我陷入这个兔子洞的稳定性问题做出了一个不回答。

编辑:我做的下一件事是在 timesyncd 上禁用 ntp 并(重新)安装 NTP,如此处所述。https://www.digitalocean.com/community/tutorials/how-to-set-up-time-synchronization-on-ubuntu-18-04

结果是:

admin@virtland:~$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.us.pool.ntp.o .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.us.pool.ntp.o .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.us.pool.ntp.o .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.us.pool.ntp.o .POOL.          16 p    -   64    0    0.000    0.000   0.000
 0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 ntp.ubuntu.com  .POOL.          16 p    -   64    0    0.000    0.000   0.000
admin@virtland:~$ timedatectl
               Local time: Fri 2020-07-10 10:35:39 EDT  
           Universal time: Fri 2020-07-10 14:35:39 UTC  
                 RTC time: Fri 2020-07-10 14:35:40      
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: no                                                 
              NTP service: n/a                                                
          RTC in local TZ: no                                                 
admin@virtland:~$ systemctl status systemd-timesyncd 
● systemd-timesyncd.service                                                   
     Loaded: masked (Reason: Unit systemd-timesyncd.service is masked.)       
     Active: inactive (dead)                                                  
admin@virtland:~$ nano /etc/ntp.conf
admin@virtland:~$ systemctl status systemd-timesyncd                           
● systemd-timesyncd.service                                                   
     Loaded: masked (Reason: Unit systemd-timesyncd.service is masked.)       
     Active: inactive (dead)                                                  
admin@virtland:~$ ntpstat
unsynchronised                                                                
   polling server every 8 s 

我按照 Michael Hampton 的建议撤销了这些更改:这是否意味着它正在工作?

boss@virtland:~$ sudo systemctl stop ntp
Failed to stop ntp.service: Unit ntp.service not loaded.
boss@virtland:~$ sudo timedatectl set-ntp yes
boss@virtland:~$ sudo timedatectl set-ntp on
boss@virtland:~$ ntpq -p
bash: /usr/bin/ntpq: No such file or directory
boss@virtland:~$ systemctl status systemd-timesyncd 
● systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; >
     Active: active (running) since Fri 2020-07-10 10:49:18 EDT; 50s ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 108365 (systemd-timesyn)
     Status: "Initial synchronization to time server 91.189.94.4:123 (ntp.ubu>
      Tasks: 2 (limit: 154317)
     Memory: 1.8M
     CGroup: /system.slice/systemd-timesyncd.service
             └─108365 /lib/systemd/systemd-timesyncd

Jul 10 10:49:17 virtland systemd[1]: Starting Network Time Synchronization...
Jul 10 10:49:18 virtland systemd[1]: Started Network Time Synchronization.
Jul 10 10:49:18 virtland systemd-timesyncd[108365]: Initial synchronization t>
lines 1-14/14 (END)
 timedatectl
               Local time: Fri 2020-07-10 10:52:56 EDT  
           Universal time: Fri 2020-07-10 14:52:56 UTC  
                 RTC time: Fri 2020-07-10 14:52:56      
                Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes                          
              NTP service: active                       
          RTC in local TZ: no            

所以我想它正在工作。由于让我走上这条道路的崩溃仍在发生,我想时间不是问题。

ubuntu ntp time-synchronization systemd-timesyncd
  • 1 个回答
  • 30420 Views
Martin Hope
Stonecraft
Asked: 2020-06-13 12:32:10 +0800 CST

对于 ZFS 根安装,哪些分区需要是 `canmount=noauto`,为什么?

  • 0

使用 ZFS 根安装,需要哪些分区canmount=noauto,为什么?

我正在查看全新安装的 Ubuntu 20.04,并在 root 上安装了 ZFS。我 在 openzfs 站点上使用这些说明,但是有一件我不明白的事情困扰着我。

从指南:

3.2 为根文件系统和引导文件系统创建文件系统数据集:

zfs create -o canmount=noauto -o mountpoint=/ rpool/ROOT/ubuntu
zfs mount rpool/ROOT/ubuntu

zfs create -o canmount=noauto -o mountpoint=/boot bpool/BOOT/ubuntu
zfs mount bpool/BOOT/ubuntu

对于 ZFS,通常不需要使用 mount 命令(mount 或 zfs mount)。这种情况是一个例外,因为 canmount=noauto。

我了解这noauto意味着需要 fstab 或 mount 命令来挂载卷。但我不明白为什么对于某些数据集而不是其他数据集是必要的/推荐的。有人可以帮我理解吗?

ubuntu installation zfs zfsonlinux automount
  • 1 个回答
  • 387 Views
Martin Hope
Stonecraft
Asked: 2019-07-13 05:50:43 +0800 CST

virt-install 挂起并且不会死。如何安全停车?

  • 1

我遇到了一个问题,即 virt-install 卡在早期阶段并且无法被杀死(在说“开始安装”之后,但在虚拟机在 virt-manager 中可见之前)。

Ctrl-C 不能取消 virt-install,systemctl restart libvirtd只会挂起。我必须硬重启机器。甚至kill $libvirtPID只是挂起。如果我重新启动,重新启动会挂起一条消息kvm: exiting hardware virtualization,我必须硬重新启动。

目前,我不是在寻求有关挂起原因的帮助,而是我想知道是否有更好/更安全的方法来取消冻结的 virt-install。

kvm-virtualization
  • 1 个回答
  • 1131 Views
Martin Hope
Stonecraft
Asked: 2019-02-21 18:23:19 +0800 CST

升级 qemu 后,“不支持的机器类型 'pc-i440fx-3.1”

  • 0

我最近安装了 QEMU 的最新版本(3.1.0),但我一直无法让 virt-manager 正常工作,大概是因为它没有连接到正确的依赖项。此线程中描述了我的其他一些麻烦。

我运行以下命令:

~$ virt-install \
> --name myWINVM \
> --boot uefi \
> --ram 32768 \
> --graphics vnc,listen=0.0.0.0 \
> --machine pc \
> --features kvm_hidden=on \
> --hostdev 9:00.0,address.type=pci,address.multifunction=on \
> --hostdev 9:00.1,address.type=pci \
> --hostdev 0a:00.0,address.type=pci,address.multifunction=on \
> --machine pc \
> --vcpus 4 \
> --os-type windows \
> --os-variant win10 \
> --network bridge=virbr0 \
> --console pty,target_type=serial \
> --disk /home/boss/Downloads/Win10_1809Oct_English_x64.iso,device=cdrom \
> --disk /home/boss/Downloads/virtio-win-0.1.164.iso,device=cdrom \
> --disk path=/home/boss/testVM/WINVM.img,bus=virtio,size=120

我的输出是这样的:

Starting install...
Allocating 'WINVM.img'                                      | 120 GB  00:04     
ERROR    internal error: process exited while connecting to monitor: 2019-02-21T01:58:56.827372Z qemu-system-x86_64: -enable-kvm: unsupported machine type 'pc-i440fx-3.1'
Use -machine help to list supported machines
Removing disk 'WINVM.img'                                   |    0 B  00:00     
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start myWINVM
otherwise, please restart your installation.

除了尝试 git 版本的 qemu,我还尝试从SPICE 网站构建当前的 SPICE 服务器:

注意:如果我指定 q35,我会得到完全相同的错误:

~$ virt-install \
> --name myWINVM \
> --boot uefi \
> --ram 32768 \
> --graphics vnc,listen=0.0.0.0 \
> --machine q35 \
> --features kvm_hidden=on \
> --hostdev 9:00.0,address.type=pci,address.multifunction=on \
> --hostdev 9:00.1,address.type=pci \
> --hostdev 0a:00.0,address.type=pci,address.multifunction=on \
> --machine pc \
> --vcpus 4 \
> --os-type windows \
> --os-variant win10 \
> --network bridge=virbr0 \
> --console pty,target_type=serial \
> --disk /home/boss/Downloads/Win10_1809Oct_English_x64.iso,device=cdrom \
> --disk /home/boss/Downloads/virtio-win-0.1.164.iso,device=cdrom \
> --disk path=/home/boss/testVM/WINVM.img,bus=virtio,size=120

Starting install...
Allocating 'WINVM.img'                                      | 120 GB  00:04     
ERROR    internal error: process exited while connecting to monitor: 2019-02-21T04:08:50.597025Z qemu-system-x86_64: -enable-kvm: unsupported machine type 'pc-i440fx-3.1'
Use -machine help to list supported machines
Removing disk 'WINVM.img'                                   |    0 B  00:00     
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start myWINVM
otherwise, please restart your installation.

编辑:我认为问题一定出在 virt-manager 上,因为我能够创建一个 qemu 系统并使用 VNC 使用以下命令查看它:

sudo qemu-system-x86_64 \
> -name WINVM,process=WINVM \
> -machine type=q35,accel=kvm \
> -smp 4,sockets=1,cores=2,threads=2 \
> -m 16G \
> -rtc clock=host,base=localtime \
> -serial none \
> -vga qxl \
> -parallel none \
> -boot order=dc \
> -drive file=/home/boss/Downloads/virtio-win-0.1.164.iso,index=1,media=cdrom \
> -drive file=/home/boss/Downloads/virtio-win-0.1.164.iso,index=2,media=cdrom
qemu-system-x86_64: This family of AMD CPU doesn't support hyperthreading(2). Please configure -smp options properly or try enabling topoext feature.
VNC server running on ::1:5900

编辑:我的下一步将是从一个新的主机系统从头开始,之前手动构建和安装所有最新的软件组件。那就是 QEMU、libvirt、virt-manager 和 spice-server.. 我忘记了什么吗?我应该做些什么来确保我正在构建的软件包能够找到彼此?

无论如何,如果失败了,我可能会认输并返回存储库版本,即使它有一些问题。

更新:我无法让手动编译的 qemu、libvirtd 和 virt-manager 一起工作,因此决定认输(暂时)。如果启动这整个事情的重置错误太烦人了,也许我会抛开一切,尝试 Arch。

virtualization
  • 2 个回答
  • 10191 Views
Martin Hope
Stonecraft
Asked: 2019-02-07 02:56:31 +0800 CST

PCI 设备的 ID 指的是什么,哪些与设置直通相关?

  • 1

在使用 virsh 设置域时,我一直认为 PCI 卡的“插槽”是指它所在的主板上的哪个插槽。但是,情况似乎并非如此,而是分配了两个不同物理插槽中的卡virsh 到同一个“槽”。前两个设备是 GTX 1070 的一部分,第三个是 Sonnet PCI USB 卡。

另外,这两个不同的总线 ID 是什么?第一个的bus ID是67还是43?

~$ virsh nodedev-dumpxml pci_0000_43_00_0
<device>
  <name>pci_0000_43_00_0</name>
  <path>/sys/devices/pci0000:40/0000:40:01.3/0000:43:00.0</path>
  <parent>pci_0000_40_01_3</parent>
  <driver>
    <name>nouveau</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>67</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x1b81'>GP104 [GeForce GTX 1070]</product>
    <vendor id='0x10de'>NVIDIA Corporation</vendor>
    <iommuGroup number='39'>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x0'/>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x1'/>
    </iommuGroup>
    <pci-express>
      <link validity='cap' port='0' speed='8' width='16'/>
      <link validity='sta' speed='2.5' width='8'/>
    </pci-express>
  </capability>
</device>

~$ virsh nodedev-dumpxml pci_0000_43_00_1
<device>
  <name>pci_0000_43_00_1</name>
  <path>/sys/devices/pci0000:40/0000:40:01.3/0000:43:00.1</path>
  <parent>pci_0000_40_01_3</parent>
  <driver>
    <name>snd_hda_intel</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>67</bus>
    <slot>0</slot>
    <function>1</function>
    <product id='0x10f0'>GP104 High Definition Audio Controller</product>
    <vendor id='0x10de'>NVIDIA Corporation</vendor>
    <iommuGroup number='39'>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x0'/>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x1'/>
    </iommuGroup>
    <pci-express>
      <link validity='cap' port='0' speed='8' width='16'/>
      <link validity='sta' speed='2.5' width='8'/>
    </pci-express>
  </capability>
</device>

~$ virsh nodedev-dumpxml pci_0000_0a_00_0
<device>
  <name>pci_0000_0a_00_0</name>
  <path>/sys/devices/pci0000:00/0000:00:03.1/0000:0a:00.0</path>
  <parent>pci_0000_00_03_1</parent>
  <driver>
    <name>xhci_hcd</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>10</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x1242'>ASM1142 USB 3.1 Host Controller</product>
    <vendor id='0x1b21'>ASMedia Technology Inc.</vendor>
    <iommuGroup number='18'>
      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
    </iommuGroup>
    <numa node='0'/>
    <pci-express>
      <link validity='cap' port='1' speed='5' width='2'/>
      <link validity='sta' speed='5' width='2'/>
    </pci-express>
  </capability>
</device>
kvm-virtualization
  • 1 个回答
  • 1140 Views
Martin Hope
Stonecraft
Asked: 2018-12-09 13:47:47 +0800 CST

ZFS 未安装到升级的内核 (4.19)

  • 2

我想在 Ubuntu Server 18.04 上使用最新的内核(目前是 4.19),我也想使用 ZFS。

尽管 ZFS 似乎安装正确,但它显然没有安装到正确的内核中。我需要做些什么才能让像 ZFS 这样的内核模块安装到正确的内核中吗?还是我需要专门为我的内核构建它,直到提供反向端口?

另外,我确实在安装 ZFS 之前安装了新内核。以前我曾尝试在安装 ZFS 后升级内核,这会破坏 ZFS 并在我尝试从该版本重新安装它时给我一个“没有安装候选者”的消息。

~$ zpool list
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.
~$ sudo /sbin/modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/4.19.6-041906-generic
~$ sudo apt install -y zfsutils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'zfsutils-linux' instead of 'zfsutils'
zfsutils-linux is already the newest version (0.7.5-1ubuntu16.4).
0 upgraded, 0 newly installed, 0 to remove and 127 not upgraded.
~$ sudo apt install zfs-initramfs 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
zfs-initramfs is already the newest version (0.7.5-1ubuntu16.4).
0 upgraded, 0 newly installed, 0 to remove and 127 not upgraded.

~$ ls /lib/modules/4.15.0-29-generic/kernel
arch   crypto   fs      lib  net    ubuntu  zfs
block  drivers  kernel  mm   sound  virt
~$ ls /lib/modules/4.19.6-041906-generic/kernel
arch  block  crypto  drivers  fs  kernel  lib  mm  net  sound  virt
zfs
  • 1 个回答
  • 592 Views
Martin Hope
Stonecraft
Asked: 2018-11-09 15:30:35 +0800 CST

ZFS 测试回滚未按预期工作

  • 4

我对 ZFS 快照和回滚应该如何工作感到困惑。我有一个包含几个 zvol 的 zpool(每个 zvol 都由 mirrorvdev 的分区组成)。我制作这样的快照:

~$ sudo zfs snapshot nvme-tank@roll_test

然后我启动位于 zpool 中一个 zvol 上的 VM 并创建一个测试文件

~$ echo "This is a test of the rollback system" > rbtest.txt

然后我关闭虚拟机并进行回滚。据我了解这个概念,回滚应该将 nvme-tank 中的所有内容恢复到我拍摄快照时的状态,然后再制作 rbtest.txt。

~$ sudo zfs rollback nvme-tank@roll_test

然后我重新启动虚拟机,检查 rbtest.txt,它就在那里,仍然在那里! 在此处输入图像描述

快照在那里:

~$ zfs list -t all -r nvme-tank
NAME                  USED  AVAIL  REFER  MOUNTPOINT
nvme-tank             887G  12.1G    24K  /media/nvme-tank
nvme-tank@nov82018      0B      -    24K  -
nvme-tank@roll_test     0B      -    24K  -
nvme-tank/ext4-zvol   474G   449G  37.8G  -
nvme-tank/ntfs-zvol   413G  23.9G   401G  -

那么,我是否误解了快照应该做什么,错误地使用它们,或者我的 zfs 有什么问题?

zfs
  • 1 个回答
  • 1708 Views
Martin Hope
Stonecraft
Asked: 2018-10-21 05:09:45 +0800 CST

Clear Linux 的显然成功的 virt-install 无法启动

  • 0

首先,我用 virt-install 创建了一个清晰的 linux vm

virt-install \
--name CLEAR \
--ram 65536 \
--disk path=/guest_images/Linux_main/CLEAR.img,bus=virtio,size=450 \
--vcpus 8 \
--os-type linux \
--os-variant generic \
--network bridge=virbr0 \
--graphics vnc  \
--console pty,target_type=serial \
--cdrom /media/big-tank-8TB/OSISOS/clear-25720-installer.iso

安装程序启动,我选择了唯一可用的设备“vda”,我假设它必须是 CLEAR.img 文件,所以我选择在那里创建一个分区并安装(另外,不确定为什么没有分区显示,这个 img 是打开的我之前格式化为 ext4 的 zvol) 在此处输入图像描述

安装程序显然已成功完成。

在此处输入图像描述

但重启后,我卡在 Seabios “从硬盘启动”

在此处输入图像描述

我尝试将驱动器接口从 virtio 更改为 ide,但没有帮助。不知道接下来要尝试什么。

我还尝试了可以​​启动的 Clear Linux 网站上的这些说明,但是在通过 vnc 连接时遇到了问题,并且与我的问题更相关,当我尝试 virt-install 启动提供的 .img 文件时,我得到了我通过.iso安装后得到的永远是相同的seabios“从硬盘引导”。我怀疑问题可能是我需要像 Clear Linux 说明中那样提供 UEFI 文件,但我不确定在使用 virsh 和现有 VM 时如何执行此操作。

kvm-virtualization
  • 1 个回答
  • 994 Views
Martin Hope
Stonecraft
Asked: 2017-03-09 10:42:10 +0800 CST

除了托管 VM,KVM 主机是否应该做其他事情?(如 ZFS)?

  • 1

在虚拟机管理程序与来宾操作系统中运行资源密集型服务对性能和稳定性有何影响?

我想设置一个同时具有 Linux 和 Windows 的工作站,由(可能)KVM 托管。两者都将使用一些相同的服务:例如,VM 将存储在 zvols 上并共享一个专门用于文件存储的 zpool。

我一直在决定哪些服务在管理程序操作系统中运行,哪些服务在虚拟机中运行。如果我将 ZFS 之类的服务放在 VM 中,我担心它们可能会更慢(因为它们必须通过虚拟机管理程序工作)或更容易出错,因为它们将依赖于控制器传递(还有一件事有问题和)。

另一方面,我担心过多的额外任务给虚拟机管理程序带来负担会导致问题,而且我也担心如果我不将 ZFS 放入具有定义限制的虚拟机中会消耗多少内存(我我正在考虑将 32 Gb 用于运行 ZFS 的任何操作系统。而且我担心在管理程序中安装太多东西会导致更可能影响整个系统的冲突(因为这些冲突会发生在管理程序内部)。

optimization kvm-virtualization memory zfs hypervisor
  • 1 个回答
  • 314 Views
Martin Hope
Stonecraft
Asked: 2017-01-13 14:10:37 +0800 CST

虚拟机和双插槽设置:最大限度地减少 CPU 到 CPU 通信的需求

  • 0

我计划构建一个由(可能)KVM 监督的多操作系统工作站,我将在其上执行各种任务。其中一些任务比其他任务更适合多线程,所以我想尽可能地最大化时钟速度。为此,我正在考虑双插槽设置的优缺点,以便在相同数量的内核下获得更高的时钟速度。但是,据我了解,双插槽构建的实用性受到 CPU 之间缓慢通信的限制。所以我的想法是,如果我智能地分配资源,双插槽可能会很好,但如果不是,那可能是一场灾难。

所以这里有一些我想了解的事情:

  1. 如果主机操作系统专门使用一个套接字,而主动使用的客户机专门使用另一个套接字,那么这两个套接字需要多少通信?

  2. 虚拟机管理程序从访问更多内核中受益多少?

  3. 在 CPU 插槽与 CPU 内核之间分配资源方面,KVM(或其他管理程序)有多聪明?是否有一些事情我应该手动设置,而其他一些事情我应该由管理程序决定?

一个重要的考虑因素是,在任何给定时间,只有一个或最多两个 VM 需要大量资源,其他两个或三个在任何时候都应该很轻。

virtualization kvm-virtualization hypervisor cpu-usage multi-threading
  • 1 个回答
  • 740 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve