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-165115

Laurent's questions

Martin Hope
Laurent
Asked: 2020-09-25 23:12:50 +0800 CST

Systemd:在 ZFS 导入之前解锁驱动器

  • 0

除此之外,我还有 LUKS 加密驱动器和 ZFS。我使用脚本在启动时解锁驱动器。我为此做了一个 systemd 服务,但是脚本需要一些时间,并且 zfs-import-cache.service 在我的脚本完成之前启动。

  • zfs-import-cache.service Journalctl
# journalctl -e -u cryptdisks-unlock.service -u zfs-import-cache.service
Sep 25 15:53:45 server systemd[1]: Starting Unlock LUKS drives...
Sep 25 15:53:45 server boot[1216]: Decrypting evo850m21-crypt ...
Sep 25 15:53:47 server systemd[1]: Starting Import ZFS pools by cache file...
Sep 25 15:53:47 server boot[1216]: Device evo850m21-crypt decrypted.
Sep 25 15:53:47 server boot[1216]: Decrypting evo850m22-crypt ...
Sep 25 15:53:49 server boot[1216]: Device evo850m22-crypt decrypted.
Sep 25 15:53:49 server boot[1216]: Decrypting st30001-crypt ...
Sep 25 15:53:50 server zpool[1390]: cannot import 'data': no such pool or dataset
Sep 25 15:53:51 server zpool[1390]:         Destroy and re-create the pool from
Sep 25 15:53:51 server zpool[1390]:         a backup source.
Sep 25 15:53:51 server systemd[1]: zfs-import-cache.service: Main process exited, code=exited, status=1/FAILURE
Sep 25 15:53:51 server systemd[1]: zfs-import-cache.service: Failed with result 'exit-code'.
Sep 25 15:53:51 server systemd[1]: Failed to start Import ZFS pools by cache file.
Sep 25 15:53:52 server boot[1216]: Device st30001-crypt decrypted.
Sep 25 15:53:52 server boot[1216]: Decrypting st30002-crypt ...
Sep 25 15:53:54 server boot[1216]: Device st30002-crypt decrypted.
Sep 25 15:53:54 server systemd[1]: cryptdisks-unlock.service: Succeeded.
Sep 25 15:53:54 server systemd[1]: Finished Unlock LUKS drives.

cryptdisks-unlock.service

[Unit]
Description=Unlock LUKS drives
Before=zfs-import.target

[Service]
Type=oneshot
ExecStart=/usr/local/cryptdisks-tools/boot

[Install]
WantedBy=zfs-import-cache.service
systemd systemd-service
  • 1 个回答
  • 348 Views
Martin Hope
Laurent
Asked: 2020-07-24 04:23:23 +0800 CST

Ubuntu Lenovo Server 重启需要 3 小时

  • 1

从月初开始,内核更改后自动重启需要... 3 小时。

它是数据中心中的联想 Thinksystem 服务器。

journalctl -b -1以。。结束:

juil. 23 03:02:25 host systemd-shutdown[1]: Sending SIGTERM to remaining processes...
juil. 23 03:02:25 host systemd-journald[658]: Journal stopped

并journalctl -b开始:

