[英]ibmmq node client can't find MQ C Library, fails consistently
I'm trying to create a node app that dockerizes the server and the MQ container, and use the ibmmq node client to interact with said container.我正在尝试创建一个对服务器和 MQ 容器进行 docker 化的节点应用程序,并使用 ibmmq 节点客户端与所述容器进行交互。 I'm running into an issue where I'm not able to get my server running because the MQ C library can't be found.
我遇到了一个问题,我无法让我的服务器运行,因为找不到 MQ C 库。 The specific error in question:
有问题的具体错误:
Cannot find MQ C library.
System appears to be: linux[x64]
Has the MQ C client been installed?
Have you run setmqenv?
Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'
at Object.openSync (fs.js:462:3)
at readFileSync (fs.js:364:35)
at new DynamicLibrary (/server/node_modules/ffi-napi/lib/dynamic_library.js:68:23)
at Object.Library (/server/node_modules/ffi-napi/lib/library.js:47:10)
at loadLib (/server/node_modules/ibmmq/lib/mqi.js:290:18)
at loadLibMulti (/server/node_modules/ibmmq/lib/mqi.js:417:13)
at Object.<anonymous> (/server/node_modules/ibmmq/lib/mqi.js:436:1)
at Module.<anonymous> (internal/modules/cjs/loader.js:999:30)
at Module._compile (/server/node_modules/source-map-support/source-map-support.js:568:25)
at internal/modules/cjs/loader.js:1027:10
[ERROR] 07:40:21 Error: ENOENT: no such file or directory, open '/opt/mqm/lib/libmqm_r.so'
When I go to check /opt/... there is no folder mqm.当我 go 检查 /opt/... 时,没有文件夹 mqm。 I'm not really sure when it would be created in the process.
我不太确定何时会在此过程中创建它。
Here is my docker file:这是我的 docker 文件:
FROM node:12
# Non-development values will be provided by Drone when
# deploying to staging or production
ARG ENV="development"
WORKDIR /server
COPY package.json .
COPY yarn.lock .
RUN yarn install --production=false
COPY . .
# In non-dev environments, we need to build executable code
# during image build time so that we're not doing it at
# container startup (which would cause significant down-time)
RUN if [ $ENV = "staging" ] || [ $ENV = "production" ]; \
then yarn build; \
fi
CMD ["yarn", "serve"]
The specific code that triggers the issue:触发问题的具体代码:
import mq from 'ibmmq'
const MQC = mq.MQC
I've tried a few things, including not letting the c library build but nothing is working.我尝试了一些方法,包括不让 c 库构建,但没有任何效果。 Any help would be appreciated, thanks in advance!
任何帮助将不胜感激,在此先感谢!
See https://github.com/ibm-messaging/mq-mqi-nodejs/tree/master/samples for a working Dockerfile example using npm install
.请参阅https://github.com/ibm-messaging/mq-mqi-nodejs/tree/master/samples以了解使用
npm install
的工作 Dockerfile 示例。
The postinstall script for linux x64 will normally pull in the MQ Redist C client package. If the postinstall is not run for some reason, or cannot download the package, then you have to install the MQ C client manually. linux x64 的安装后脚本通常会引入 MQ Redist C 客户端 package。如果安装后由于某种原因未运行,或者无法下载 package,则必须手动安装 MQ C 客户端。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.