问题
I have a Cassandra
table for which I have enabled Solr
indexing, using command
dsetool create_core <keyspace>.<table> [<option> ...]
Question is how to delete this core?
I have tried unload
via HTTP Api
which returned UNLOAD unsupported!
回答1:
Update,
unload_core is now avaliable as of DSE 4.8 -- DSP-1533
Verbatim from the DataStax docs
Unloading a Solr core To disable full text search on a core, unload the core without removing its backing table.
To simplify Solr code unloading, use dsetool unload_core. The syntax of the command is:
$ dsetool unload_core . [ ...] where is one or more of the following options: Option Settings Default Description of default setting deleteDataDir= true or false false Retains the underlying Cassandra data. deleteResources= true or false false Retains the core configuration and schema resources. distributed= true or false true Deletes resources and data across the cluster. The distributed option governs the removal of data and resources. The Solr secondary indexes on the backing table are removed through Cassandra schema propagation even if distributed=false. Note: If one or more nodes fail to unload the core in distributed operations, an error message indicates the failing node or nodes. Issue the unload again.
回答2:
Core unloading support exists in DSE 4.8, as another answer now mentions. For DSE 4.7 and older, you'll want to perform the following steps:
- From
cqlsh
, remove all custom secondary indexes from the table that backs your Solr core. - (optional) From
cqlsh
, remove Solr resources for the core in question, likeschema.xml
andsolrconfig.xml
from the tablesolr_admin.solr_resources
. - (optional) Delete the contents of /solr.data/.
After performing step 1, no further indexing will occur on the node, and after performing steps 2 & 3 and restarting, there will be no trace of the core left.
Note: At the end of this process, the Cassandra table that backed your core should still be available.
来源:https://stackoverflow.com/questions/32457456/remove-core-from-datastax-solr