问题
I'm in the middle of configuring SolrCloud with Zookeeper but I struggle to load the config on ZK.
Here my steps:
- Configure an ensemble of 3 ZK, I see 1 leader and 2 follower
- 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
- 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) - Create Solr collection using API
http://<solr_ip>:8983/solr/admin/collections?action=CREATE&name=collection_test&numShards=2&replicationFactor=2&maxShardsPerNode=2
- 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.
回答1:
I used below steps to configure SolrCloud in my VM.
SolrCloud Setup Instructions
Infrastructure
a. Unix Boxes 3 b. ELB 1 c. create cnames for the unix boxes as cl-solr1, cl-solr2, cl-solr3
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
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 ..
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
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
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
来源:https://stackoverflow.com/questions/31790202/solrcloud-5-and-zookeeper-config-upload