Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-17123

flink-sql-connector-elasticsearch版本与 es 版本不对应

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 1.10.0
    • Fix Version/s: None
    • Component/s: Command Line Client
    • Labels:
      None

      Description

      一.flink-sql-connector-es 与 es 版本 不对应
       
      二.es版本是7.6.0 ,但是用 flink-sql 连接器,只能用 es6 的,用es7的就报错了。
       
      比如:
      flink-sql-connector-elasticsearch6_2.11-1.10.0.jar ,对应 es7.6.0 和 flink1.10.0
      启动 sql-client.sh embedded
       
      create tb xxx
      insert xxx select xxx;
       
      然后看到 submit 了,但是任务是执行失败的。报:
       
      ...skipping...
      java.lang.NoClassDefFoundError: org/apache/flink/elasticsearch7/shaded/org/elasticsearch/script/mustache/SearchTemplateRequest
      at org.apache.flink.streaming.connectors.elasticsearch7.Elasticsearch7ApiCallBridge.createClient(Elasticsearch7ApiCallBridge.java:76)
      at org.apache.flink.streaming.connectors.elasticsearch7.Elasticsearch7ApiCallBridge.createClient(Elasticsearch7ApiCallBridge.java:48)
      at org.apache.flink.streaming.connectors.elasticsearch.ElasticsearchSinkBase.open(ElasticsearchSinkBase.java:299)
      at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36)
      at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
      at org.apache.flink.streaming.api.operators.StreamSink.open(StreamSink.java:48)
      at org.apache.flink.streaming.runtime.tasks.StreamTask.initializeStateAndOpen(StreamTask.java:1007)
      at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$0(StreamTask.java:454)
      at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:94)
      at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:449)
      at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:461)
      at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:707)
      at org.apache.flink.runtime.taskmanager.Task.run(Task.java:532)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.ClassNotFoundException: org.apache.flink.elasticsearch7.shaded.org.elasticsearch.script.mustache.SearchTemplateRequest
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 14 more
       
       
      三. 如果用 flink-sql-connector-elasticsearch7_2.11-1.10.0.jar , es7.6.0 ,flink1.10.0 报错了。改成
      flink-sql-connector-elasticsearch6_2.11-1.10.0.jar,es7.6.0 ,flink1.10.0 没问题了

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                longxibendi longxibendi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 72h
                  72h
                  Remaining:
                  Remaining Estimate - 72h
                  72h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified