SolrCloud-5.2.1 Cluster deployment and testing

Source: Internet
Author: User

I. Description

SOLR5 built-in jetty service, so no installation to Tomcat, the online deployment of Tomcat data is too rampant.

Pre-Deployment Preparation:

1. Configure each host IP as a static IP (to ensure that each host can communicate properly, in order to avoid excessive network transmission, it is recommended that the same network segment).

2. Modify the host name, configure the host mappings, modify the Hosts file, and add the mappings of each host IP and hostname.

3. Open the appropriate port or close the firewall directly.

4. Ensure that the Zookeeper Cluster service is running properly. Deployment reference for Zookeeper: http://www.cnblogs.com/wxisme/p/5178211.html

5. Root Permissions

6. Description of relevant parameters and components:

Collection: A complete index in the logical sense of the Solrcloud cluster. It is often divided into one or more shard, which use the same config Set. If the number of Shard is more than one, it is a distributed index, Solrcloud lets you refer to it by collection name, without needing to care about the Shard related parameters that need to be used in distributed retrieval.

Core: The SOLR core, a SOLR with one or more SOLR cores, each of which can provide index and query capabilities independently, one for each SOLR core or collection SHARD,SOLR The core is proposed to increase management flexibility and share resources. A different point in Solrcloud is that it uses a configuration that is in zookeeper, and the traditional SOLR core configuration file is in the configuration directory on disk.

Leader: Shard Replicas to win the election. Each shard has multiple replicas, and these replicas need to be elected to determine a leader. Elections can occur at any time, but they are usually triggered only when a particular SOLR instance fails. When documents are indexed, Solrcloud passes them to this shard corresponding Leader,leader and distributes them to all shard replicas.

A copy of the Replica:shard. Each replica exists in a core of SOLR. A collection named "Test" is created with Numshards=1, and the specified Replicationfactor is set to 2, which results in 2 replicas, that is, 2 cores, each in a different machine or SOLR instance. One will be named TEST_SHARD1_REPLICA1 and the other named TEST_SHARD1_REPLICA2. One of them will be elected as leader.

Logical shards of the shard:collection. Each shard is converted into one or more replicas and is elected to determine which is the leader.

Two. Installation process

1. Download the Solr-5.2.1 installation package to Apache official website

2. Go to the directory in the Solr file and execute the following command to extract the installation script from the compressed package:

Tar-xvzf solr-5.2.1.tgz solr-5.2.1/bin/install_solr_service.sh--strip-components=2

3. Run the installation script

Execute the following command to install SOLR:

./install_solr_service.sh solr-5.2.1.tgz-i/usr/solr/solr5-d/usr/solr/solr5-u solr-s solr-p 8983

or execute the following command to install by default:

./install_solr_service.sh solr-5.2.1.tgz

In fact, you can also directly unzip the installation package, and then customize the configuration.

4. Modify the configuration

Execute the following command to edit the solr.in.sh file:

vim/usr/solr5/solr.in.sh

Make changes as follows:

Solr_java_mem= "-XMS1G-XMX1G"

Zk_host= "NODE1:2181,NODE2:2181,NODE3:2181/SOLR"

Memory limits can be set as needed.

5. Follow the steps above to perform the installation on the other nodes

Three. Start the SOLR service and verify

1. Start the SOLR service by executing the following command in each node in the SOLR cluster:

Service SOLR Start

2. View SOLR Status

Service SOLR Status

3. Login to SOLR UI

Http://node1:8983/solr

Four. Test SOLR

SOLR provides several common ways to operate, shell commands, REST APIs, SOLRJ interfaces, and so on, depending on the actual situation. Here's how to use shell commands for a simple and convenient demonstration.

1. Open and edit the Schema.xml file under Server/solr/configsets/sample_techproducts_configs/conf and add a field at the end of the file.

2. Create a collection and upload the associated configuration file to zookeeper.

./BIN/SOLR create_collection-c students-d server/solr/configsets/sample_techproducts_configs/conf-shards 3- Replicationfactor 3

If you want to update the configuration file to zookeeper later, you can update all configurations with the following command:

./server/scripts/cloud-scripts/zkcli.sh-zkhost Node2:2181,node1:2181,node3:2181-cmd Upconfig-confname Students- Confdir server/solr/configsets/sample_techproducts_configs/conf

If you only update a single file using the Putfile command:

./server/scripts/cloud-scripts/zkcli.sh-zkhost Node2:2181,node1:2181,node3:2181-cmd putfile/solr/configs/ Students/schema.xml/usr/tempfiles/schema.xml

The path is the path where the configuration file is stored in zookeeper, which is the local path to the configuration file. It is important to note that if this file exists in the zookeeper, it needs to be deleted before uploading the update. You can log in to the zookeeper operation:

Zk_home/./bin/zkcli.sh-timeout 5000-server node3:2181

After logging in to zookeeper, you can use the command to delete the profile and other actions, and you can view the location of the configuration file in zookeeper if you don't know it.

3. Detect if collection was created successfully, refresh the page in the Solr UI, click Cloud if the successful creation of collection will show the SOLR cluster topology.

You can also see if the defined Schema.xml is in effect

4. Add an index and query the data

1. Adding index data can be done in several ways, using the SOLR UI to add simple index data for simplicity testing

Click Submit to return a successful message:

2. Query test

You can delete collection after the test is finished

Http://node1:8983/solr/admin/collections?action=DELETE&name=students

The deployment of SOLR and the simple tests are complete, and the next step is to learn more about how SOLR works, the definition of data structures, configurations, and queries.

Reference: SOLR Official documentation

Solr3.6.1 under the TOMCAT6 environment to build http://www.linuxidc.com/Linux/2013-01/77664.htm

Tomcat-based Solr3.5 cluster deployment http://www.linuxidc.com/Linux/2012-12/75297.htm

Use Nginx to load balance the SOLR cluster on Linux http://www.linuxidc.com/Linux/2012-12/75257.htm

Linux under installation using SOLR http://www.linuxidc.com/Linux/2012-10/72029.htm

Deploy SOLR 4 http://www.linuxidc.com/Linux/2012-09/71158.htm via Tomcat on Ubuntu 12.04 LTS

SOLR implements low Level query parsing (qparser) http://www.linuxidc.com/Linux/2012-05/59755.htm

Build a search server based on SOLR 3.5 http://www.linuxidc.com/Linux/2012-05/59743.htm

SOLR 3.5 Development Application Tutorial PDF HD version http://www.linuxidc.com/Linux/2013-10/91048.htm

SOLR 4 deployment Example Tutorial Http://www.linuxidc.com/Linux/2013-10/91041.htm

a detailed description of SOLR : please click here
SOLR : please click here.

This article permanently updates the link address : http://www.linuxidc.com/Linux/2016-02/128498.htm

SolrCloud-5.2.1 Cluster deployment and testing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.