Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.9k views
in Technique[技术] by (71.8m points)

solr - SolrCloud 5 and Zookeeper config upload

I'm in the middle of configuring SolrCloud with Zookeeper but I struggle to load the config on ZK.

Here my steps:

  1. Configure an ensemble of 3 ZK, I see 1 leader and 2 follower
  2. Configure a small cluster of 2 of SolrCloud that is started as followed /bin/solr start -c -z <ip1>:2181,<ip2>:2181,<ip3>:2181 -noprompt
  3. Then I tried to load the config on ZK using zkCli.sh: ./bin/zkCli.sh -zkhost <ip1>:2181,<ip2>:2181,<ip3>:2181 -cmd upconfig -confname config1 -confdir /folder/with/schema.xml (it come from solr standalone)
  4. Create Solr collection using API http://<solr_ip>:8983/solr/admin/collections?action=CREATE&name=collection_test&numShards=2&replicationFactor=2&maxShardsPerNode=2
  5. Link the config to the collection using again zkCli.sh ./bin/zkCli.sh -zkhost 127.0.0.1:2181 -cmd linkconfig -collection collection_test -confname config1

At this point I should see the config loaded but nothing happens.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I used below steps to configure SolrCloud in my VM.

SolrCloud Setup Instructions

  1. Infrastructure

    a.  Unix Boxes 3
    b.  ELB 1
    c.  create cnames for the unix boxes as cl-solr1, cl-solr2, cl-solr3
    
  2. Installations

    a.  Install zookeeper-3.4.6 (zookeeper-3.4.6.tar.gz)
    b.  solr-5.2.1 (solr-5.2.1.tgz)
    c.  OpenJDK Runtime Environment 1.7.0_79
    
  3. Setup

    a.  Set JAVA_HOME
    b.  In cl-solr1,cl-solr2,cl-solr3 create zoo.cfg file with below content at /opt/myname/zookeeper-3.4.6/conf
            tickTime=2000
            dataDir=/var/lib/zookeeper/data
            clientPort=2181
            initLimit=5
            syncLimit=2
            server.1=cl-solr1:2888:3888
            server.2=cl-solr2:2888:3888
            server.3=cl-solr3:2888:3888
    

    c. Create myid file for each zookeeper server cl-solr1, cl-solr2 & cl-solr3 using below command $mkdir -p /var/lib/zookeeper/data/ $echo 1 > /var/lib/zookeeper/data/myid --1 for cl-solr1 and 2 for cl-solr2 ..

  4. Start the zookeeper

    a.  /opt/myname/zookeeper-3.4.6/bin/zkServer.sh start
    b.  /opt/myname/zookeeper-3.4.6/bin/zkServer.sh status
    c.  Status check in detail via
        echo stat | nc cl-solr1 2181
    
  5. Start the SOLR

    a.  cl-solr1$ /opt/myname/solr-5.2.1/bin/solr start -c -z cl-solr1:2181,cl-solr2:2181,cl-solr3:2181 -h cl-solr1
    b.  cl-solr2$ /opt/myname/solr-5.2.1/bin/solr start start -c -z cl-solr1:2181,cl-solr2:2181,cl-solr3:2181 -h cl-solr2
    c.  cl-solr3$ /opt/myname/solr-5.2.1/bin/solr start -c -z cl-solr1:2181,cl-solr2:2181,cl-solr3:2181 -h cl-solr3
    
  6. Create a new Collection

    a.  From one of the nodes (cl-solr1) fire below commands
        i.  mkdir -p /opt/myname/solr-5.2.1/server/solr/pats/conf
        ii. Copy conf folder from current system
        iii.    /opt/myname/solr-5.2.1/bin/solr create -c my_colln_name -d /opt/myname/solr-5.2.1/server/solr/pats/conf -n myname_cfg -shards 2 -replicationFactor 2
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...