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
    • 最新
    • 标签
主页 / server / 问题

问题[containers](server)

Martin Hope
TCB13
Asked: 2023-09-05 23:15:50 +0800 CST

Debian 12 + LXD/LXC security.idmap.isolated 失败

  • 6

运行 LXD/LXC 并在非特权容器设置上的 Debian 12.1 (6.1.0-11-amd64)security.idmap.isolated=true似乎无法更新容器文件的所有者/组。

这是一个例子:

# lxc launch images:debian/12 debian
(...)

# lxc config get debian volatile.idmap.base
296608

# lxc stop debian
Error: The instance is already stopped

# lxc config set debian security.idmap.isolated true

# lxc config get debian security.idmap.isolated
true

# lxc start debian

现在,如果我列出容器卷上的文件,我会发现它们全部归主机root 用户所有:

# ls -la /mnt/NVME1/lxd/containers/debian/rootfs/
total 24
drwxr-xr-x 1 root   root  154 Sep  5 06:28 .
d--x------ 1 296608 root   78 Sep  5 15:59 ..
lrwxrwxrwx 1 root   root    7 Sep  5 06:25 bin -> usr/bin
drwxr-xr-x 1 root   root    0 Jul 14 17:00 boot
drwxr-xr-x 1 root   root    0 Sep  5 06:28 dev
drwxr-xr-x 1 root   root 1570 Sep  5 06:28 etc

我尝试了 LXD/LXC 的多个版本。5.0.2apt以及 4.0 和 5.17(最新)都会发生这种情况snap。

有趣的是,我有另一个 Debian 10 (4.19.0-25-amd64) 正在运行,而较旧的 LXD 4snap则按预期工作:

# ls -la /mnt/NVME1/lxd/containers/debian/rootfs/
total 0
drwxr-xr-x 1 1065536 1065536  138 Oct 29  2020 .
d--x------ 1 1065536 root      78 Oct 14  2020 ..
drwxr-xr-x 1 1065536 1065536 1328 Jul 24 19:07 bin
drwxr-xr-x 1 1065536 1065536    0 Sep 19  2020 boot
drwxr-xr-x 1 1065536 1065536    0 Oct 14  2020 dev
drwxr-xr-x 1 1065536 1065536 1716 Jul 24 19:08 etc

正如您在该系统上看到的,所有文件都属于1065536:1065536.


更新:

我尝试在两台机器中探测地图lxc config show debian,我看到了这一点:

运行 Debian 10 的机器:

security.idmap.isolated: "true"
(...)
volatile.idmap.base: "1065536"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1065536,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1065536,"Nsid":0,"Maprange":65536}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1065536,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1065536,"Nsid":0,"Maprange":65536}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1065536,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1065536,"Nsid":0,"Maprange":65536}]'

运行 Debian 12 的机器:

security.idmap.isolated: "true"
(...)
volatile.idmap.base: "231072"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":231072,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":231072,"Nsid":0,"Maprange":65536}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":231072,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":231072,"Nsid":0,"Maprange":65536}]'
volatile.last_state.idmap: '[]'

更新:

我还尝试了全新安装Debian 11 (5.10.0-25-amd64),它按预期工作:

root@vm-debian-11-cli:~# ls -la /mnt/NVME1/lxd/containers/debian/rootfs/
total 24
drwxr-xr-x 1 1065536 1065536  154 Sep  6 06:28 .
d--x------ 1 1065536 root      78 Sep  6 15:31 ..
lrwxrwxrwx 1 1065536 1065536    7 Sep  6 06:25 bin -> usr/bin
drwxr-xr-x 1 1065536 1065536    0 Jul 14 17:00 boot
drwxr-xr-x 1 1065536 1065536    0 Sep  6 06:28 dev
drwxr-xr-x 1 1065536 1065536 1570 Sep  6 06:28 etc

为什么没有填充volatile.last_state.idmap: '[]'?与 Debian 10 和 11 的工作一样,显然这可能与新内核和/或其配置有关。

我该如何修复它?谢谢。

containers
  • 1 个回答
  • 104 Views
Martin Hope
Kurru
Asked: 2022-02-28 23:36:13 +0800 CST

如何在运行 openjdk:17-oracle 的容器中安装 xargs

  • 2

