14.SolrCloud环境搭建
1.在三台服务器上搭建ZooKeeper环境
详细步骤见ZK笔记
2.在四台服务器上搭建Solr单机版环境
详细步骤见Solr笔记09
3.将某一个Solrhome的Collection下的conf上传至Zookeeper
java -classpath C:\Tomcat\webapps\solr\WEB_INF\lib/* org.apache.solr.cloud.ZKCLI -zkhost zookeeper01:2181,zookeeper02:2181,zookeeper03:2181, -cmd upconfig -confdir D:\SolrCloud\solrhome\collection1\conf -confname myconf
4.修改每个SolrHome下的solr.xml
5.在每台Solr服务器上配置Zookeeper的信息
# tomcat/bin/catalina.bat
set JAVA_OPTS="-DzkHost=zookeeper01:2181,zookeeper02:2181,zookeeper03:2181"
6.创建新的collection2并分片
# 在浏览器中访问如下地址,新建collection2,有两个分片,每个分片有两个节点
http://127.0.0.1/solr/admin/collections?action=CREATE&name=collection2&numShareds=2&replicationFactor=2
疑问:为什么不需要定义字段
7.删除原有的collection1
http://127.0.0.1/solr/admin/collections?action=DELETE&name=collection1