juil. 23 06:16:26 host kernel: microcode: microcode updated early to revision 0x2006906, date = 2020-04-24
juil. 23 06:16:26 host kernel: Linux version 4.15.0-112-generic (buildd@lcy01-amd64-027) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 (U
juil. 23 06:16:26 host kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-112-generic root=UUID=7b9c74b1-d80e-457e-957a-32be0fca891e ro

我有一个GRUB_TIMEOUT=0所以我不知道可能是什么问题。

编辑:

一件奇怪的事情是lshw用于显示服务器模型:

product: ThinkSystem SR590 -[7X99CTO1WW]- (7X99CTO1WW)
vendor: Lenovo
version: 04

现在:

    description: Rack Mount Chassis
    product: -[none]- (none)
    vendor: Lenovo
    version: none
    serial: none
    width: 64 bits
    capabilities: smbios-3.2 dmi-3.2 smp vsyscall32
    configuration: boot=normal chassis=rackmount family=ThinkSystem sku=none
  *-core
       description: Motherboard
       product: -[none]-
       vendor: Lenovo
       physical id: 0
       version: none
       serial: none
       slot: none
     *-firmware
          description: BIOS
          vendor: Lenovo
          physical id: 0
          version: -[TEE128O-1.51]-
          date: 10/30/2018
          size: 64KiB
          capacity: 15MiB
          capabilities: pci pnp upgrade shadowing cdboot bootselect edd int14serial acpi usb biosbootspecification uefi
     *-cpu:0
          description: CPU
          product: Intel(R) Xeon(R) Silver 4110 CPU @ 2.10GHz

编辑2:

它似乎在该屏幕上停留了几个小时:

在此处输入图像描述

linux ubuntu ubuntu-18.04 reboot lenovo
  • 1 个回答
  • 170 Views
Martin Hope
Laurent
Asked: 2020-03-25 19:12:14 +0800 CST

桥接接口上三个不同 Ubuntu 服务器上的上传速度慢

  • 0

我管理着三台运行最新 LTS 的 Ubuntu 服务器,它们都是最新的 2 台。

第一个是快速光纤网络,带有桥接接口(用于容器)两者都有一个在 libvirt 中运行的 OPNsense 路由器,使用通过 PCI 直通的专用接口

第三个由我的 ISP 托管在一个快速网络上,还带有一个用于容器的桥接接口。

所有三台服务器的上传速度都只有 3 到 4 Mbit/s!OPNsense 路由器可以全速上传。如果我将设备直接插入调制解调器 (WAN),我也会获得全速。

所以我怀疑它与网桥有关。

服务器 1:

/etc/网络/接口

auto br0
    iface br0 inet static
        address 10.0.4.4
            netmask 255.255.254.0
            network 10.0.4.0
            broadcast 10.0.5.255
            # gateway 10.0.4.1
            dns-nameserver 10.0.4.1
        bridge_ports enp3s0
            bridge_stp on
            bridge_maxwait 0

接口速度

# ethtool enp3s0 | grep Speed
        Speed: 1000Mb/s

ipa

# 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: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether 60:a4:4c:cb:4f:5d brd ff:ff:ff:ff:ff:ff
    inet6 fe80::62a4:4cff:fecb:4f5d/64 scope link 
       valid_lft forever preferred_lft forever
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 0a:91:86:76:2e:08 brd ff:ff:ff:ff:ff:ff
    inet 10.0.4.4/23 brd 10.0.5.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::891:86ff:fe76:2e08/64 scope link 
       valid_lft forever preferred_lft forever

服务器 2:

/etc/netplan/01-netcfg.yaml

 bridges:
    br0:
      dhcp4: no
      dhcp6: no
      addresses:
        - 10.0.14.2/24
      gateway4: 10.0.14.1
      nameservers:
        addresses: 
        - 10.0.14.6
      interfaces:
        - eno1

接口速度

# ethtool eno1 | grep Speed
        Speed: 1000Mb/s

服务器 3:

/etc/netplan/01-netcfg.yaml

network:
    ethernets:
        eno1:
            dhcp4: false
            dhcp6: false
        eno2:
            dhcp4: false
            dhcp6: false
            optional: true
        enp0s20f0u1u6:
            dhcp4: true
            dhcp6: false
            optional: true
    bridges:
        br0:
            dhcp4: false
            dhcp6: false
            addresses:
            - [redacted]/24
            - [redacted]/64
            gateway4: [redacted]
            gateway6: [redacted]
            nameservers:
                addresses: 
                - 1.1.1.1
                - 1.0.0.1
                - 8.8.8.8
                - 8.8.8.4
                - 2606:4700:4700::1111
                - 2606:4700:4700::1001
                - 2001:4860:4860::8888
                - 2001:4860:4860::8844
            interfaces:
                - eno1
            parameters:
                stp: false
                forward-delay: 0
    version: 2

接口速度

# ethtool eno1 | grep Speed
        Speed: 1000Mb/s

典型的服务器速度测试:

Ping: 2.987 ms
Download: 279.34 Mbit/s
Upload: 4.10 Mbit/s

从插入光纤路由器或 OPNsense 路由器后面的计算机进行速度测试

Ping: 2.939 ms
Download: 283.25 Mbit/s
Upload: 180.77 Mbit/s

我做错了什么?

bridge
  • 1 个回答
  • 863 Views
Martin Hope
Laurent
Asked: 2019-04-19 17:38:49 +0800 CST

Docker 破坏 libvirt 桥接网络

  • 17

这个问题快把我逼疯了。我运行全新安装的 Ubuntu 18.04,其中:

  • ufw 管理防火墙
  • br0 桥
  • lxd 和 libvirt (KVM)

我尝试了股票 docker.io 包和包形成 docker 自己的 deb 存储库。

我希望能够部署 docker 容器,选择 ip 来绑定其端口(例如 -p 10.58.26.6:98800:98800),然后使用 UFW 打开端口。

但 docker 似乎创建了扰乱 br0 桥的 iptables 规则(例如,主机无法 ping libvirt 来宾)

我环顾四周,找不到好的安全意识解决方案。

手动iptables -I FORWARD -i br0 -o br0 -j ACCEPT操作似乎使一切正常。

docker daemon 的设置也"iptables": false允许网桥正常运行,但会破坏 docker 的容器出口网络。

通过编辑单个 UFW 的文件https://stackoverflow.com/a/51741599/1091772 ,我发现这个解决方案看起来很简单,但它根本不起作用。

永久解决这个问题的最佳实践和安全方法是什么,在重新启动后幸存下来?

编辑: 我最终-A ufw-before-forward -i br0 -o br0 -j ACCEPT在/etc/ufw/before.rules提交之前添加。我可以将其视为解决方案还是不会引发一些问题?

iptables
  • 2 个回答
  • 9724 Views
Martin Hope
Laurent
Asked: 2019-02-15 20:19:09 +0800 CST

为 KVM 来宾分配以太网别名

  • 1

我有一个 IP 地址池和一根以太网电缆。我设置了别名:

auto enp2s0:0
iface enp2s0:0 inet static
  address x.x.x.x
  netmask x.x.x.x

我想将一些别名专用于 libvirt kvm 来宾,以便从来宾内部设置 ip。

我怎样才能实现它?

kvm-virtualization
  • 1 个回答
  • 245 Views
Martin Hope
Laurent
Asked: 2017-05-19 18:22:49 +0800 CST

使用 exim4 添加 X-Spam-Flag

  • 0

我是 exim4 的新手。我有这个配置:

.ifdef SA_ENABLE
        warn
            !authenticated = *
            hosts = !127.0.0.1/24
            condition = ${if < {$message_size}{1K}}
            spam       = SA_SPAMD_USER:true
            add_header = X-Spam_score: $spam_score\n\
                   X-Spam_score_int: $spam_score_int\n\
                   X-Spam_bar: $spam_bar\n\
                   X-Spam_report: $spam_report

        warn
            !authenticated = *
            hosts = !+relay_from_hosts
            spam       = SA_SPAMD_USER:true/defer_ok
            add_header = X-Spam_score: $spam_score\n\
                    X-Spam_score_int: $spam_score_int\n\
                    X-Spam_bar: $spam_bar\n\
                    X-Spam_report: $spam_report
            set acl_m4 = $spam_score_int
            condition = ${if and{{<{$message_size}{100K}}{<{$acl_m4}{SA_SCORE_REJECT}}} {yes}{no}}
            logwrite = From $sender_address to $recipients X-Spam_score: $acl_m4.

        deny
            condition = ${if and{{>{$message_size}{10K}}{!eq{$acl_m4}{}}{>{$acl_m4}{SA_SCORE_REJECT}}} {yes}{no}}
            message = Content analisis tool detect spam (from $sender_address to $recipients). Contact SA_ABUSE_ADDR.
.endif

如果分数超过/低于某个值,我如何调整添加 X-Spam-Flag(是或否),如果超过另一个值则拒绝。(目前 SA_SCORE_REJECT = 50)

exim
  • 1 个回答
  • 534 Views
Martin Hope
Laurent
Asked: 2016-11-03 16:32:56 +0800 CST

从 cron 运行时 ZFS 找不到文件系统

  • 0

我写了一个小脚本来处理我的 zfs 备份。当我手动运行它时,它运行良好:

/root/bin/zfs-backup -k 7 -p zfs-auto-snap_daily -r vm/containers tank/backups

但是像这样在 cron 中运行它会引发错误“文件系统 'vm/containers' 不存在。”

30 0 * * * root /root/bin/zfs-backup -k 7 -p zfs-auto-snap_daily -r vm/containers tank/backups
backup bash zfs zfsonlinux
  • 1 个回答
  • 462 Views
Martin Hope
Laurent
Asked: 2015-02-05 16:59:21 +0800 CST

查找从多个日志文件中获得高流量的 VirtualHost

  • 0

有时我的 Apache 服务器负载很高。我有很多 VirtualHost,每个都有自己的日志文件。

结构是这样的 /var/www/httpd-logs/virtualhost.com.access.log

我可以使用什么命令来查找在过去 X 分钟内负载很高的网站?

然后我将分析相应的网站日志以查找问题。

apache-2.4
  • 1 个回答
  • 63 Views
Martin Hope
Laurent
Asked: 2014-12-19 01:02:03 +0800 CST

我混合了 sgdisk -R /dev/sdY /dev/sdX 的参数

  • 0

我有两个raid1 阵列和一个跨越两个raid 阵列的LVM 分区。

一个磁盘死了,我尝试使用 sgdisk -R 将另一个成员的分区表复制回它

但我混合了这些论点,所以在重新启动后,好磁盘似乎和坏磁盘一样不可用。

我可以修复它吗?我的意思是它在我重新启动之前运行良好......

partition
  • 2 个回答
  • 130 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