[关闭]
@aloxc 2017-12-05T06:35:46.000000Z 字数 1285 阅读 514

ignite停止检查新版本

ignite


如题,今天测试ignite的时候,看到一行日志,[16:25:12] New version is available at ignite.apache.org: 1.8.0
意思就是ignite已经发布新版本了,提醒我们升级,
为什么会有这个提示,经过查找代码发现提示是出自
org.apache.ignite.internal.processors.cluster.GridUpdateNotifier类,
里面有相关代码在方法

  1. void reportStatus(IgniteLogger log) {
  2. assert log != null;
  3. log = log.getLogger(getClass());
  4. String latestVer = this.latestVer;
  5. String downloadUrl = this.downloadUrl;
  6. downloadUrl = downloadUrl != null ? downloadUrl : IgniteKernal.SITE;
  7. if (latestVer != null)
  8. if (latestVer.equals(ver)) {
  9. if (!reportOnlyNew)
  10. throttle(log, false, "Your version is up to date.");
  11. }
  12. else
  13. throttle(log, true, "New version is available at " + downloadUrl + ": " + latestVer);
  14. else
  15. if (!reportOnlyNew)
  16. throttle(log, false, "Update status is not available.");
  17. }

经过分析代码,ignite通过org.apache.ignite.internal.processors.cluster.ClusterProcessor类来判断是否读取在线版本文件,

  1. public ClusterProcessor(GridKernalContext ctx) {
  2. super(ctx);
  3. notifyEnabled.set(IgniteSystemProperties.getBoolean(IGNITE_UPDATE_NOTIFIER,
  4. Boolean.parseBoolean(IgniteProperties.get("ignite.update.notifier.enabled.by.default"))));
  5. cluster = new IgniteClusterImpl(ctx);
  6. }

读取ignite.properties文件的ignite.update.notifier.enabled.by.default属性配置,ignite.properties文件在ignite-core.xxx.jar中,xxx是版本号,
为了不让ignite启动的时候做版本检查,我们可以修改该资源文件中ignite.update.notifier.enabled.by.default的值为false,也可以在ignite启动脚本上启动参数-DIGNITE_UPDATE_NOTIFIER=false.

x

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注