大家好,我是烤鸭:
场景是:
多个项目(配置文件相同)部署同一个服务器,部署的代码大部分相同。(具体原因是同一个项目的不同分支部署了两次)
启动之后,一直在报这个错误:
[WARN] [2019-05-13 11:05:53,200] doSaveProperties(189) | [DUBBO] Failed to save registry store file, cause: Can not lock the registry cache file /root/.dubbo/dubbo-registry-etc_manage_web-172.17.33.68:2181.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties, dubbo version: 2.6.2, current host: 172.17.33.68
java.io.IOException: Can not lock the registry cache file /root/.dubbo/dubbo-registry-etc_manage_web-172.17.33.68:2181.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.propertiesat com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:161)at com.alibaba.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:500)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)
[WARN] [2019-05-13 11:05:53,200] doSaveProperties(189) | [DUBBO] Failed to save registry store file, cause: Can not lock the registry cache file /root/.dubbo/dubbo-registry-etc_manage_web-172.17.33.68:2181.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties, dubbo version: 2.6.2, current host: 172.17.33.68
java.io.IOException: Can not lock the registry cache file /root/.dubbo/dubbo-registry-etc_manage_web-172.17.33.68:2181.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.propertiesat com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:161)at com.alibaba.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:500)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)
[WARN] [2019-05-13 11:05:53,201] doSaveProperties(189) | [DUBBO] Failed to save registry store file, cause: Can not lock the registry cache file /root/.dubbo/dubbo-registry-etc_manage_web-172.17.33.68:2181.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties, dubbo version: 2.6.2, current host: 172.17.33.68
java.io.IOException: Can not lock the registry cache file /root/.dubbo/dubbo-registry-etc_manage_web-172.17.33.68:2181.cache, ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.propertiesat com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties(AbstractRegistry.java:161)at com.alibaba.dubbo.registry.support.AbstractRegistry$SaveProperties.run(AbstractRegistry.java:500)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)
解决办法:
改其中一个项目的 registry 的 file 属性
dubbo:application:id: xxx_testname: xxx_testregistry:address: zookeeper://localhost:2181file: ${catalina:home}/dubbo-registry/dubbo-registry:propertiesscan:base-packages: com.test