gpt4 book ai didi

java - 使用 ServerLauncher 后无法在 Gemfire 9 中启动脉冲

转载 作者:行者123 更新时间:2023-12-01 18:30:44 33 4
gpt4 key购买 nike

我正在尝试使用 java 代码运行 Gemfire Server。但是,我无法启动脉冲,因为我收到错误消息“未找到 geode-web-api war 文件”。

此后没有日志打印:

[info 2020/02/11 14:32:46.648 GMT tid=0x1] GEODE_HOME:C:\FAST\pivotal-gemfire-9.9.0

[warn 2020/02/11 14:32:46.649 GMT tid=0x1] geode-web-api war file was not found

[info 2020/02/11 14:32:46.649 GMT tid=0x1] Unable to find GemFire Developer REST API WAR file; the Developer REST Interface for GemFire will not be accessible.

[info 2020/02/11 14:32:46.650 GMT tid=0x1] Initializing region ParameterizedQueries

[info 2020/02/11 14:32:46.650 GMT tid=0x1] Initialization of region ParameterizedQueries completed

这是我用来运行 ServerLauncher 的代码:

public static void run(String cacheFile, String locator,
boolean enableJmx, String jmxPort, String httpPort, String locators) throws Exception {
if (StringUtils.isEmpty(cacheFile) || StringUtils.isEmpty(locator)) {
throw new Exception("Could not start Gemfire for configFile " + cacheFile + " and locator " + locator);
}
if (enableJmx && StringUtils.isEmpty(jmxPort)) {
throw new Exception("jmxPort not specified");
}
ServerLauncher serverLauncher = new ServerLauncher.Builder()
.set("cache-xml-file", cacheFile)
.set("start-locator", locator)
.set("jmx-manager", "" + enableJmx)
.set("jmx-manager-start", "true")
.set("log-level", "debug")
.set("jmx-manager-port", jmxPort)
.set("http-service-bind-address", "localhost")
.set("http-service-port", httpPort)
.set("jmx-manager-update-rate", "2000")
.set("start-dev-rest-api", "true")
// .set("locators", locators)
.build();
serverLauncher.start();
}

谢谢

最佳答案

我刚刚在本地尝试了以下操作(作为一个简单的示例),效果很好:


public class TestLocator {
static {
System.setProperty("gemfire.home", "/apps/pivotal-gemfire-9.9.1");
}

public static void main(String[] args) {
LocatorLauncher launcher = new LocatorLauncher.Builder()
.set("jmx-manager", "true")
.set("jmx-manager-start", "true")
.set("log-level", "config")
.set("log-file", "/test/locator.log")
.set("http-service-bind-address", "localhost")
.set("http-service-port", "7070")
.build();
launcher.start();
}
}

关于java - 使用 ServerLauncher 后无法在 Gemfire 9 中启动脉冲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60171508/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com