You need to start a DataStax Enterprise node as a Solr node to run the demo. You can run the demo in these ways:
You can run Solr on one or more nodes. DataStax does not support running Solr and Hadoop on the same node, although it's possible to do so in a development environment. In production environments, run Solr and Hadoop on separate nodes.
Follow these steps to start DSE Search/Solr on a single node.
In another shell, check that your Cassandra ring is up and running. For example, on a Mac:
RHEL or Debian installations
dsetool ring -h localhost
Tar distribution, such as Mac
cd <install_location>/bin
./dsetool ring -h localhost
A table of information appears showing the state of the node and identifying it as a Solr node.
Now, set up and run the DSE search demo.
After starting DSE as a Solr node, open a shell window or tab, and follow these steps to run the demo.
Make the wikipedia demo directory your current directory. The location of the demo directory depends on your platform:
RHEL or Debian installations
cd /usr/share/dse-demos/wikipedia
Tar distribution
cd <install_location>/demos/wikipedia
Upload the schema.
./1-add-schema.sh
The script posts solrconfig.xml and schema.xml to these locations:
wiki.solr in the URL creates the keyspace (wiki) and the column family (solr) in Cassandra. The script also creates the Solr index and core.
Index the articles contained in the wikipedia-sample.bz2 file in the demo directory:
./2-index.sh --wikifile wikipedia-sample.bz2
Three thousand articles load.
To see a sample Wikipedia search UI, open your web browser and go to:
http://localhost:8983/demos/wikipedia
Inspect the index keyspace, wiki, using the Solr Admin tool:
http://localhost:8983/solr/
Be sure to enter the trailing "/".
Inspect the column family, solr. In the Solr Admin tool, click wiki.solr to inspect the schema.
To load all Wikipedia articles from the internet into Solr:
Upload the solrconfig.xml and schema.xml.
curl http://localhost:8983/solr/resource/wiki.solr/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8'
curl http://localhost:8983/solr/resource/wiki.solr/schema.xml --data-binary @schema.xml -H 'Content-type:text/xml; charset=utf-8'
Reload the core
curl "http://localhost:8983/solr/admin/cores?action=RELOAD&name=wiki.solr"
Attempting to load a solrconfig with a different dseTypeMappingVersion configuration and reloading the core causes an error.
Use the name of the file on the internet instead of the name of wikipedia-sample.bz2. The name of the file on the internet is:
enwiki-20111007-pages-articles25.xml-p023725001p026625000.bz2
Loading all the articles takes a long time, so be patient. To limit the number of articles, use the limit option. For example, to limit the number of articles to 10,000, use this command in step 3:
./2-index.sh --wikifile enwiki-20111007-pages-articles25.xml-p023725001p026625000.bz2 --limit 10000
DataStax 3.0.x adds an the dseTypeMappingVersion element to the solrconfig.xml of the DSE Search/Solr demos:
To use data from an earlier release, you need to use the default legacy type mapping. Disable the new Solr type mappings in the solrconfig.xml files of the demos by following these steps.
To run demos using data from an earlier release
Make the default legacy type mapping effective by commenting out the dseTypeMappingVersion element.
<!-- <dseTypeMappingVersion>1</dseTypeMappingVersion> -->
You can also use 0 instead of 1 for the version.
Delete the wikipedia data in Cassandra database and the Solr index.
Upload the solrconfig.xml and schema.xml.
curl http://localhost:8983/solr/resource/wiki.solr/solrconfig.xml --data-binary @solrconfig.xml -H 'Content-type:text/xml; charset=utf-8'
curl http://localhost:8983/solr/resource/wiki.solr/schema.xml --data-binary @schema.xml -H 'Content-type:text/xml; charset=utf-8'
Reload the core
curl "http://localhost:8983/solr/admin/cores?action=RELOAD&name=wiki.solr"
Attempting to load a solrconfig with a different dseTypeMappingVersion configuration and reloading the core causes an error.
Index the articles contained in the wikipedia-sample.bz2 file in the demo directory:
./2-index.sh --wikifile wikipedia-sample.bz2
You can run the wikipedia, stress, and log search demo directories on a secure cluster. Additional options you need to set are: