Giter Site home page Giter Site logo

Comments (3)

yin-bp avatar yin-bp commented on July 20, 2024

错误堆栈信息发出来,bboss的版本号也发出来

from bboss-elasticsearch.

WayneLee5991 avatar WayneLee5991 commented on July 20, 2024

错误信息:
Exception in thread "Elasticsearch-Elasticsearch-Tran" org.frameworkset.elasticsearch.ElasticSearchException: org.frameworkset.tran.ESDataImportException: ESIndex type not seted.
at org.frameworkset.tran.BaseElasticsearchDataTran.parallelBatchExecute(BaseElasticsearchDataTran.java:210)
at org.frameworkset.tran.BaseDataTran.tran(BaseDataTran.java:73)
at org.frameworkset.tran.es.output.AsynESOutPutDataTran.tran(AsynESOutPutDataTran.java:51)
at org.frameworkset.tran.es.input.es.ES2ESDataTranPlugin$1.run(ES2ESDataTranPlugin.java:141)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.frameworkset.tran.ESDataImportException: ESIndex type not seted.
at org.frameworkset.tran.BaseElasticsearchDataTran.buildMeta(BaseElasticsearchDataTran.java:530)
at org.frameworkset.tran.BaseElasticsearchDataTran.evalBuilk(BaseElasticsearchDataTran.java:691)
at org.frameworkset.tran.BaseElasticsearchDataTran.parallelBatchExecute(BaseElasticsearchDataTran.java:154)
... 4 more
线上就显示这么多信息
bboss版本:6.2.2

追踪了一下源码,应该是BaseElasticsearchDataTran的第517行的ESIndexWrapper为空导致此异常
importBuilder.builder()执行的时候,ES2ESExportBuilder的79行调用super.buildImportConfig(es2DBImportConfig);
代码如下:
if(index != null) {
ESIndexWrapper esIndexWrapper = new ESIndexWrapper(index, indexType);
// esIndexWrapper.setUseBatchContextIndexName(this.useBatchContextIndexName);
baseImportConfig.setEsIndexWrapper(esIndexWrapper);
}
index我确实设置了,那么ESIndexWrapper 就不应该为空啊

然后我突发奇想,加了一个setIndexType("_doc"); 这个配置,就不报错了。。

ES2ESExportBuilder importBuilder = new ES2ESExportBuilder();
importBuilder.setBatchSize(properties.getBatchSize()) //设置批量从源Elasticsearch中拉取的记录数
.setFetchSize(properties.getFetchSize()); //设置批量写入目标Elasticsearch记录数
importBuilder.setIndex(targetIndex) //设置要目标elasticsearch索引名称
.setIndexType("_doc");

但是ES7版本默认type是_doc呀,可以不用加的吧??

from bboss-elasticsearch.

yin-bp avatar yin-bp commented on July 20, 2024

我跑了一下测试demo,没有出现你说的问题:
https://github.com/bbossgroups/elasticsearch-elasticsearch/blob/master/src/main/java/org/frameworkset/elasticsearch/imp/ES2ESScrollAllTimestampDemo.java

importBuilder.setIndex("es2esdemo"); //全局设置要目标elasticsearch索引名称
					 //.setIndexType("es2esdemo"); //全局设值目标elasticsearch索引类型名称,如果是Elasticsearch 7以后的版本不需要配置

是不是你在运行的过程中有调用销毁的相关方法或者重启了 同步进程,导致配置被重置了才报错?

from bboss-elasticsearch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.