首页 文章

ycsb加载运行elasticsearch

提问于
浏览
0

我正在尝试在ElasticSearch上运行基准软件yscb

我遇到的问题是,在加载之后,数据似乎在清理期间被删除 .

我很难理解应该发生什么?

如果我注释掉清理,它仍然会失败,因为它在“运行”阶段找不到索引 .

有人可以解释一下YSCB应该发生什么吗?

我的意思是我认为它将具有1.加载阶段:加载说1,000,000条记录2.运行阶段:查询在“加载阶段”期间加载的记录

谢谢,

3 回答

  • 0

    好吧,我通过在YCSB中运行Couchbase发现不应该删除数据 .

    查看ElasticSearchClient的cleanup()我发现没有理由删除文件(?)

    @Override
    public void cleanup() throws DBException {
        if (!node.isClosed()) {
            client.close();
            node.stop();
            node.close();
        }
    }
    

    init如下:任何原因都不会在文件系统上持续存在?

    public void init() throws DBException {
        // initialize OrientDB driver
        Properties props = getProperties();
        this.indexKey = props.getProperty("es.index.key", DEFAULT_INDEX_KEY);
        String clusterName = props.getProperty("cluster.name", DEFAULT_CLUSTER_NAME);
        Boolean newdb = Boolean.parseBoolean(props.getProperty("elasticsearch.newdb", "false"));
        Builder settings = settingsBuilder()
                .put("node.local", "true")
                .put("path.data", System.getProperty("java.io.tmpdir") + "/esdata")
                .put("discovery.zen.ping.multicast.enabled", "false")
                .put("index.mapping._id.indexed", "true")
                .put("index.gateway.type", "none")
                .put("gateway.type", "none")
                .put("index.number_of_shards", "1")
                .put("index.number_of_replicas", "0");
    
    
        //if properties file contains elasticsearch user defined properties
        //add it to the settings file (will overwrite the defaults).
        settings.put(props);
        System.out.println("ElasticSearch starting node = " + settings.get("cluster.name"));
        System.out.println("ElasticSearch node data path = " + settings.get("path.data"));
    
        node = nodeBuilder().clusterName(clusterName).settings(settings).node();
        node.start();
        client = node.client();
    
        if (newdb) {
            client.admin().indices().prepareDelete(indexKey).execute().actionGet();
            client.admin().indices().prepareCreate(indexKey).execute().actionGet();
        } else {
            boolean exists = client.admin().indices().exists(Requests.indicesExistsRequest(indexKey)).actionGet().isExists();
            if (!exists) {
                client.admin().indices().prepareCreate(indexKey).execute().actionGet();
            }
        }
    }
    

    谢谢,

  • 0

    好的,我发现如下

    (ElasticSearch的任何帮助都非常感谢!!!!因为我显然做错了什么)

    即使当负载关闭而数据落后时,“运行”仍然无法在启动时找到数据

    ElasticSearch node data path = C:\Users\Pl_2\AppData\Local\Temp\/esdata
    org.elasticsearch.action.NoShardAvailableActionException: [es.ycsb][0] No shard available for [[es.ycsb][usertable][user4283669858964623926]: routing [null]]
    at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.perform(TransportShardSingleOperationAction.java:140)
    at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.start(TransportShardSingleOperationAction.java:125)
    at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:72)
    at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:47)
    at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
    at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:83)
    
  • 0

    github自述文件已updated .

    看起来您需要指定使用:

    -p path.home=<path to folder to persist data>
    

相关问题