Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
Alfresco Tech Talk Live (TTL) Demo Script
This is the demo script Martin used for Episode #57 of Tech Talk Live. It still needs to be cleaned up a bit...
- From a fresh install show the Share Admin page plus related Solr dirs and files
(Solr is installed in the same Tomcat container as Alfresco, and the connection URL is unchanged from the default. The Solr home is in the Alfresco data directory, which also contains the Solr data files.)
- Show search section under More... | More... logged in as admin
Search Manager page shows what search sub-system is enabled
Show Solr config page, note. changes here are setup in DB so cannot use alfresco-global.properties after this
Backup 2am every night
Want to keep config in puppet for production installations
- Walkthrough of Solr related files and installation directories
alfresco-global.properties
Show rest of properties in repository.properties
Solr Webapp in tomcat/conf/Catalina/localhost/solr.xml
Specifies where Solr Home is and where to pick up WAR
alf_data/solr/solr.xml specifies the cores and there config dirs, explain core index dir and core config dir
\workspace-SpacesStore\alfrescoModels
alfrescoResources
conf
solrcore.properties about how it connects to Alfresco, only talk about the basic properties (4.0.2 multi thread tracking)
schema.xml for core
talk about AlfrescoDataType and how it reads alfrescoModels
solrconfig.xml
this is where the request handlers are configured and any extra search components are hooked up, no standard req handlers are used, specific once for alfresco, afts, cmis
show the /alfresco one and its components and queryparser config
- From a fresh install show the Solr Admin interface and what is relevant
- https://localhost:8443/solr/
- Show importing cert from blog
- Talk about that you can access config and schema from Admin, so no need to have access to file system
- Show Schema Browser that displays all fields being indexed via dynamic field in schema
- Demo search: https://localhost:8443/solr/alfresco/select/?q=alfresco&version=2.2&start=0&rows=10&indent=on, will not work as wrong req handler used
- Demo search correct handler: https://localhost:8443/solr/alfresco/alfresco/?q=alfresco&version=2.2&start=0&rows=10&indent=on
- AFTS: https://localhost:8443/solr/alfresco/afts?q=@cm\:name:alfresco&indent=on (gives authority container, folders, content)
add rows
https://localhost:8443/solr/alfresco/afts?q=@cm\:name:alfresco&start=0&rows=20&indent=on
(The Alfresco Solr search subsystem supports the same query languages as the embedded Lucene subsystem,
and the same fields (ID , PARENT) are also available.)
search only for folders
https://localhost:8443/solr/alfresco/afts?q=TYPE:cm\:folder%20AND%20@cm\:name:alfresco&start=0&rows=...
- Turn off Solr and use Lucene on the fresh Alfresco install
- Stop Alfresco
- Config...
### Solr indexing ###
#index.subsystem.name=solr
#dir.keystore=${dir.root}/keystore
#solr.port.ssl=8443
### Lucene indexing ###
index.subsystem.name=lucene
index.recovery.mode=FULL
- Start Alfresco
- Show logs while starting
- Remove index.recovery.mode=FULL
- Can remove /alf_data/solr, tomcat/conf/Catalina/localhost/solr.xml, tomcat/webapps/solr
- Configure fresh Alfresco install (the one that just runs with Lucene now) to use stand-alone Solr running in it's own Tomcat
SETUP TOMCAT WITH SOLR
- Install Tomcat 6.0.35 in a new dir
- Create data dir under new dir
- Unpack Solr distribution ZIP into data dir (point out there are no index dirs or model dirs)
- Copy keystore from tomcat\webapps\alfresco\WEB-INF\classes\alfresco\keystore to data dir
- Copy solr-tomcat-context.xml to tomcat/conf/Catalina/localhost/solr.xml
- Update the solr.xml so paths match the installation, set the location of the Solr war file and the location of the Solr home directory
- Update each coreís configuration and tell it where Alfresco is running and its data dir (EACH CORE)
data.dir.root=C:/AlfrescoSolrTTL/data
alfresco.host=localhost
- Alfresco need to talk over HTTPS with Solr so we need to configure that in server.xml, change all PORTs to not clash with Alfresco HTTPS change first 8 to 9:
<Connector port='9443' protocol='org.apache.coyote.http11.Http11Protocol' SSLEnabled='true'
maxThreads='150' scheme='https'
keystoreFile='C:\AlfrescoSolrTTL/data/keystore/ssl.keystore' keystorePass='kT9X6oe68t' keystoreType='JCEKS'
secure='true' connectionTimeout='240000'
truststoreFile='C:\AlfrescoSolrTTL/data/keystore/ssl.truststore' truststorePass='kT9X6oe68t' truststoreType='JCEKS'
clientAuth='false' sslProtocol='TLS' allowUnsafeLegacyRenegotiation='true' />
- Allow the Alfresco Repository to SSL authenticate with Solr
<tomcat-users>
<user username='CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB' roles='repository' password='null'/>
</tomcat-users>
- set JAVA_HOME=C:\Alfresco4.0.2TTL\java
- Start tomcat
CONFIGURE ALFRESCO TO USE NEW TOMCAT WITH SOLR
- Stop Alfresco
- Config...
### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=9443
solr.host=localhost
### Lucene indexing ###
#index.subsystem.name=lucene
- Start Alfresco
If you start with Alfresco 4.0 without Solr and SSL then
<Connector port='8443' protocol='org.apache.coyote.http11.Http11Protocol' SSLEnabled='true'
maxThreads='150' scheme='https' keystoreFile='C:\Alfresco4.0.2TTL/alf_data/keystore/ssl.keystore' keystorePass='kT9X6oe68t' keystoreType='JCEKS'
secure='true' connectionTimeout='240000' truststoreFile='C:\Alfresco4.0.2TTL/alf_data/keystore/ssl.truststore' truststorePass='kT9X6oe68t' truststoreType='JCEKS'
clientAuth='false' sslProtocol='TLS' allowUnsafeLegacyRenegotiation='true' maxSavePostSize='-1' />
and in tomcat-users.xml
<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>
and in 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>
<security-constraint>
<web-resource-collection>
<web-resource-name>SOLR</web-resource-name>
<url-pattern>/s/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>
<security-constraint>
<web-resource-collection>
<web-resource-name>SOLR</web-resource-name>
<url-pattern>/wcservice/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>
<security-constraint>
<web-resource-collection>
<web-resource-name>SOLR</web-resource-name>
<url-pattern>/wcs/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>
- Show searches when Solr is running and when it is stopped
Stopping SOlr gives 0 search result, no error message
You can see what part of the Share UI uses canned DB queries
- Show search logging (Tomcat Log Valve)
- Turn on AccessLogValve in Solr Tomcat
- Search for alfresco
127.0.0.1 - CN=Alfresco Repository, OU=Unknown, O=Alfresco Software Ltd., L=Maidenhead, ST=UK, C=GB [01/Aug/2012:15:00:08 +0200]
'POST /solr/alfresco/afts?q=%28%28alfresco++AND
+%28%2BTYPE%3A%22cm%3Acontent%22
+%2BTYPE%3A%22cm%3Afolder%22%29%29+AND+
-TYPE%3A%22cm%3Athumbnail%22+AND+
-TYPE%3A%22cm%3AfailedThumbnail%22+AND+
-TYPE%3A%22cm%3Arating%22%29+AND+
NOT+ASPECT%3A%22sys%3Ahidden%22&
wt=json&
fl=DBID%2Cscore&
rows=502&
df=keywords&
start=0&
locale=en_GB&
fq=%7B%21afts%7D
AUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7D
TENANT_FILTER_FROM_JSON HTTP/1.1' 200 2983
- Setup plain HTTP connection - (production env inside firewall, performance improvements, less packages, inspect calls)
ALFRESCO SIDE
- Stop Alfresco
- config...
solr.port=9090
solr.secureComms=none
- In the alfresco web.xml, remove the following configuration:
<security-constraint>
<web-resource-collection>
<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>
- Start Alfresco
SOLR SIDE
- Stop Tomcat
- For each core:
alfresco.secureComms=none
- In the solr web.xml, remove the following configuration:
<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>
- Start Tomcat
- How would I rebuild the index from scratch
Note: the index.recovery.mode=FULL is not used by SOLR - only lucene
- Stop the SOLR web app
- Delete the index data directory for each core
- Optionally, delete the models cached on the SOLR side for each core (e.g. ...\archive-SpacesStore\alfrescoModels\*)
- Start the SOLR web app
- Turn on more detailed loggin in Solr
http://localhost:9090/solr/
Select the ì[LOGGING]î link
For info about tracking set INFO level logging for:
org.alfresco.solr.tracker.CoreTracker
org.alfresco.solr.tracker.CoreTrackerJob
org.alfresco.solr.tracker.CoreWatcherJob
For query debug set FINE for:
org.alfresco.solr.query.AbstractQParser
org.alfresco.solr.query.AlfrescoFTSQParserPlugin
org.alfresco.solr.query.AlfrescoLuceneQParserPlugin
org.alfresco.solr.query.CmisQParserPlugin
For response timing (query time and match reporting) set INFO
org.apache.solr.core.SolrCore
Use the ìsetî option at the bottom of the page to save the changes
- SOLR status summary for cores:
http://localhost:9090/solr/admin/cores?action=SUMMARY&wt=xml
- SOLR Overal all status report
http://localhost:9090/solr/admin/cores?action=REPORT&wt=xml
- SOLR index status (the normal SOLR stuff)
http://localhost:9090/solr/admin/cores?action=STATUS&wt=xml
- Show index inspection with the Luke Lucene tool
C:\Users\mbergljung\Downloads>java -jar lukeall-3.5.0.jar
Check term frequency for field
- Solr Alfresco Schema and how to extend it, see blog
Solr