Creating Solr shards in Alfresco 6.1 CE

时光怂恿深爱的人放手 提交于 2019-12-25 01:14:46

问题


After migrating to Alfresco CE 6.1 (201901 GA) and Alfresco Search Services we have massive search performance problems. So I tried to configure sharding in solr by following Creating Solr shards manually. I was able to create the shards and indexing seams to work but when I configure Alfresco to use sharding in 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

I get a "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$1.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

For better readability the decoded POST url to 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

Was anybody already successfully in configuring sharding in Alfresco Search Services (1.3.x, 1.4) and Alfresco 6.1 Community? Does anybody have a hint what is going wrong? Alfresco seems not to use the solr standard urls for searching in the sharded index so I'm somehow lost how to get this working.


回答1:


to answer my own question: the example Creating Solr shards manually doc example should be without the hash sign in the url but does not work if solr runs with SSL support.

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

as an alternative it is possible to use the DynamicShardRegistration which is not documented to work in the community version but is working if you set

useDynamicShardRegistration=true

in alfresco-global.properties

see also the discussion in https://github.com/Alfresco/SearchServices/issues/232



来源:https://stackoverflow.com/questions/59244353/creating-solr-shards-in-alfresco-6-1-ce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!