我正在尝试将 xargs 安装在运行 openjdk:17-oracle 的容器中,但我无法确定此映像中存在什么包管理器。

FROM openjdk:17-oracle
RUN apt-get install findutils

抛出错误:

 => ERROR [stage-1 4/4] RUN apt-get install findutils                                                                      0.5s
------
 > [stage-1 4/4] RUN apt-get install findutils:
#13 0.395 /bin/sh: apt-get: command not found
-

yum install findutils和其他几个一样。

我需要 xargs,因为 gradle runner 使用它来为我的 java 进程构建“执行”命令。

java oracle-linux containers
  • 2 个回答
  • 1095 Views
Martin Hope
AKS
Asked: 2022-02-12 12:46:20 +0800 CST

文件夹/文件上的 OWNER USER 错误: docker run -v <host_path_dir_file>:<docker_some_path_dir_file>/ not working for user defined in Dockerfile

  • 0

主机操作系统: Red Hat Enterprise Linux Server 7.9版(Maipo)

来宾操作系统,即运行的 Docker 容器:OpenSuse 15.2

Docker 版本(在主机上):Docker 版本 19.03.5,构建 633a0ea

在主机上,当我 git 克隆存储库“utilities_scripts”时,我对用户具有有效访问权限(由于 umask)。

  • docker run ...我认为这里的问题与权限无关,但是当我发出以下命令时,为什么 Dockerfile 中定义的 USER 没有被设置为 docker 容器内的文件夹/文件(正在挂载)的所有者。设置 755/775 等不是一个选项,因为我不能在容器内以目标 docker 用户的身份 chown 并且设置 777 是不好的做法。

