简体   繁体   English

容器化 akka.net 应用程序后,Akka 消息传递不起作用

[英]Akka message passing not working after containerizing the akka.net application

I contenarized lighthouse and a akka.net application (batchProcessor) in linux containers.我在 linux 容器中将灯塔和 akka.net 应用程序(batchProcessor)合并。 Below it shows both containers are up.下面显示两个容器都已启动。 在此处输入图片说明

I am also able to connect to lighthouse from Pbm client in my local machine.我还可以从本地机器上的 Pbm 客户端连接到灯塔。 在此处输入图片说明

But batchprocessor is not able to connect to lighthouse(seed node).但是批处理器无法连接到灯塔(种子节点)。 Hence, message passing between these multiple clusters is not working.因此,这些多个集群之间的消息传递不起作用。 Here is the dockerfile for Lighthouse:这是 Lighthouse 的 dockerfile:

FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
WORKDIR /app

ENV ACTORSYSTEM="BatchProcessingSystem"
ENV CLUSTER_SEEDS "[]"
ENV CLUSTER_IP "127.0.0.1"
ENV CLUSTER_PORT "4051"

COPY ./bin/Release/netcoreapp2.2/win10-x64/publish/ /app

EXPOSE 9110 4051
RUN dotnet tool install --global pbm 

ENV PATH="${PATH}:/root/.dotnet/tools"
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
COPY --from=build-env /app .

ENV CPE_ENVIRONMENT "local"
ENV TNS_ADMIN "C:\oracle"

ENTRYPOINT ["dotnet", "Lighthouse.dll"]

And this is dockerfile for batchprocessor (akka.net application):这是批处理器的 dockerfile(akka.net 应用程序):

FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
WORKDIR /app
ENV CLUSTER_SEEDS "akka.tcp://BatchProcessingSystem@127.0.0.1:4051"
ENV CLUSTER_IP "127.0.0.1"
ENV CLUSTER_PORT "9121"

COPY ./bin/Release/netcoreapp2.2/win10-x64/publish/ /app

FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
COPY --from=build-env /app .

ENV CPE_ENVIRONMENT "local"
ENV TNS_ADMIN "C:\oracle"

EXPOSE 9121

ENTRYPOINT ["dotnet", "BatchProcessor.dll"]

Can anyone help me with this?What Am i missing here?任何人都可以帮助我吗?我在这里想念什么?

I suppose the problem is in the lighthouse configuration.我想问题出在灯塔配置上。

ENV CLUSTER_SEEDS "[]"

CLUSTER_SEEDS variable should save the same value for all members in the cluster including the seed nodes(lighthouse in your case). CLUSTER_SEEDS 变量应该为集群中的所有成员保存相同的值,包括种子节点(在你的情况下是灯塔)。 Also, I would recommend to configure logging for debugging purposes as it described in documentation .此外,我建议配置日志记录以进行调试,如文档中所述 Akka .net write detailed log of cluster initialization, it might be very helpful in investigation. Akka .net 写了集群初始化的详细日志,可能对调查很有帮助。

Also it's unclear for me that you configure docker file for lighthouse.我也不清楚您为灯塔配置了 docker 文件。 As i know lighthouse already has an image and all you need is to setup environment variables(ACTORSYSTEM, CLUSTER_IP, CLUSTER_PORT, CLUSTER_SEEDS) at start.据我所知,灯塔已经有一个图像,您只需要在开始时设置环境变量(ACTORSYSTEM、CLUSTER_IP、CLUSTER_PORT、CLUSTER_SEEDS)。 You can read about this here .您可以在此处阅读有关此内容的信息

I hope this helps.我希望这有帮助。

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

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