Apache Solr – Terminology ”; Previous Next In this chapter, we will try to understand the real meaning of some of the terms that are frequently used while working on Solr. General Terminology The following is a list of general terms that are used across all types of Solr setups − Instance − Just like a tomcat instance or a jetty instance, this term refers to the application server, which runs inside a JVM. The home directory of Solr provides reference to each of these Solr instances, in which one or more cores can be configured to run in each instance. Core − While running multiple indexes in your application, you can have multiple cores in each instance, instead of multiple instances each having one core. Home − The term $SOLR_HOME refers to the home directory which has all the information regarding the cores and their indexes, configurations, and dependencies. Shard − In distributed environments, the data is partitioned between multiple Solr instances, where each chunk of data can be called as a Shard. It contains a subset of the whole index. SolrCloud Terminology In an earlier chapter, we discussed how to install Apache Solr in standalone mode. Note that we can also install Solr in distributed mode (cloud environment) where Solr is installed in a master-slave pattern. In distributed mode, the index is created on the master server and it is replicated to one or more slave servers. The key terms associated with Solr Cloud are as follows − Node − In Solr cloud, each single instance of Solr is regarded as a node. Cluster − All the nodes of the environment combined together make a cluster. Collection − A cluster has a logical index that is known as a collection. Shard − A shard is portion of the collection which has one or more replicas of the index. Replica − In Solr Core, a copy of shard that runs in a node is known as a replica. Leader − It is also a replica of shard, which distributes the requests of the Solr Cloud to the remaining replicas. Zookeeper − It is an Apache project that Solr Cloud uses for centralized configuration and coordination, to manage the cluster and to elect a leader. Configuration Files The main configuration files in Apache Solr are as follows − Solr.xml − It is the file in the $SOLR_HOME directory that contains Solr Cloud related information. To load the cores, Solr refers to this file, which helps in identifying them. Solrconfig.xml − This file contains the definitions and core-specific configurations related to request handling and response formatting, along with indexing, configuring, managing memory and making commits. Schema.xml − This file contains the whole schema along with the fields and field types. Core.properties − This file contains the configurations specific to the core. It is referred for core discovery, as it contains the name of the core and path of the data directory. It can be used in any directory, which will then be treated as the core directory. Print Page Previous Next Advertisements ”;
Category: apache Solr
Apache Solr – Basic Commands
Apache Solr – Basic Commands ”; Previous Next Starting Solr After installing Solr, browse to the bin folder in Solr home directory and start Solr using the following command. [Hadoop@localhost ~]$ cd [Hadoop@localhost ~]$ cd Solr/ [Hadoop@localhost Solr]$ cd bin/ [Hadoop@localhost bin]$ ./Solr start This command starts Solr in the background, listening on port 8983 by displaying the following message. Waiting up to 30 seconds to see Solr running on port 8983 [] Started Solr server on port 8983 (pid = 6035). Happy searching! Starting Solr in foreground If you start Solr using the start command, then Solr will start in the background. Instead, you can start Solr in the foreground using the –f option. [Hadoop@localhost bin]$ ./Solr start –f 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding ”file:/home/Hadoop/Solr/contrib/extraction/lib/xmlbeans-2.6.0.jar” to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding ”file:/home/Hadoop/Solr/dist/Solr-cell-6.2.0.jar” to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding ”file:/home/Hadoop/Solr/contrib/clustering/lib/carrot2-guava-18.0.jar” to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding ”file:/home/Hadoop/Solr/contrib/clustering/lib/attributes-binder1.3.1.jar” to classloader 5823 INFO (coreLoadExecutor-6-thread-2) [ ] o.a.s.c.SolrResourceLoader Adding ”file:/home/Hadoop/Solr/contrib/clustering/lib/simple-xml-2.7.1.jar” to classloader …………………………………………………………………………………………………………………………………………………………………………………………………………… …………………………………………………………………………………………………………………………………………………………………………………………………. 12901 INFO (coreLoadExecutor-6-thread-1) [ x:Solr_sample] o.a.s.u.UpdateLog Took 24.0ms to seed version buckets with highest version 1546058939881226240 12902 INFO (coreLoadExecutor-6-thread-1) [ x:Solr_sample] o.a.s.c.CoreContainer registering core: Solr_sample 12904 INFO (coreLoadExecutor-6-thread-2) [ x:my_core] o.a.s.u.UpdateLog Took 16.0ms to seed version buckets with highest version 1546058939894857728 12904 INFO (coreLoadExecutor-6-thread-2) [ x:my_core] o.a.s.c.CoreContainer registering core: my_core Starting Solr on another port Using –p option of the start command, we can start Solr in another port, as shown in the following code block. [Hadoop@localhost bin]$ ./Solr start -p 8984 Waiting up to 30 seconds to see Solr running on port 8984 [-] Started Solr server on port 8984 (pid = 10137). Happy searching! Stopping Solr You can stop Solr using the stop command. $ ./Solr stop This command stops Solr, displaying a message as shown below. Sending stop command to Solr running on port 8983 … waiting 5 seconds to allow Jetty process 6035 to stop gracefully. Restarting Solr The restart command of Solr stops Solr for 5 seconds and starts it again. You can restart Solr using the following command − ./Solr restart This command restarts Solr, displaying the following message − Sending stop command to Solr running on port 8983 … waiting 5 seconds to allow Jetty process 6671 to stop gracefully. Waiting up to 30 seconds to see Solr running on port 8983 [|] [/] Started Solr server on port 8983 (pid = 6906). Happy searching! Solr ─ help Command The help command of Solr can be used to check the usage of the Solr prompt and its options. [Hadoop@localhost bin]$ ./Solr -help Usage: Solr COMMAND OPTIONS where COMMAND is one of: start, stop, restart, status, healthcheck, create, create_core, create_collection, delete, version, zk Standalone server example (start Solr running in the background on port 8984): ./Solr start -p 8984 SolrCloud example (start Solr running in SolrCloud mode using localhost:2181 to connect to Zookeeper, with 1g max heap size and remote Java debug options enabled): ./Solr start -c -m 1g -z localhost:2181 -a “-Xdebug – Xrunjdwp:transport = dt_socket,server = y,suspend = n,address = 1044” Pass -help after any COMMAND to see command-specific usage information, such as: ./Solr start -help or ./Solr stop -help Solr ─ status Command This status command of Solr can be used to search and find out the running Solr instances on your computer. It can provide you information about a Solr instance such as its version, memory usage, etc. You can check the status of a Solr instance, using the status command as follows − [Hadoop@localhost bin]$ ./Solr status On executing, the above command displays the status of Solr as follows − Found 1 Solr nodes: Solr process 6906 running on port 8983 { “Solr_home”:”/home/Hadoop/Solr/server/Solr”, “version”:”6.2.0 764d0f19151dbff6f5fcd9fc4b2682cf934590c5 – mike – 2016-08-20 05:41:37″, “startTime”:”2016-09-20T06:00:02.877Z”, “uptime”:”0 days, 0 hours, 5 minutes, 14 seconds”, “memory”:”30.6 MB (%6.2) of 490.7 MB” } Solr Admin After starting Apache Solr, you can visit the homepage of the Solr web interface by using the following URL. Localhost:8983/Solr/ The interface of Solr Admin appears as follows − Print Page Previous Next Advertisements ”;