Problem
When trying to start Apache Solr 9.7.0 on Windows using either basic start command or cloud example, you might encounter these errors:
- With basic start (
.\solr.cmd start
):
Failed to parse command-line arguments due to: Unrecognized option: --max-wait-secs
ERROR: Solr did not start or was not reachable.
- With cloud example (
.\solr.cmd start -e cloud
):
Invalid command-line option: --cloud
Environment
- Apache Solr: 9.7.0
- OS: Windows 11
- Java: JDK 17
- Shell: PowerShell (as Administrator)
Problem
When trying to start Apache Solr 9.7.0 on Windows using either basic start command or cloud example, you might encounter these errors:
- With basic start (
.\solr.cmd start
):
Failed to parse command-line arguments due to: Unrecognized option: --max-wait-secs
ERROR: Solr did not start or was not reachable.
- With cloud example (
.\solr.cmd start -e cloud
):
Invalid command-line option: --cloud
Environment
- Apache Solr: 9.7.0
- OS: Windows 11
- Java: JDK 17
- Shell: PowerShell (as Administrator)
- 2 And yet another solr startup bug on Windows... Are there no tests ran on Windows before release ? – Olivier Masseau Commented Nov 30, 2024 at 17:41
1 Answer
Reset to default 3Root Cause
The Windows binary script (solr.cmd
) contains inconsistent command switches that don't match what the parser expects. This appears to be a maintenance issue with the Windows scripts in Solr 9.7.0.
Solution
- Navigate to your Solr installation directory
- Create a backup of
bin\solr.cmd
- Open
bin\solr.cmd
in a text editor (like Notepad++ or VS Code) - Make these changes:
- Find
--max-wait-secs
and replace with-maxWaitSecs
- Find
-cloud
and replace with--cloud
- Find
Important Notes:
- Only change one occurrence of each parameter
- Don't use "Replace All" as it might affect other correct instances
- Make sure you have backup before editing
After Fix
After applying these fixes, you might see these warnings which can be safely ignored:
WARNING: URLs provided to this tool needn't include Solr's context-root (e.g. "/solr").
Such URLs are deprecated and support for them will be removed in a future release.
Correcting from [http://localhost:8983/solr] to [http://localhost:8983/].
WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
Verification
After applying the fixes, verify that these commands work:
.\solr.cmd start # Basic start
.\solr.cmd start -e cloud # Cloud example
.\solr.cmd status # Status check
Additional Notes
- These fixes are needed even when running PowerShell as Administrator
- The JVM warning about large page memory can be ignored:
OpenJDK 64-Bit Server VM warning: JVM cannot use large page memory because it does not have enough privilege to lock pages in memory.
- This appears to be a Windows-specific issue and doesn't affect Linux/Unix installations
References
- Solr Control Script Reference
- Getting Started Tutorial
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745572079a4633739.html
评论列表(0条)