Skip to content

Instantly share code, notes, and snippets.

@jeongho
Created February 25, 2016 17:34
Show Gist options
  • Save jeongho/813030809e3dc0281579 to your computer and use it in GitHub Desktop.
Save jeongho/813030809e3dc0281579 to your computer and use it in GitHub Desktop.
Solr CLI 1) add offline shad 2) add replica
------------------------------
# solr search string with NULL values
*:* -field_name:[* to *]
------------------------------
# solr add offline shard
solrctl --solr http://<target_solr_server>:8983/solr
core --create <core_name> \
-p dataDir=<index_hdfs_path> \
-p collection.configName=<config_name> \
-p collection=<collection_name> \
-p numShards=<int> \
-p shard=<shard_id>
where:
- target_solr_server: target server for new shard
- core_name: <collection_name>_<shard_id>_<replica_id>
- shard_id: shard identifier. e.g. shard2, etc
------------------------------
# solr add replica
solrctl --zk <zkhost>:2181/solr \
--solr <solr_server>:8983/solr
core --create <new_shard_id> \
-p collection=<collection> \
-p shard=<shard>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment