Dubbo Failed to save registry store file, Cause:can not lock the registry cache file

Source: Internet
Author: User

The Dubbo service started with an error, the exception information is as follows:

2016-08-22 16:44:40.588 | dubbosaveregistrycache-thread-1 | WARN |  Com.alibaba.dubbo.common.logger.log4j.Log4jLogger:Log4jLogger.java (78) | [Dubbo] Failed to save registry store file, Cause:can not lock the registry cache file/root/.dubbo/dubbo-registry-10.141.4.168.c Ache, ignore and retry later, maybe multi Java process use the file, please config:dubbo.registry.file=xxx.properties, du Bbo version:2.8.3, current host:127.0.0.1 Java.io.IOException:Can not lock the registry cache File/root/.dubbo/dubbo-r Egistry-10.141.4.168.cache, ignore and retry later, maybe multi Java process use the file, please CONFIG:DUBBO.REGISTRY.F Ile=xxx.properties at Com.alibaba.dubbo.registry.support.AbstractRegistry.doSaveProperties (Abstractregistry.java : 193) ~[dubbo-2.8.3.jar:2.8.3] at Com.alibaba.dubbo.registry.support.abstractregistry$saveproperties.run (Abstract REGISTRY.JAVA:150) [dubbo-2.8.3.jar:2.8.3] at Java.util.concurrent.ThreadPoolExecutor.runWorker (Threadpoolexecutor.java:1145) [na:1.7.0_60] at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615) [NA: 1.7.0_60] at Java.lang.Thread.run (thread.java:745) [na:1.7.0_60]

The error probably means that Dubbo failed while saving the service list, Can not lock the registry cache file/root/.dubbo/ Dubbo-registry-10.141.4.168.cache, unable to get the file lock, cannot save the service list. Cause of error

The reason for this is that while the service is registering with ZK, it caches the list of consumer, writes user.home/.dubbo/dubbo-registry-"+ url.gethost () +". Cache this file, When multiple provider are started on the same machine, there is a problem with file lock contention, which is reported in the above error. Solutions

Since this is due to a competitive file lock, it is possible to avoid this problem by having the service modules cache their own caches files.

This is done by adding file= "${catalina.home}/dubbo-registry/dubbo-registry.properties" to the XML configuration file in provider, as follows:

<dubbo:registry id= "Zkcenter" protocol= "Zookeeper" address= "${dubbo.zk_address}" file= "${catalina.home}/ Dubbo-registry/dubbo-registry.properties "/>

This will be generated in the Catalina.home directory dubbo-registry This directory, the cache file will be in the inside of the slow existence. References

Abstractregistry Lock PROBLEM:HTTPS://GITHUB.COM/ALIBABA/DUBBO/ISSUES/81

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.