一、动态切换单机和集群 spring-solr 的配置

<!-- 单机版 solrj -->
<bean id = "httpSolrServer" class="org.apache.solr.client.solrj.impl.HttpSolrServer">
    <constructor-arg index="0" value="http://192.168.25.129:8080/solr/collection1"></constructor-arg>
</bean>

<!-- 集群版 solrj -->
<bean id = "cloudSolrServer" class="org.apache.solr.client.solrj.impl.CloudSolrServer">
    <constructor-arg index="0" value="192.168.25.129:2181,192.168.25.129:2182,192.168.25.129:2183"></constructor-arg>
    <property name="defaultCollection" value="collection2"></property>        
</bean>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-11-19
  • 2022-01-19
  • 2021-10-15
  • 2021-12-24
  • 2021-11-23
猜你喜欢
  • 2022-01-04
  • 2021-09-29
  • 2021-05-23
  • 2021-07-13
  • 2022-12-23
相关资源
相似解决方案