Examples of activeShards()


Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        System.out.println("--> Waiting for green status");
        while (true) {
            ClusterHealthResponse clusterHealth = client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet();
            if (clusterHealth.isTimedOut()) {
                System.err.println("--> cluster health timed out..., active shards [" + clusterHealth.activeShards() + "]");
            } else {
                break;
            }
        }
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        logger.info("starting node...");
        node = NodeBuilder.nodeBuilder().settings(settings).node();

        ClusterHealthResponse health = node.client().admin().cluster().prepareHealth().setTimeout("5m").setWaitForYellowStatus().execute().actionGet();
        logger.info("health: " + health.status());
        logger.info("active shards: " + health.activeShards());
        logger.info("active primary shards: " + health.activePrimaryShards());
        if (health.timedOut()) {
            logger.error("Timed out on health...");
        }
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest().waitForGreenStatus().waitForNodes("3").waitForRelocatingShards(0)).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.relocatingShards(), equalTo(0));
        assertThat(clusterHealth.activeShards(), equalTo(22));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));

        // sleep till the cluster state gets published, since we check the master
        Thread.sleep(200);
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        clusterHealth = client("server2").admin().cluster().health(clusterHealthRequest().waitForGreenStatus().waitForRelocatingShards(0).waitForNodes("2")).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.relocatingShards(), equalTo(0));
        assertThat(clusterHealth.activeShards(), equalTo(22));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));

        // sleep till the cluster state gets published, since we check the master
        Thread.sleep(200);
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        ClusterHealthResponse clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest().waitForGreenStatus()).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.relocatingShards(), equalTo(0));
        assertThat(clusterHealth.activeShards(), equalTo(11));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));

        ClusterState clusterState1 = clusterService1.state();
        RoutingNode routingNodeEntry1 = clusterState1.readOnlyRoutingNodes().nodesToShards().get(clusterState1.nodes().localNodeId());
        assertThat(routingNodeEntry1.numberOfShardsWithState(STARTED), equalTo(11));
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest().waitForGreenStatus().waitForRelocatingShards(0).waitForNodes("2")).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.relocatingShards(), equalTo(0));
        assertThat(clusterHealth.activeShards(), equalTo(11));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));

        // sleep till the cluster state gets published, since we check the master
        Thread.sleep(200);
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest().waitForGreenStatus().waitForRelocatingShards(0).waitForNodes("3")).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.relocatingShards(), equalTo(0));
        assertThat(clusterHealth.activeShards(), equalTo(11));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));

        // sleep till the cluster state gets published, since we check the master
        Thread.sleep(200);
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        clusterHealth = client("server3").admin().cluster().health(clusterHealthRequest().waitForGreenStatus().waitForNodes("2").waitForRelocatingShards(0)).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
        assertThat(clusterHealth.relocatingShards(), equalTo(0));
        assertThat(clusterHealth.activeShards(), equalTo(11));
        assertThat(clusterHealth.activePrimaryShards(), equalTo(11));

        // sleep till the cluster state gets published, since we check the master
        Thread.sleep(200);
View Full Code Here

Examples of org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse.activeShards()

        ClusterHealthResponse clusterHealth = client("server1").admin().cluster().health(clusterHealthRequest("test")
                .waitForYellowStatus().waitForRelocatingShards(0).waitForActiveShards(6)).actionGet();
        logger.info("Done Cluster Health, status " + clusterHealth.status());
        assertThat(clusterHealth.timedOut(), equalTo(false));
        assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.YELLOW));
        assertThat(clusterHealth.activeShards(), equalTo(6));

        refreshResponse = client("server1").admin().indices().refresh(refreshRequest("test")).actionGet();
        assertThat(refreshResponse.totalShards(), equalTo(9));
        assertThat(refreshResponse.successfulShards(), equalTo(6));
        assertThat(refreshResponse.failedShards(), equalTo(0));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.