Standalone
and SolrCloud
.cores
to save documents.collections
to save documents.${SOLR_HOME}
"${SOLR_HOME}
" is the path to the Solr home directory; for example: "/opt/solr/server/solr
".${SOLR_ROOT}
"${SOLR_ROOT}
" is the path to the Solr distribution directory; for example: "/opt/solr
".xxxxxxxxxx
|+ ${SOLR_HOME}/
|+ solr.xml
|+ core1/
|+ core.properties
|+ data/
|+ index/
|+ tlog/
|+ snapshot_metadata/
|+ conf/
|+ solrconfig.xml
|+ managed-schema
|+ ...
|+ core2/
|+ ...
${SOLR_HOME}/solr.xml
${SOLR_HOME}
must contain a solr.xml
file, otherwise Solr will fail to start.xxxxxxxxxx
$ vi /opt/solr/server/solr/solr.xml
xxxxxxxxxx
<?xml version="1.0" encoding="UTF-8" ?>
<!--
"solr.xml" file allows configuring one or more Solr Cores,
as well as allowing Cores to be added, removed, and reloaded via HTTP requests.
-->
<solr>
<int name="maxBooleanClauses">${solr.max.booleanClauses:1024}</int>
<str name="sharedLib">${solr.sharedLib:}</str>
<solrcloud>
<str name="host">${host:}</str>
<int name="hostPort">${jetty.port:8983}</int>
<str name="hostContext">${hostContext:solr}</str>
<bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
<int name="zkClientTimeout">${zkClientTimeout:30000}</int>
<int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int>
<int name="distribUpdateConnTimeout">${distribUpdateConnTimeout:60000}</int>
<str name="zkCredentialsProvider">${zkCredentialsProvider:org.apache.solr.common.cloud.DefaultZkCredentialsProvider}</str>
<str name="zkACLProvider">${zkACLProvider:org.apache.solr.common.cloud.DefaultZkACLProvider}</str>
</solrcloud>
<shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory">
<int name="socketTimeout">${socketTimeout:600000}</int>
<int name="connTimeout">${connTimeout:60000}</int>
<str name="shardsWhitelist">${solr.shardsWhitelist:}</str>
</shardHandlerFactory>
</solr>
${SOLR_HOME}/CORE-NAME/core.properties
xxxxxxxxxx
$ mkdir /opt/solr/server/solr/new_core
xxxxxxxxxx
$ cp -r /opt/solr/server/solr/configsets/sample_techproducts_configs/conf /opt/solr/server/solr/new_core/
xxxxxxxxxx
$ ls -1 /opt/solr/server/solr/new_core/
xxxxxxxxxx
conf
core.properties
data
xxxxxxxxxx
$ vi /opt/solr/server/solr/new_core/core.properties
xxxxxxxxxx
name=new_core
config=solrconfig.xml
schema=schema.xml
dataDir=data
name
is added to the core.properties
file.name
will be used to create the directory name of the core.xxxxxxxxxx
$ /opt/solr/bin/solr create_core -c new_core1 -d /opt/solr/server/solr/configsets/sample_techproducts_configs/conf/
xxxxxxxxxx
$ cat /opt/solr/server/solr/new_core1/core.properties
xxxxxxxxxx
name=new_core1
${SOLR_HOME}/CORE-NAME/data
${SOLR_HOME}/CORE-NAME/conf
xxxxxxxxxx
|+ ${SOLR_HOME}/
|+ solr.xml
|+ zoo.cfg
|+ collection1_shard1_replica_n1/
|+ core.properties
|+ data/
|+ index/
|+ tlog/
|+ snapshot_metadata/
|+ collection1_shard2_replica_n2/
|+ ...
${SOLR_HOME}/solr.xml
solr.xml
" file.${SOLR_HOME}
must contain a solr.xml
file, otherwise Solr will fail to start.${SOLR_HOME}/zoo.cfg
${SOLR_HOME}
must contain a zoo.cfg
file, otherwise Solr will fail to start.xxxxxxxxxx
$ vi /opt/solr/server/solr/zoo.cfg
xxxxxxxxxx
# The number of milliseconds of each tick.
tickTime=2000
# The number of ticks that the initial synchronization phase can take.
initLimit=10
# The number of ticks that can pass between sending a request and getting an acknowledgement.
syncLimit=5
# The directory where the snapshot is stored.
# NOTE: Solr defaults the dataDir to <solrHome>/zoo_data
# dataDir=/opt/zookeeper/data
${SOLR_HOME}/REPLICA-NAME/core.properties
xxxxxxxxxx
$ vi /opt/solr/server/solr/collection1_shard1_replica_n1/core.properties
xxxxxxxxxx
name=collection1_shard1_replica_n1
collection=collection1
collection.configName=solr_config1
numShards=2
shard=shard1
coreNodeName=core_node1
replicaType=NRT
${SOLR_HOME}/REPLICA-NAME/data
Core
" will refer to the complete logical index that will contain documents.Collection
" will refer to the complete logical index that will contain documents.Core
" will be used to refer to the replica:core.properties
" is created for each replica.Collection Selector
" and "Core Selector
" (and not a Shard or Replica selector).