Book Image

Solr Cookbook - Third Edition

By : Rafal Kuc
Book Image

Solr Cookbook - Third Edition

By: Rafal Kuc

Overview of this book

Table of Contents (18 chapters)
Solr Cookbook Third Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Adding replicas after collection creation


Replicas are copies of the primary shard. They are very useful when it comes to handing performance issues—for example, if your current cluster can't keep up with queries, you can add new nodes and increase the number of replicas. This way, more Solr servers can serve queries and each of them will have fewer queries to process. In this recipe, we will learn how to add new shards to already created collections.

Getting ready

Before reading further, I advise you to read the Creating a new SolrCloud cluster and Having more than a single shard from a collection on a node recipes of this chapter. These recipes will show you how to create a new SolrCloud cluster and a collection. We also assume that ZooKeeper is running on 192.168.1.10 and is listening on port 2181. We already have the configuration called firstcollection stored in ZooKeeper and we already have four SolrCloud nodes running as a cluster.

How to do it...

  1. Let's start by creating a sample collection...