Please note that: Hortonworks HDP
Sandbox comes with out-of-the-box Solr service that can be easily provisioned
or enabled and used as well for this exercise through Ambari UI, instead of
installing Solr service on a standalone node.
Oracle side
- Create a dummy table with the
following structure:
Create a new
collection by invoking the “solr create –c” command from the path
“/opt/solr/bin” as following:
[2]
From Solr
portal (URL: http://[Solr-IP-Address]:8983/solr/#/), make sure that the new
collection is appeared
[3]
from the left panel of Solr home page, and
after selecting the “Oracle_table” core, select “Schema”, add the schema for
the new table created in Oracle DB.
on the right side, press “Add Field” button and make sure not to delete one
of the main “Fields”.
[4][5]
[6][7]
after
creating the schema fields, they should appear in the “Fields” list.
[8]
Create the
“data-config.xml” file under “/var/solr/data/Oracle_table/conf/”.
make sure of the column/field mapping between the Oracle DB table and Solr’s
Schema fields are properly configured properly.
From the
Solr web UI, make sure that the “DataImport” under the created collection
“Oracle_table” is as following without errors or warnings:
[9]
press
“Execute” button, and wait for a while or press “Refresh Status” button till a
green notification panel is appeared, such as following:
[10]
Results
Solr Side
from the
left panel in Solr, select “Query”, and make sure that you’ll get results (on
the right side) after pressing on “Execute Query” button, as following:
[11]
Future
Work
The future work will be extending Solr standalone node to
be within a small cluster for maintaining the cores’ replication and high
availability.