无法检查Docker以在同一主机中发布流量

问题描述

在Linux主机中安装了一个docker Web应用程序,并且运行良好。我知道这个docker实例正在通过端口5432连接到postgres数据库,并且我正在尝试通过登录linux主机来了解docker和postgres数据库间的流量。

我运行docker ps时只看到了Web应用程序,但没有看到Postgres的任何Docker实例。

我看到有ps -ef | grep postgres运行的postgres进程,但是我看不到端口5432正在使用netstat -an | grep 5432监听

有趣的部分是/usr/lib/postgresql文件夹在以下输出中甚至都不存在。

$ ps -ef | grep postgres ubuntu 2622 2555 0 16:09 pts/0 00:00:00 /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf ubuntu 3249 2622 0 16:09 ? 00:00:00 postgres: 10/main: checkpointer process ubuntu 3250 2622 0 16:09 ? 00:00:00 postgres: 10/main: writer process ubuntu 3251 2622 0 16:09 ? 00:00:00 postgres: 10/main: wal writer process ubuntu 3252 2622 0 16:09 ? 00:00:00 postgres: 10/main: autovacuum launcher process ubuntu 3253 2622 0 16:09 ? 00:00:00 postgres: 10/main: stats collector process ubuntu 3254 2622 0 16:09 ? 00:00:00 postgres: 10/main: bgworker: logical replication launcher ubuntu 3821 2622 0 16:10 ? 00:00:00 postgres: 10/main: openvino workbench 127.0.0.1(35548) idle

我跑了sudo tcpdump -i docker0 'port 5432',但看不到任何流量。

跟踪postgres PID的PPID:

PID CMD
28691 /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf
  PID CMD
28639 bash /opt/intel/openvino/deployment_tools/tools/workbench/docker-entrypoint.sh
  PID CMD
28619 containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/a129c1514c181b85e9d75d8b20d909b1540f94c39792e370ab82918a681cbcb7 -address /run/contain
  PID CMD
 5198 /usr/bin/containerd
  PID CMD
    1 /lib/systemd/systemd --system --deserialize 38

有什么想法吗?请指教。 谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)