I have use this process to create the DIH :

1. Create the BLOB collection:
    * curl
http://localhost:8983/solr/admin/collections?action=CREATE&name=.system

2. Send definition and file for DIH
    * curl -X POST -H 'Content-Type: application/octet-stream' --data-binary
@ solr-dataimporthandler-6.6.1.jar
http://localhost:8983/solr/.system/blob/DataImportHandler
    * curl -X POST -H 'Content-Type: application/octet-stream' --data-binary
@ mysql-connector-java-5.1.46.jar
http://localhost:8983/solr/.system/blob/MySQLConnector
    * curl http://localhost:8983/solr/advertisements2/config -H
'Content-type:application/json' -d '{"add-runtimelib": {
"name":"DataImportHandler", "version":1 }}'
    * curl http://localhost:8983/solr/advertisements2/config -H
'Content-type:application/json' -d '{"add-runtimelib": {
"name":"MySQLConnector", "version":1 }}'

3. I have add on the config file the requestHandler with the API. Result :
###
      "/full-advertisements": {
        "runtimeLib": true,
        "version": 1,
        "class": "org.apache.solr.handler.dataimport.DataImportHandler",
        "defaults": {
          "config": "DIH/advertisements.xml"
        },
        "name": "/full-advertisements"
      },
###

4. I have add with the zkcli.sh script the .xml definition file in
/configs/advertisements2/DIH/advertisements.xml
###
    <dataConfig>

        <dataSource name="Gesloc" type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://srv-gesloc-sql/TRANSACTIONCITYANEWLOCATION" user="ics"
password="******" />

            <document>

            <entity name="Advertisements_Gesloc" dataSource="Gesloc" pk="id"
transformer="TemplateTransformer" query="SELECT id,origin FROM
view_indexation_advertisements" >

                <field column="id" name="id"/>
                <field column="origin" name="origin"/>

            </entity>

        </document>

    </dataConfig>
###

Thanks for your help.


-----Message d'origine-----
De : msaunier [mailto:msaun...@citya.com] 
Envoyé : mercredi 4 avril 2018 09:57
À : solr-user@lucene.apache.org
Cc : fharr...@citya.com
Objet : ZKPropertiesWriter error DIH (SolrCloud 6.6.1)

Hello,
I use Solr Cloud and I test DIH system in cloud, but I have this error :

Full Import
failed:org.apache.solr.handler.dataimport.DataImportHandlerException: Unable
to PropertyWriter implementation:ZKPropertiesWriter at
org.apache.solr.handler.dataimport.DataImporter.createPropertyWriter(DataImp
orter.java:330)
at
org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.ja
va:411)
at
org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:474
)
at
org.apache.solr.handler.dataimport.DataImporter.lambda$runAsync$0(DataImport
er.java:457)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException at
org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:935)
at
org.apache.solr.handler.dataimport.DataImporter.createPropertyWriter(DataImp
orter.java:326)
... 4 more

My DIH definition on the cloud

<dataConfig>

<dataSource name="Gesloc" type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://srv-gesloc-sql/TRANSACTIONCITYANEWLOCATION" user="ics"
password="IcsPerms"
runtimeLib="true" version="1"/>

<document>

<entity name="Advertisements_Gesloc" dataSource="Gesloc" pk="id"
transformer="TemplateTransformer"
query="SELECT id,origin FROM view_indexation_advertisements" >

<field column="id" name="id"/>
<field column="origin" name="origin"/>

</entity>

</document>

</dataConfig>

Call response :
 
<http://localhost:8983/solr/advertisements2/full-advertisements?command=full
-import&clean=false&commit=true>
http://localhost:8983/solr/advertisements2/full-advertisements?command=full-
import&clean=false&commit=true

<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">2</int>
</lst>
<lst name="initArgs">
<bool name="runtimeLib">true</bool>
<long name="version">1</long>
<lst name="defaults">
<str name="config">DIH/advertisements.xml</str>
</lst>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"/>
<lst name="statusMessages"/>
</response>

I don't understand why I have this error. Can you help me ?
Thanks you.

 



Reply via email to