Alfresco 4.0.e升级5.0.d:无前置Solr环境下的Solr安装方法(非向导)
Alright, let's walk through setting up Solr for your Alfresco 5.0.d community instance—since you're coming from a Lucene-based 4.0.e setup and using the archive package without the installation wizard, I'll break this down into actionable, step-by-step tasks.
Prerequisites to Check First
Before diving in, make sure you have these covered:
- JDK 7: Alfresco 5.0.d requires Java 7 (either Oracle JDK 7 or OpenJDK 7; newer versions like JDK 8 may cause compatibility issues).
- Memory Allocation: Reserve at least 1GB of heap for Solr, and adjust Alfresco's Tomcat heap to 2GB+ (depending on your server's total RAM).
- Alfresco Stopped: Ensure your Alfresco 5.0.d instance is not running yet—we need to tweak configuration files first.
Get the Matching Solr Package
Alfresco doesn't work with generic Solr builds; you need the Alfresco-tailored Solr 4.10.4 package (the only version compatible with 5.0.d). Grab this from the same archive source where you got your Alfresco 5.0.d community package—it should be named something like alfresco-solr4-5.0.d.zip.
- Unzip the Solr package to a directory alongside your Alfresco installation (e.g., if Alfresco lives in
/opt/alfresco-5.0.d, put Solr in/opt/alfresco-solr4-5.0.dfor clean path management).
Configure Alfresco to Use Solr
Next, we'll switch Alfresco from Lucene to Solr by updating its core configuration:
- Navigate to Alfresco's
tomcat/shared/classesdirectory and openalfresco-global.properties. - Comment out all Lucene-related lines (e.g.,
index.subsystem.name=luceneand any associatedlucene.*properties). - Add the following Solr 4 configuration block:
# Solr 4 Index Configuration index.subsystem.name=solr4 solr.host=localhost solr.port=8983 # Use this port if Alfresco is on the default 8080; adjust if needed solr.port.ssl=8443 solr.base.url=/solr # Database connection (match your existing Alfresco DB config) db.driver=org.postgresql.Driver # Replace with your DB driver (MySQL, Oracle, etc.) db.url=jdbc:postgresql://localhost:5432/alfresco db.username=alfresco db.password=alfresco - Save the file—Alfresco will now point to Solr for indexing.
Configure Solr to Connect to Alfresco
Now set up Solr to communicate with your Alfresco instance:
- Go to the Solr cores directory:
alfresco-solr4-5.0.d/solr/cores. You'll see two cores:workspace-SpacesStore(live content) andarchive-SpacesStore(archived content). - For each core, open
solrcore.propertiesand update these values:alfresco.host=localhost alfresco.port=8080 # Match your Alfresco Tomcat port alfresco.base.url=/alfresco # If using SSL (recommended for production), uncomment and configure these: # alfresco.secureComms=https # solr.ssl.keystore=../../keystore/ssl.keystore # solr.ssl.keystore.password=kT9X6oe68t # solr.ssl.truststore=../../keystore/ssl.truststore # solr.ssl.truststore.password=kT9X6oe68t - Adjust Solr's heap size:
- On Linux: Edit
solr/bin/solr.in.shand setSOLR_HEAP="1024m"(increase to 2GB if you have enough RAM). - On Windows: Edit
solr/bin/solr.in.cmdand setset SOLR_HEAP=1024m.
- On Linux: Edit
Initialize and Rebuild the Index
Since you're migrating from Lucene, you can't reuse old indexes—you need to build fresh Solr indexes:
- Start Alfresco first: Launch its Tomcat instance and verify you can log in to the Alfresco Share interface (
http://localhost:8080/share). - Start Solr: Run the startup script from the Solr bin directory:
- Linux:
./solr start -p 8983 - Windows:
solr start -p 8983
- Linux:
- Verify Solr is running: Access the Solr admin console at
http://localhost:8983/solr—you should see both cores listed under "Core Admin". - Trigger a full reindex:
- Log into Alfresco as an admin, go to the Admin Console (
http://localhost:8080/alfresco/service/enterprise/admin). - Navigate to Index Management > click Reindex All.
- Wait for the process to complete (time depends on how much content you have—be patient for large repositories).
- Log into Alfresco as an admin, go to the Admin Console (
Verify the Setup
Once the reindex finishes, confirm everything works:
- Run a few search queries in Alfresco Share—results should match your content.
- Check Solr's logs (
solr/logs/solr.log) for any errors or warnings. - Check Alfresco's Tomcat logs (
tomcat/logs/catalina.out) to ensure no indexing-related issues are reported.
Optional: Enable SSL for Production
For production environments, enable SSL between Alfresco and Solr to secure index communication:
- Use Alfresco's built-in keystore tool to generate SSL certificates (or use your organization's existing certs).
- Update both
alfresco-global.propertiesand Solr'ssolrcore.propertiesto usehttpsfor secure communication. - Restart both Alfresco and Solr to apply the SSL settings.
内容的提问来源于stack exchange,提问作者Deepankar Kalita

