我正在尝试使用Java代码运行Gemfire服务器。但是,由于出现错误消息“未找到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找不到文件
[info 2020/02/11 14:32:46.649 GMT tid = 0x1]无法找到GemFire开发人员REST API WAR文件;开发人员REST接口无法访问GemFire。
[info 2020/02/11 14:32:46.650 GMT tid = 0x1]初始化区域ParameterizedQueries
[info 2020/02/11 14:32:46.650 GMT tid = 0x1]的初始化区域ParameterizedQueries已完成
这是我用来运行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();
}
}