多播数据传输从虚拟盒到不同的网络接口

发布于 2025-02-01 02:17:54 字数 1152 浏览 2 评论 0原文

带有Linux OS(Ubuntu 20.04)的VirtualBox安装在物理主机(Windows OS)上。 Docker安装在Ubuntu,我在其中运行Java应用程序。它以多播模式在地址224.1.1.244和端口53000的多播模式下通过网络通过网络将数据包发送到另一台计算机。我通过docker-compose运行该应用程序的容器。

services:    
  upload-srv:
    image: ${SERV_IMAGE_STEND}
    networks:
      - es-serv-network
    network_mode: "host"
    restart: unless-stopped
    container_name: es-serv-v01
    volumes:
      - /home/es-serv:/home/es-serv
    ports:
      - "5003:5003"

  upload-web:
    image: ${WEB_IMAGE}
    networks:
      - es-serv-network
    restart: unless-stopped
    container_name: es-serv-web-v01
    ports:
      - "7001:80"
...        
networks:
  es-serv-network:

我将VirtualBox切换到桥模式,选择所需的接口,然后通过指定Network_mode,数据转到此接口。该方案有效。

但是将来计划启动多个此类应用程序(更确切地说是10个),并且每个应用程序都应以多播模式将数据发送到其网络接口。问题是,如何实施?

到目前为止,我有一个想法让每个人创建自己的虚拟机,将其连接到他们的网络接口,数据流将通过该界面。有什么方法可以使所有这些应用程序在一台虚拟机中起作用?

应用程序不是很复杂,服务器上不会有特殊的负载。但是要创建10个虚拟机,每个机器都需要分配内存资源。而且我们的服务器并不是特别强大。我什至不知道他是否会拉那么多。

Docker具有Macvlan网络模式。他不会以任何方式帮助我? 如果Docker安装在主机上,而不是在VirtualBox上,则可以将每个容器悬挂在网络接口上,并且应该可以工作。如果我正确理解MacVlan网络模式。 但是,当Docker安装在VirtualBox中时,我什至不知道如何设置主机上的网络接口。

VirtualBox with Linux OS (Ubuntu 20.04) is installed on the physical host (Windows OS). Docker is installed in Ubuntu, in which I run the Java application. It sends packets over the network to another computer over the udp protocol in multicast mode at the address 224.1.1.244 and port 53000. I run the container with this application through docker-compose.

services:    
  upload-srv:
    image: ${SERV_IMAGE_STEND}
    networks:
      - es-serv-network
    network_mode: "host"
    restart: unless-stopped
    container_name: es-serv-v01
    volumes:
      - /home/es-serv:/home/es-serv
    ports:
      - "5003:5003"

  upload-web:
    image: ${WEB_IMAGE}
    networks:
      - es-serv-network
    restart: unless-stopped
    container_name: es-serv-web-v01
    ports:
      - "7001:80"
...        
networks:
  es-serv-network:

I switch VirtualBox to bridge mode, select the desired interface, and by specifying network_mode, the data goes to this interface. This scheme works.

But in the future it is planned to launch several such applications (more precisely 10) and each of them should send data to its network interface in multicast mode. The question is, how can this be implemented?

So far, I have one thought for everyone to create their own virtual machine, connect it to their network interface through which the data stream will flow. Is there any way to make all these applications work in one virtual machine?

The applications are not very complex, there will be no special load on the server. But to create 10 virtual machines, each one needs to allocate memory resources. And our server is not particularly powerful. I don't even know if he'll pull that much.

Docker has a macvlan network mode. And he won't help me in any way?
If Docker was installed on the host, and not in VirtualBox, then you could hang each container on your network interface and it should work. If I understood the macvlan network mode correctly.
But when Docker is installed inside VirtualBox, I don't even know how to set the network interfaces that are located on the host.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文