我正在为Openshift Origin部署一个基于camel的应用程序。 骆驼路由需要将一些pdf文件写入文件系统。 所以我创建了一个Persistent Volume Claim,然后为具有camel路由的Pod创建了存储。挂载引用了一个有效的目录,该目录可以从除root之外的其他用户写入。
PV已成功添加到pod中,因为我跑了
oc volume pod/sat-pdf-merger-7-64s9v
我得到了
pods/sat-pdf-merger-7-64s9v
pvc/volume0 (allocated 100GiB) as volume-efwkb
mounted at /recibos/pdf
secret/default-token-r45zl as default-token-r45zl
mounted at /var/run/secrets/kubernetes.io/serviceaccount
重要的是说同一个项目在Jboss Fuse 6.3上运行良好。因此抛出异常是因为某些Origin问题,而不是相关的camel或java代码问题。
当路由执行时,抛出以下异常:
org.apache.camel.component.file.GenericFileOperationFailedException: Error writing file [ComprobanteNomina00000001401.pdf]
at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:279)
at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:165)
at org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:58)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:124)
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:436)
at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:119)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
at org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:137)
at org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:133)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
修改
我在这里上传调试POD的结果。
我的Dockerfile
FROM 172.30.1.1:5000/myproject/fis-java-openshift:2.0
ENV JAVA_APP_DIR=/deployments
USER root
RUN mkdir -p /home/jboss/recibos
RUN chmod -R 777 /home/jboss/recibos
COPY maven /deployments/
EXPOSE 8080 8778 9779
当调试pod时,我看到dockerfile中的mkdir实际上不起作用。所以我需要一些解决方法。