【问题标题】:how to programmatically start and stop zookeeper server如何以编程方式启动和停止 Zookeeper 服务器
【发布时间】:2014-03-16 03:00:52
【问题描述】:

我希望能够在我的 java 程序中启动、停止和配置 zookeeper 服务器。有没有办法做到这一点?

【问题讨论】:

    标签: java apache-zookeeper


    【解决方案1】:

    您可以使用Runtime.getRuntime().exec()Java SE 1.5 ProcessBuilder 在java 中执行(生成)新进程,还有一个选项apache open source project

    String line = "AcroRd32.exe /p /h " + file.getAbsolutePath();
    CommandLine cmdLine = CommandLine.parse(line);
    DefaultExecutor executor = new DefaultExecutor();
    int exitValue = executor.execute(cmdLine);
    

    【讨论】:

      猜你喜欢
      • 2016-04-17
      • 2010-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-15
      • 2011-06-13
      • 2020-09-11
      • 2019-03-16
      相关资源
      最近更新 更多