注意:

  1. 当我从不同的 Linux 机器尝试相同的 docker 映像时,文件夹/文件作为用户“ docker_non_root_user ”安装,该用户在 Dockerfile 中定义为USER docker_non_root_user.
  2. docker build ...成功运行并创建映像,并且容器在另一台机器上工作(当我使用-v <host>:<container>docker CLI 选项语法将 git clone 存储库安装在容器内时。

来自 Dockerfile 的代码片段是:

# Define any mount points references
VOLUME ["/home/docker_non_root_user/git"]

USER docker_non_root_user
WORKDIR /home/docker_non_root_user/git

这是我在存在 DockerfileUSER ...所有权问题的主机上看到的:

[gigauser@jenkins-projectABC bitbucket_workspace]$ whoami
gigauser
[gigauser@jenkins-projectABC bitbucket_workspace]$ id
uid=gigauser(gigauser) gid=21520(jenkins) groups=21520(jenkins),3000(ectx)

[gigauser@jenkins-projectABC bitbucket_workspace]$ umask
0077
[gigauser@jenkins-projectABC bitbucket_workspace]$ ls -l
total 12
drwx------  5 gigauser jenkins 4096 Feb  3 16:36 utilities_scripts
[gigauser@jenkins-projectABC bitbucket_workspace]$


[gigauser@jenkins-projectABC bitbucket_workspace]$ sudo docker image ls
Active Directory Password:
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
project-im-opensuse   15.2                0c9ee31464cd        43 hours ago        2.39GB
[gigauser@jenkins-projectABC bitbucket_workspace]$

[gigauser@jenkins-projectABC bitbucket_workspace]$
[gigauser@jenkins-projectABC bitbucket_workspace]$ sudo docker run -v $PWD/utilities_scripts:/home/docker_non_root_user/git/utilities_scripts/ -it project-im-opensuse:15.2 bash -c "whoami; id; which bash; bash --version; ls -l; echo; ls -l utilities_scripts; ls -l /home/docker_non_root_user/git/utilities_scripts; id gigauser; echo"

WARNING: IPv4 forwarding is disabled. Networking will not work.


docker_non_root_user
uid=1000(docker_non_root_user) gid=487(docker_non_root_user) groups=487(docker_non_root_user),100(users)

/bin/bash
GNU bash, version 4.4.23(1)-release (x86_64-suse-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
total 8
drwx------ 5 gigauser 21520 4096 Feb  4 00:36 utilities_scripts

ls: cannot open directory 'utilities_scripts': Permission denied
ls: cannot open directory '/home/docker_non_root_user/git/utilities_scripts': Permission denied
id: 'gigauser': no such user

[gigauser@jenkins-projectABC bitbucket_workspace]$

当我在其他 Linux 机器上运行相同的命令时,我看到挂载utilities_scripts文件夹的所有者是docker_non_root_user.

问题:为什么我看到主机用户的 USER-ID(我在其中运行docker run命令)设置在 docker 容器中的 utility_scripts 文件夹中,而Dockerfile中没有创建这样的用户 ID/容器内不存在?(见上面输出中的倒数第二行)。它目前在 docker 容器内获得相同主机的所有者和文件夹级别权限。

gigauser即主机的用户,不在docker容器中,但文件ls -l输出显示是容器中文件夹/文件gigauser的所有者。utilities_scripts此问题不会出现在其他主机上。

我什至检查了/etc/subuid文件,对我来说看起来不错。将内部的值更改为 docker 的用户并没有帮助。我也没有在/etc/docker/daemon.json文件中看到与此相关的任何内容。

$ cat /etc/subuid
gigauser:165536:65536

docker run ....options从另一台 Linux 主机运行上述相同的命令,它显示 docker 容器内的文件夹所有权为:

drwx------ 5 docker_non_root_user 1000  272 Jan 26 21:52 utilities_scripts
linux mount permissions docker containers
  • 1 个回答
  • 368 Views
Martin Hope
Daigo
Asked: 2022-01-20 23:51:00 +0800 CST

无法在 kube-proxy 容器中执行 dpkg 命令

  • 0

我目前正在尝试获取k8s.gcr.io/kube-proxy:v1.23.2容器上所有已安装的 debian 软件包 (dpkg) 的列表。

首先,我尝试dpkg -l在运行的容器中作为我的 kubernetes 集群的一部分执行,但出现以下错误。

dpkg-query: error: showing package list on pager subprocess returned error exit status 127

然后我也直接在 containerd 上尝试了该命令,nerdctl run -it k8s.gcr.io/kube-proxy:v1.23.2 dpkg -l但得到了同样的错误。

是否可以通过修改一些设置来获取列表,或者有什么不同的方法?

debian dpkg docker kubernetes containers
  • 1 个回答
  • 43 Views
Martin Hope
montss
Asked: 2021-10-15 03:53:33 +0800 CST

容器环境中的Java大堆

  • 0

我正在尝试在 kubernetes 上运行一个 Jetty 网络服务器,它在我们的生产环境中需要大量的堆 ~ 250 GB,在我们的测试环境中 ~ 50 GB。

我正在使用jetty:9.4-jdk11,我试图避免显式设置Xms或Xmx标志,因为不同环境之间的值不同,因为我认为依赖-XX:MaxRAMPercentage -XX:InitialRAMPercentage会更好,但无论我尝试什么,我都无法MaxHeapSize通过32178700288 ~ 30 GB。

Node 上只有 Java 应用程序和一些小 sidcar,有 64 GB 内存。

Dockerfile

FROM jetty:9.4-jdk11

ENV APP_WAR root.war
ENV APP_EXPLODED_WAR root/
ENV APP_DESTINATION_PATH $JETTY_BASE/webapps/
ENV APP_DESTINATION_WAR $APP_DESTINATION_PATH$APP_WAR
ENV APP_DESTINATION_EXPLODED_WAR $APP_DESTINATION_PATH$APP_EXPLODED_WAR

ADD . $APP_DESTINATION_EXPLODED_WAR

ENV JAVA_OPTIONS -XX:+PrintFlagsFinal -XX:MaxRAMPercentage=90 -XX:InitialRAMPercentage=90 -XX:-OmitStackTraceInFastThrow -XX:+UseStringDeduplication -Xlog:gc*,stringdedup*=debug:file=/tmp/gc.log:time

容器资源设置

resources:
  limits:
    cpu: "8"
    memory: 60G
  requests:
    cpu: "6"
    memory: 60G

基于这些值,我应该得到 60 GB MaxHeapSize~ 54 GB 的 90%,而不是 30 GB。知道我缺少什么吗?

java jetty kubernetes google-kubernetes-engine containers
  • 1 个回答
  • 143 Views
Martin Hope
Syntax Error
Asked: 2021-08-17 23:48:06 +0800 CST

无法访问在 docker 中本地运行的 Unifi 控制器的 webUI

  • 0

我可以通过各种端口上的 Web 界面访问托管在我的服务器上的其他 docker 容器,但 Unifi 控制器给了我“拒绝连接”类型的错误。

这是的输出docker ps

    CONTAINER ID   IMAGE                                  COMMAND         CREATED       STATUS                        PORTS                                                                                                                                                                                                                                                                                                                                           NAMES
175a359de1d2   ghcr.io/linuxserver/unifi-controller   "/init"         6 hours ago   Up About a minute             0.0.0.0:1900->1900/udp, :::1900->1900/udp, 0.0.0.0:3478->3478/udp, :::3478->3478/udp, 0.0.0.0:8080-8081->8080-8081/tcp, :::8080-8081->8080-8081/tcp, 0.0.0.0:8843->8843/tcp, :::8843->8843/tcp, 0.0.0.0:5514->5514/udp, :::5514->5514/udp, 0.0.0.0:10001->10001/udp, :::10001->10001/udp, 0.0.0.0:8880->8880/tcp, :::8880->8880/tcp, 8443/tcp   unifi-controller

这是我docker-compose.yml的控制器条目

  unifi-controller:
    container_name: unifi-controller
    image: ghcr.io/linuxserver/unifi-controller
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    ports:
      - 3478:3478/udp
      - 10001:10001/udp
      - 8080:8080
      - 8081:8081
      - 8843:8843
      - 8880:8880
#      - 6789:6789 #mobile throughput test
      - 1900:1900/udp
      - 5514:5514/udp
    volumes:
      - "~/docker-services/unifi/config:/config"

docker 日志中有一些错误,但我不知道它们的含义或如何修复它们。当我搜索它们时,它们似乎相对通用 - 不完全确定修复是什么。

:0 TCP candidates not supported yet
:0 Permanent error code on channel bind request: 403 - Forbidden IP
:0 All TURN channel bindings failed
:0 Invalid channel id: 8000f; SID: 0x000f; _maxSctpChannels: 0x0400
:0 Invalid channel id: c000f; SID: 0x000f; _maxSctpChannels: 0x0400
:0 TCP candidates not supported yet
:0 Permanent error code on channel bind request: 403 - Forbidden IP
:0 All TURN channel bindings failed
:0 STUN id:   4; fd: 217 172.18.0.5:42921 -> 192.168.1.222:50184 (eth0) DTLS id: 9 (192.168.1.235:42921) (PEER) timed out
:0 webRtcId 1 terminated with code: (-2147090409) WebRTC connection interrupted from far side
:0 SSL_read permanently failed: (6)
:0 Unable to do SSL I/O
:0 webRtcId 2 terminated with code: (-2147090409) WebRTC connection interrupted from far side
:0 TCP candidates not supported yet
:0 Permanent error code on channel bind request: 403 - Forbidden IP
:0 All TURN channel bindings failed
:0 SSL_read permanently failed: (6)
:0 Unable to do SSL I/O
:0 webRtcId 3 terminated with code: (-2147090409) WebRTC connection interrupted from far side
:0 TCP candidates not supported yet
:0 Permanent error code on channel bind request: 403 - Forbidden IP
:0 All TURN channel bindings failed
:0 SSL_read permanently failed: (6)
:0 Unable to do SSL I/O
:0 webRtcId 4 terminated with code: (-2147090409) WebRTC connection interrupted from far side
:0 TCP candidates not supported yet
:0 Permanent error code on channel bind request: 403 - Forbidden IP
:0 All TURN channel bindings failed
:0 SSL_read permanently failed: (6)
:0 Unable to do SSL I/O
:0 webRtcId 5 terminated with code: (-2147090409) WebRTC connection interrupted from far side

我试过重新启动容器,重新启动 docker 并重新启动服务器。也排除了不同的浏览器以防万一(Chrome、Edge、Firefox)。这以前有效,但没有任何改变。

当我的手机连接到同一个网络时,我可以通过移动应用程序访问 unifi 控制器。我也可以从https://network.unifi.ui.com访问它

作为参考,其他应用程序(例如 nginx)在 docker-compose 文件中指定的端口上可用。我不明白为什么只有 unifi-controller 很困难。

ubuntu docker unifi containers ubiquiti
  • 1 个回答
  • 997 Views
Martin Hope
MBiabanpour
Asked: 2021-08-03 11:25:30 +0800 CST

Docker 的 Image Pull Rate Limit 的奇怪行为

  • 0

我有一个 Ubuntu 20.04 LTS 服务器,上面安装了 packages docker-ce、docker-ce-cli和containerd.io。当我今天第二次尝试从 Docker Hub 拉取图像时,出现了toomanyrequests错误,但在 Docker 的网站上,我每天可以进行大约 100 个拉取请求。有没有人知道这个问题的解决方案是什么?

ubuntu docker containers
  • 1 个回答
  • 28 Views
Martin Hope
Kohini
Asked: 2021-06-27 22:44:08 +0800 CST

容器是否可以在 AWS ECS 中以过载方式放置在 EC2 主机上

  • 0

我有一个运行多个 tomcat 应用程序和独立 jar 的实例。如果机器有 2vcpu 和 8GB RAM,单个应用程序可以按需使用资源(基于为 tomcat 和单个 jar 设置的 Xms 和 Xmx 值)。ECS 目前不在图中。

现在我将把应用程序移动到 EC2 实例上的容器(不是 Fargate)。是否可以有任务定义,其中我指定的 cpu 和内存总和大于 EC2 主机的实际 cpu 或 RAM?

因为我不希望所有应用程序在创建任务定义期间都使用 100% 分配给它的内存。拥有一个具有 4vcpus 的 ECS 主机并且我在其上放置 10 个任务并在任务定义中指定 4vcpus 是否可行?我知道这些任务不会使用 4vcpu,但我希望如果有任何任务需要使用,它们不应该被限制为使用主机的全部容量

我知道 ECS 具有我计划使用的扩展功能。但我的目标是确保不会过度配置我用于 ECS 的 EC2 主机数量

amazon-web-services amazon-ecs containers
  • 1 个回答
  • 181 Views
Martin Hope
nick2k3
Asked: 2021-06-14 01:08:37 +0800 CST

带有 docker 的 site2site 线卫:路由问题

  • 2

免责声明:从stackoverflow转发:https ://stackoverflow.com/questions/67917278/site2site-wireguard-with-docker-routing-problems

我试图让两个容器在两个 RPI 上运行,充当网络 1 和网络 2 之间的站点到站点 VPN。

通过下面的设置,我可以从容器内相互ping通:

  • 从 docker 容器 1 我可以 ping 一个地址 192.168.1.1
  • 从 docker 容器 2 我可以 ping 地址 192.168.10.1

但是,如果我尝试从 System1 主机 (192.168.10.100) ping 192.168.1.1,则会出现错误(请参见下图以可视化我正在尝试执行的操作)。

我知道我必须在 system1 主机 (192.168.10.100) 上添加一个静态路由,以通过 wireguard 容器 (172.17.0.5) 引导 192.168.1.0/24 的流量,因此我运行:

$i p route add 192.168.1.0/24 via 172.17.0.5
$ ip route
default via 192.168.10.1 dev eth0 proto dhcp src 192.168.10.100 metric 100 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 
172.18.0.0/16 dev br-e19a4f1b7646 proto kernel scope link src 172.18.0.1 linkdown 
172.19.0.0/16 dev br-19684dacea29 proto kernel scope link src 172.19.0.1 
172.20.0.0/16 dev br-446863cf7cef proto kernel scope link src 172.20.0.1 
172.21.0.0/16 dev br-6800ed9b4dd6 proto kernel scope link src 172.21.0.1 linkdown 
172.22.0.0/16 dev br-8f8f439a7a28 proto kernel scope link src 172.22.0.1 linkdown 
192.168.1.0/24 via 172.17.0.5 dev docker0 
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.100 
192.168.10.1 dev eth0 proto dhcp scope link src 192.168.10.100 metric 100 

但是对 192.168.1.1 的 ping 仍然失败。

通过在容器 2 上运行 tcpdump,我看到一些数据包确实到达了容器:

root@936de7c0d7eb:/# tcpdump -n -i any
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
10:11:19.885845 IP [publicIPsystem1].56200 > 172.17.0.6.56100: UDP, length 128
10:11:30.440764 IP 172.17.0.6.56100 > [publicIPsystem1].56200: UDP, length 32
10:11:35.480625 ARP, Request who-has 172.17.0.1 tell 172.17.0.6, length 28
10:11:35.480755 ARP, Reply 172.17.0.1 is-at 02:42:24:e5:ac:38, length 28

所以我想这不是系统 1 上的路由问题。

谁能告诉我如何进一步诊断?


编辑1:
我做了以下测试:

  1. 在容器 2 上运行“tcpdump -ni any”
  2. 从系统 1(从主机系统)发送 ping 'ping -c 1 192.168.1.1。
    在容器 2 上,tcpdump 记录以下内容:
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
    15:04:47.495066 IP [publicIPsystem1].56200 > 172.17.0.3.56100: UDP, length 128
    15:04:58.120761 IP 172.17.0.3.56100 > [publicIPsystem1].56200: UDP, length 32
  1. 从容器(在容器内)发送 ping 'ping -c 1 192.168.1.1 。
    在容器 2 上,tcpdump 记录以下内容:
# tcpdump -ni any
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
15:05:48.120717 IP [publicIPsystem1].56200 > 172.17.0.3.56100: UDP, length 128
15:05:48.120871 IP 10.13.18.2 > 192.168.1.1: ICMP echo request, id 747, seq 1, length 64
15:05:48.120963 IP 172.17.0.3 > 192.168.1.1: ICMP echo request, id 747, seq 1, length 64
15:05:48.121955 IP 192.168.1.1 > 172.17.0.3: ICMP echo reply, id 747, seq 1, length 64
15:05:48.122054 IP 192.168.1.1 > 10.13.18.2: ICMP echo reply, id 747, seq 1, length 64
15:05:48.122246 IP 172.17.0.3.56100 > [publicIPsystem1].56200: UDP, length 128
15:05:53.160617 ARP, Request who-has 172.17.0.1 tell 172.17.0.3, length 28
15:05:53.160636 ARP, Request who-has 172.17.0.3 tell 172.17.0.1, length 28
15:05:53.160745 ARP, Reply 172.17.0.3 is-at 02:42:ac:11:00:03, length 28
15:05:53.160738 ARP, Reply 172.17.0.1 is-at 02:42:24:e5:ac:38, length 28
15:05:58.672032 IP [publicIPsystem1].56200 > 172.17.0.3.56100: UDP, length 32

所以,似乎数据包的处理方式与容器 2 不同,具体取决于我目前缺少的东西。这可能是 iptables 问题吗?


在此处输入图像描述

站点 1 站点 2
网络 1 IP 范围 192.168.10.0/24 192.168.1.0/24
主机系统地址 192.168.10.100 192.168.1.100
桥 docker0 范围 172.17.0.0/16 172.17.0.0/16
容器地址 172.17.0.5 172.17.0.6

系统 1 - wg0.conf

[Interface]
Address = 10.13.18.2
PrivateKey = *privatekey*
ListenPort = 56200
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = *publickey*
Endpoint = *system2address*:56100
AllowedIPs = 10.13.18.1/32 , 192.168.1.0/24

系统 2 - wg0.conf

[Interface]
Address = 10.13.18.1
ListenPort = 56100
PrivateKey = *privatekey*
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
# peer_casaleuven
PublicKey = *publickey*
AllowedIPs = 10.13.18.2/32 , 192.168.10.0/24
Endpoint = *system1address*:56200
vpn docker wireguard containers routes
  • 1 个回答
  • 2083 Views
Martin Hope
Ray
Asked: 2021-04-24 03:38:38 +0800 CST

如何移除损坏的 qemu / kvm 容器?

  • 0

我正在我的服务器上运行一些容器(qemu kvm、libvirt)。其中一些已完全损坏,我无法以任何方式将其删除。已经谷歌了半天,但找不到有效的解决方案。

我尝试使用virsh和prlctl命令删除损坏的容器。也无法重新安装它们。甚至尝试手动删除容器文件,但没有运气。virsh甚至没有看到容器,并prlctl给了我像Failed to get VM config: Operation failed. Failed to execute the operation.

# prlctl list -a
{uuid1}  stopped      -               CT my-ct1
{uuid2}  invalid      -               CT my-ct2

我怎样才能完全删除这些容器?

kvm-virtualization containers
  • 1 个回答
  • 93 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