启动多个dubbo应用端出现这个错误: dubbo.cache is not exclusive. Maybe multiple Dubbo instances are using the same folder. 解决: SpringBoot启动类添加以下方法指向你的缓存目录:
String dubboCachePath = GlobalEx.APP_BASE_DIR + File.separator + "dubbo-cache"; System.setProperty("dubbo.meta.cache.filePath", filePath); System.setProperty("dubbo.mapping.cache.filePath",filePath);
APP_BASE_DIR常量:
String APP_BASE_DIR = new ApplicationHome().getDir().getAbsolutePath();
然后把registory也配置到运行目录的dubbo-cache目录下:
dubbo.registry.file: ./dubbo-cache/dubbo-registry.properties
这样dubbo的缓存都在发布目录了