简体   繁体   English

使用 docker 将 mule 应用程序部署到 mule 集群

[英]Deploying a mule application to a mule cluster using docker

I am kind of new to MULE ESB and deployments.我对 MULE ESB 和部署有点陌生。 I have been doing some trials around deploying mule application to a mule standalone .我一直在做一些关于将 mule 应用程序部署到 mule standalone 的试验。 I am using an approach similar to this https://dzone.com/articles/dockerizing-clustering-and-queueing-up-with-mule-e我正在使用类似于此https://dzone.com/articles/dockerizing-clustering-and-queueing-up-with-mule-e的方法

But my question is, if I have a mule cluster where in I deploy my mule proxies and also mule APIs , Is there any way to do that ?但我的问题是,如果我有一个 mule 集群,在其中部署我的 mule 代理和 mule API,有什么办法可以做到吗? How would I bind individual docker images to the same mule cluster?我如何将单个 docker 图像绑定到同一个 mule 集群? Or If I have individual containers having mule runtime as mentioned in the above approach, How would I bind those containers into same cluster?或者,如果我有上述方法中提到的具有 mule 运行时的单个容器,我将如何将这些容器绑定到同一个集群中?

Let's break down your questions one by one and let's try to answer it.让我们一一分解您的问题并尝试回答它。

if I have a mule cluster where in I deploy my mule proxies and also mule APIs , Is there any way to do that ?

If you have Mule runtime prior to 3.8 version, you would need APi gateway to deploy your API proxy separately.如果您有3.8版本之前的 Mule 运行时,您将需要 APi 网关来单独部署您的 API 代理。 But after Mule 3.8 version, Mulesoft has unified Mule runtime and API gateway, which means, your API proxy can be deployed directly into Mule runtime.但是在 Mule 3.8版本之后,Mulesoft 统一了 Mule 运行时和 API 网关,这意味着您的 API 代理可以直接部署到 Mule 运行时中。 You don't need separate API gateway for your proxy.您的代理不需要单独的 API 网关。
All the APIs, proxy and policies can be deployed into Mule runtime directly.所有 API、代理和策略都可以直接部署到 Mule 运行时中。
https://blogs.mulesoft.com/dev/mule-dev/announcing-mule-3-8-unified-runtime-integration-api-management/ https://blogs.mulesoft.com/dev/mule-dev/annoucing-mule-3-8-unified-runtime-integration-api-management/

How would I bind individual docker images to the same mule cluster? 

If you read the article carefully, you can see in Create a Mule Cluster in Docker section.如果仔细阅读本文,您可以在在 Docker创建 Mule 集群部分中看到。
There are 2 properties config files for each cluster which defines the properties of each clusters, and the YAML file which binds both the runtime as a cluster.每个集群有 2 个属性配置文件,用于定义每个集群的属性,以及将运行时绑定为集群的YAML文件。
This YAML file points out both the properties file which describe the properties of each cluster .这个YAML文件指出了描述每个集群属性的属性文件。

There is also a Docker image file that takes the previous base image (described at top FROM anirban-mule-demo ) , creates the Mule runtime, and deploys the Mule application based on what is defined there.还有一个Docker镜像文件,它采用之前的基础镜像(在顶部的FROM anirban-mule-demo ),创建 Mule 运行时,并根据那里定义的内容部署 Mule 应用程序。

When you use the command : docker-compose build the YAML file binds both the runtime build the Mule cluster within the Docker container.当您使用命令 : docker-compose buildYAML文件绑定了运行时构建Docker 容器内的 Mule 集群。 In the background the base image is run twice creating 2 different Mule runtime and then the cluster is created using the 2 properties config files describing each cluster properties with individual node.在后台,基本映像运行两次,创建 2 个不同的 Mule 运行时,然后使用2 个属性配置文件创建集群,这些配置文件描述了每个集群属性和单个节点。

It actually use the process of creating Mule cluster from properties file which is another way of using Mule cluster.它实际上使用了从属性文件创建 Mule 集群的过程,这是使用 Mule 集群的另一种方式。
You can find the example how to create Mule cluster from properties file here您可以在此处找到如何从属性文件创建 Mule 集群的示例

Now at the end you can use docker run command to start both the Mule runtimes in the cluster and the application inside it will be getting different http ports 7082 and 8082 respectively defined in docker run command.现在最后您可以使用docker run命令启动集群中的 Mule 运行时,其中的应用程序将获得docker run命令中分别定义的不同 http 端口70828082

Hope this help希望这有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM