首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SolrCloud和zookeeper

SolrCloud和zookeeper
EN

Stack Overflow用户
提问于 2016-03-16 20:57:36
回答 1查看 599关注 0票数 0

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

EN

回答 1

Stack Overflow用户

发布于 2016-03-28 21:42:53

代码语言:javascript
复制
    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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36036396

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档