Shared memory across docker containers

天涯浪子 提交于 2019-12-20 07:30:01

问题


If Websphere MQ is used as a XA(Distributed Transaction) Transaction Manager using Java MQ classes, not JTA, the Java application and the WMQ, both need to reside on the same host machine. I have been told this is because shared memory is used as Inter Process Communication mechanism. The Java application and the Websphere MQ both need access to shared memory to make XA work.

If we deploy WMQ in a docker container and keep our Java application in another docker container, both on the same host, will we be able to use the WMQ as a XA coordinator?

Will we have to use certain special configuration of the container to get it working? Can we allow the two containers to use common shared memory?

Regards,
Yash


回答1:


You can use common IPC name spaces via the --ipc option for run and create

docker run -d --name=wmq wmq
docker run -d --ipc=container:wmq app

Or a less secure host ipc

docker run -d --ipc=host wmq
docker run -d --ipc=host app

I'm not sure of MQ's explicit support for either setup for XA but IBM do support MQ in Docker.



来源:https://stackoverflow.com/questions/37701203/shared-memory-across-docker-containers

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!