1) 把一个已有的core添加到集群中去
现在solr集群中已有两个配置文件 ,三个索引:
在另一台单独的solr上已运行了一个索引,现需要将此索引迁移到此集群中.
① 将配置文件上传到zk中
/opt/solr-5.5.3/server/scripts/cloud-scripts/zkcli.sh -zkhost 192.168.75.101:2181,192.168.75.102:2181,192.168.75.103:2181 -cmd upconfig -confname oldharvewifi -confdir /opt/solrcloud/config/oldharvewifi
② 将core(含数据)拷贝到集群的其中一台机器中
起名字为oldharvewifi
/opt/solr-5.5.3/oldharvewifi
删除oldharvewifi中的配置文件目录及core.properties文件,只留下了data目录
③ 创建索引
在solr页面创建索引,core和collection都起名叫:oldharvewifi
此时便可直接查询数据:
迁移成功了。
回到目录看:
多了一个core.properties文件,内容如下:
#Written by CorePropertiesLocator
#Fri Aug 04 09:10:14 UTC 2017
name=oldharvewifi
config=solrconfig.xml
schema=schema.xml
shard=oldharvewifi_shard1
dataDir=data
collection=oldharvewifi
coreNodeName=core_node1
④ 其他机器引入集群
在另两台机器上也创建一个相同的collection:
此时在一台机器修改数据,在其他机器都能查出结果。