Added the logging of the current ulimits of the machine.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/eda33f58 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/eda33f58 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/eda33f58 Branch: refs/heads/0.2-dev Commit: eda33f58be8c9f6df528a3056e46f64785100ae7 Parents: 7834b04 Author: Aaron McCurry <[email protected]> Authored: Mon Feb 18 20:49:53 2013 -0500 Committer: Aaron McCurry <[email protected]> Committed: Mon Feb 18 20:49:53 2013 -0500 ---------------------------------------------------------------------- .../org/apache/blur/thrift/ThriftBlurServer.java | 29 ++++++++++++++- 1 files changed, 27 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/eda33f58/src/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurServer.java ---------------------------------------------------------------------- diff --git a/src/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurServer.java b/src/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurServer.java index 23faf73..86ce7d1 100644 --- a/src/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurServer.java +++ b/src/blur-core/src/main/java/org/apache/blur/thrift/ThriftBlurServer.java @@ -35,6 +35,10 @@ import static org.apache.blur.utils.BlurConstants.BLUR_ZOOKEEPER_CONNECTION; import static org.apache.blur.utils.BlurConstants.BLUR_ZOOKEEPER_SYSTEM_TIME_TOLERANCE; import static org.apache.blur.utils.BlurUtil.quietClose; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -79,8 +83,10 @@ public class ThriftBlurServer extends AbstractThriftServer { private static final Log LOG = LogFactory.getLog(ThriftBlurServer.class); public static void main(String[] args) throws Exception { + printUlimits(); + int serverIndex = getServerIndex(args); - LOG.info("Setting up Shard Server"); + LOG.info("Setting up Blur Server"); Thread.setDefaultUncaughtExceptionHandler(new SimpleUncaughtExceptionHandler()); BlurConfiguration configuration = new BlurConfiguration(); @@ -89,6 +95,25 @@ public class ThriftBlurServer extends AbstractThriftServer { server.start(); } + private static void printUlimits() throws IOException { + ProcessBuilder processBuilder = new ProcessBuilder("ulimit", "-a"); + Process process; + try { + process = processBuilder.start(); + } catch (Exception e) { + LOG.warn("Could not run ulimit command to retrieve limits.", e); + return; + } + + InputStream inputStream = process.getInputStream(); + BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); + String line; + while ((line = reader.readLine()) != null) { + LOG.info("ulimit: " + line); + } + reader.close(); + } + public static AbstractThriftServer createServer(int serverIndex, BlurConfiguration configuration) throws Exception { // setup block cache // 134,217,728 is the slab size, therefore there are 16,384 blocks @@ -162,7 +187,7 @@ public class ThriftBlurServer extends AbstractThriftServer { } BlurUtil.setupZookeeper(zooKeeper, configuration.get(BLUR_CLUSTER_NAME)); - + final ZookeeperClusterStatus clusterStatus = new ZookeeperClusterStatus(BlurConstants.BLUR_CLUSTER, zooKeeper); final BlurIndexRefresher refresher = new BlurIndexRefresher();
