在 Alfresco 6.1 CE 中创建 Solr 分片

Creating Solr shards in Alfresco 6.1 CE

迁移到 Alfresco CE 6.1 (201901 GA) 和 Alfresco Search Services 后,我们拥有大量 . So I tried to configure sharding in solr by following Creating Solr shards manually。 我能够创建分片和索引接缝来工作,但是当我配置 Alfresco 以在 alfresco-global.properties

中使用分片时
solr6.store.mappings.value.solrMappingAlfresco.nodeString=solr.mycompany.com:8983/solr/#/alfresco
solr6.store.mappings.value.solrMappingAlfresco.numShards=4
solr6.store.mappings.value.solrMappingAlfresco.replicationFactor=1

solr6.store.mappings.value.solrMappingArchive.nodeString=solr.mycompany.com:8983/solr/#/archive
solr6.store.mappings.value.solrMappingArchive.numShards=4
solr6.store.mappings.value.solrMappingArchive.replicationFactor=1

我得到一个"Request failed 405"

/solr/#/alfresco-2/alfresco?wt=json&fl=DBID%2Cscore&rows=50&shards=solr.mycompany.com:8983%2Fsolr%2F%23%2Falfresco-0,solr.mycompany.com:8983%2Fsolr%2F%23%2Falfresco-1,solr.mycompany.com:8983%2Fsolr%2F%23%2Falfresco-2,solr.mycompany.com:8983%2Fsolr%2F%23%2Falfresco-3&df=TEXT&start=0&locale=*&alternativeDic=DEFAULT_DICTIONARY&sort=%40cm%3Amodified+desc&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON
        at org.alfresco.repo.search.impl.solr.AbstractSolrQueryHTTPClient.postQuery(AbstractSolrQueryHTTPClient.java:79)
        at org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.postSolrQuery(SolrQueryHTTPClient.java:1116)
        at es.keensoft.repo.search.impl.solr.EnhancedSolrQueryHTTPClient.postSolrQuery(EnhancedSolrQueryHTTPClient.java:43)
        at org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:583)
        at org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:52)
        at org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:354)
        at org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:84)
        at jdk.internal.reflect.GeneratedMethodAccessor789.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.alfresco.repo.management.subsystems.SubsystemProxyFactory.invoke(SubsystemProxyFactory.java:79)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
        at com.sun.proxy.$Proxy36.query(Unknown Source)
        at org.alfresco.repo.search.impl.SearchServiceSubSystemDelegator.query(SearchServiceSubSystemDelegator.java:133)
        at jdk.internal.reflect.GeneratedMethodAccessor789.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:166)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
        at com.sun.proxy.$Proxy36.query(Unknown Source)
        at org.alfresco.repo.jscript.Search.queryResultMeta(Search.java:1016)
        ... 100 more

为了更好的可读性解码 POST url 到 solr:

/solr/#/alfresco-2/alfresco?wt=json&fl=DBID,score&rows=50&shards=solr.mycompany.com:8983/solr/#/alfresco-0,solr.mycompany.com:8983/solr/#/alfresco-1,solr.mycompany.com:8983/solr/#/alfresco-2,solr.mycompany.com:8983/solr/#/alfresco-3&df=TEXT&start=0&locale=*&alternativeDic=DEFAULT_DICTIONARY&sort=@cm:modified+desc&fq={!afts}AUTHORITY_FILTER_FROM_JSON&fq={!afts}TENANT_FILTER_FROM_JSON

是否有人已经在 Alfresco 搜索服务(1.3.x、1.4)和 Alfresco 6.1 社区中成功配置了分片? 有人暗示出了什么问题吗? Alfresco 似乎不使用 solr 标准 urls 在分片索引中进行搜索,所以我不知道如何让它工作。

回答我自己的问题: 示例 Creating Solr shards manually doc 示例应该在 url 中没有井号,但是如果 solr 运行时支持 SSL not 工作。

solr6.store.mappings.value.solrMappingAlfresco.nodeString=solr.mycompany.com:8983/solr/alfresco
solr6.store.mappings.value.solrMappingAlfresco.numShards=4
solr6.store.mappings.value.solrMappingAlfresco.replicationFactor=1

solr6.store.mappings.value.solrMappingArchive.nodeString=solr.mycompany.com:8983/solr/archive
solr6.store.mappings.value.solrMappingArchive.numShards=4
solr6.store.mappings.value.solrMappingArchive.replicationFactor=1

作为替代方案,可以使用 DynamicShardRegistration,它没有记录在社区版本中工作,但如果你设置

useDynamicShardRegistration=true

露天-global.properties

另请参阅 https://github.com/Alfresco/SearchServices/issues/232

中的讨论