SolrCloud 5和Zookeeper配置上传 [英] SolrCloud 5 and Zookeeper config upload
问题描述
我正在使用Zookeeper配置SolrCloud,但是我很难在ZK上加载配置.
I'm in the middle of configuring SolrCloud with Zookeeper but I struggle to load the config on ZK.
这是我的步骤:
- 配置3个ZK的集合,我看到1个领导者和2个关注者
- 配置一个由2个SolrCloud组成的小型集群,其启动如下
/bin/solr start -c -z <ip1>:2181,<ip2>:2181,<ip3>:2181 -noprompt
- 然后我尝试使用zkCli.sh在ZK上加载配置:
./bin/zkCli.sh -zkhost <ip1>:2181,<ip2>:2181,<ip3>:2181 -cmd upconfig -confname config1 -confdir /folder/with/schema.xml
(独立于solr) - 使用API创建Solr集合
http://<solr_ip>:8983/solr/admin/collections?action=CREATE&name=collection_test&numShards=2&replicationFactor=2&maxShardsPerNode=2
- 再次使用zkCli.sh将配置链接到集合
./bin/zkCli.sh -zkhost 127.0.0.1:2181 -cmd linkconfig -collection collection_test -confname config1
- 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.
推荐答案
我使用以下步骤在VM中配置SolrCloud.
I used below steps to configure SolrCloud in my VM.
SolrCloud设置说明
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.为每个Zookeeper服务器cl-solr1,cl-solr2&创建myid文件. cl-solr3使用以下命令 $ mkdir -p/var/lib/zookeeper/data/ $ echo 1>/var/lib/zookeeper/data/myid --1表示cl-solr1,2表示cl-solr2 ..
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 ..
启动动物园管理员
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
启动SOLR
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
这篇关于SolrCloud 5和Zookeeper配置上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!