alfresco中的solr提出单独搭建solr服务器


alfresco安装好的目录中  有一个自带的web容器tomcat,里面同时跑了alfresco和solr两个web工程,两个工程之间互相通信
如果想分别部署,需要分别部署在两个web容器中,两个web容器可以放在不同的机器上,这样可以单独有一台搜索服务器,提高性能
下面来说说步骤 下面的web容器全部以tomcat为准
1. web容器中先部署solr工程
在web容器中,tomcat_home\Catalina\localhost 加入 solr.xml 文件,里面配置了solr搜索服务器的物理位置,通过其中的配置项,指定solr的关键配置文件所在的位置
现在是搜索服务器是205,所以 solr.xml在205上

2.web容器中分别修改alfresco和solr配置tomcat后台登陆的用户
X:\Alfresco\tomcat\conf  找到tomcat-users.xml,在安装好的alfresco中有这么一段话  这个文件是Tomcat后台登录的用户配置文件
(这是安装完默认的效果)
<tomcat-users>
<user username="CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repoclient" password="null"/>
<user username="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repository" password="null"/>
</tomcat-users>
这里是要改的
在 alfresco安装的web容器中的tomcat-users.xml去掉
<user username="CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repository" password="null"/>
在solr安装的web容器中的tomcat-users.xml去掉
        <user username="CN=Alfresco Repository Client, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB" roles="repoclient" password="null"/>

3.在solr搜索服务器端配置  告诉solr去索引哪个 内容库 ,solr和alfresco通信的时候不用ssl协议(去掉了alfresco中的公匙)
(1)X:\Alfresco\alf_data\solr\workspace-SpacesStore\conf  文件夹中有两个文件  文件1=solrconfig.xml 这个可以修改solr中的性能参数,也可以直接修改solrcore.properties配置
   solrcore.properties修改
alfresco.host=localhost ----------------alfresco.host=192.168.0.203(改为alfresco部署的地址)
alfresco.secureComms=https--------------alfresco.secureComms=none(去掉密匙验证)
alfresco.url=http://192.168.0.203:8080/alfresco/service
(2)X:\Alfresco\alf_data\solr\archive-SpacesStore\conf在做一次同样的动作


4.在alfresco内容库端 配置,告诉alfresco搜索需要使用的solr服务器在哪里
文件位置 X:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\subsystems\Search\solr\solr-search.properties
修改项:
solr.host=192.168.0.205(改为solr的部署地址)

5.在alfresco内容库端 配置,告诉alfresco和solr通信的时候不用ssl协议,直接用8443端口通信
文件位置 X:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\repository.properties
修改项:
solr.host=192.168.0.205(改为solr的部署地址)
solr.secureComms=none(和solr通信不用密匙)

6.在solr搜索服务器端配置 ,去掉 solr web工程中的安全限制
文件位置: X:\apache-tomcat-6.0.35\webapps\solr\WEB-INF\web.xml
去掉: <security-constraint>
        <web-resource-collection>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>repository</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

    <login-config>
        <auth-method>CLIENT-CERT</auth-method>
        <realm-name>Solr</realm-name>
    </login-config>

    <security-role>
       <role-name>repository</role-name>
    </security-role>

7.在alfresco内容库端 配置 ,去掉 alfresco web工程中的安全限制
文件位置:X:\Alfresco\tomcat\webapps\alfresco\WEB-INF\web.xml
去掉:<security-constraint>
      <web-resource-collection>
         <web-resource-name>SOLR</web-resource-name>
         <url-pattern>/service/api/solr/*</url-pattern>
      </web-resource-collection>

      <auth-constraint>
         <role-name>repoclient</role-name>
      </auth-constraint>

      <user-data-constraint>
         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
   </security-constraint>
  
   <login-config>
      <auth-method>CLIENT-CERT</auth-method>
      <realm-name>Repository</realm-name>
   </login-config>

   <security-role>
     <role-name>repoclient</role-name>
   </security-role>

8. 6,7和2有关系,理论上去掉6,7中的安全限制,2中有没有都没有用了,没试过,现在是6,7和2中的去掉






猜你喜欢

转载自ren00317574.iteye.com/blog/1695139