0

我有 5 个 solr cloud 和 4 个 zookeepers 安装了几个 windows 服务器,我无法从另一个 windows 服务器访问 solr cloud,你能告诉我如何在 windows 机器上使用 zookeeper 设置多个 solr cloud。我正在使用 solr 5.4.1 和 zookeeper 3.4.6 版本。

4

1 回答 1

0
    SOLR 5.4.1 SolrCloud Step by Step Configurations
    Apache SOLR Cloud Setup Instructions

    Below steps will detail you to install and configure SOLR in cloud mode. Here I will detail you in installing SOLR in 3 Nodes with 3 external ZooKeepers. In a real word for production use, we are supposed to run ZooKeepers in 3 different nodes other than the solr one, but here I am reusing SOLR nodes for the same.

    **1.Infrastructure**
    **a.WINDOWS CLOUDS-** 3: We are going to use these Windows clouds for installing SOLR as  well as ZooKeeper
    b.Create cloud names for the Windows clouds as solr1 for cloud1, solr2 for cloud 2, solr3 for cloud3 : This will make the setup configurations more readable as well as easy to move the setup to a different set of machines
    **2.Installations**
    **a.Java**
    Open JDK Runtime Environment 1.8.0_79
    **b.ZooKeeper**
    Install zookeeper-3.4.6 (zookeeper-3.4.6.tar.gz)
    c.SOLR
    solr-5.4.1 (solr-5.2.1.tgz)
    **3.Configurations**
    a.Java
    **Set JAVA_HOME**
    b.ZooKeeper
            i.Zoo.cfg: This is the file used by ZooKeeper to understand the cluster of ZooKeepers available as well as the port to be used for communicating to them. Below file should be same for all the instances of ZooKeepers  In solr1,solr2,solr3 create zoo.cfg file with below content at C:\zookeeper\data
    tickTime=2000
    dataDir=/zookeeper/data
    clientPort=2181
    initLimit=5
    syncLimit=2
    server.1=solr1:2888:3888
    server.2=solr2:2888:3888
    server.3=solr3:2888:3888           [replace solr 1,2,3 by your host address of particular cloud]
   ii.Myid file:myid file (which just contains the integer value say 1) helps to understand the ZooKeeper instance which server is it in the cluster. Value in myid should be matched against one of the server.<1>
    Create myid file in each zookeeper server solr1, solr2 & solr3 
    Ex :  C:\zookeeper\data/myid   --1 for solr1,2 for solr2 and 3 for slor 3 ..
    4.Initializing
    a.ZooKeeper:
           Since we have configured 3 ZooKeepers one each in solr1, solr2 and solr3, we have to start ZooKeepers in each node. Out of three, one instance of ZooKeeper will act as the leader and other will be followers.
    i.Start the ZooKeeper in every cloud  using below command
          C:\zookeeper\bin\  zkServer.cmd 
    ii.Check Status using Below Command
          C:\zookeeper\bin\ zkServer.cmd –server –z solr1:2181

    b.SOLR:
             Here two important parameters are -c which states running in cloud mode and -z where we pass the list of ZooKeeper instances. This is the way a node understands which cluster is that part of.
                                 i.Start the SOLR in each node using below commands
    C:\solr1\bin\ solr start  -c  -z “solr1:2181,solr2:2181,solr3:2181”
    C:\solr2\bin\ solr start  -c  -z “solr1:2181,solr2:2181,solr3:2181”
    C:\solr3\bin\ solr start  -c  -z “solr1:2181,solr2:2181,solr3:2181”
  **5.Collection Creation**
    a.Conf directory
    mkdir – C:\solr1\server\solr\mycore\conf
    Copy the contents of conf  folder from current system. Under above conf directory
    b.     Create the collection using below command
    C:\solr1\bin\ solr create -c my_collection -d C:\solr1\server\solr\mycore\conf  -n my_collection_cfg -shards 2 -replicationFactor 2
于 2016-03-28T13:42:53.437 回答