You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Zheng Lin Edwin Yeo <ed...@gmail.com> on 2015/09/09 11:46:52 UTC
Problem with starting Solr with custom core directories in Solr 5.3.0
Hi,
Would like to check, is there any problem with this set of codes from Line
604-614 in solr.cmd for Solr 5.3.0? When using this set of codes, I'm not
able to start solr with it pointing to custom core directories.
IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
IF NOT EXIST "%SOLR_HOME%\" (
IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
) ELSE IF EXIST "%cd%\%SOLR_HOME%" (
set "SOLR_HOME=%cd%\%SOLR_HOME%"
) ELSE (
set "SCRIPT_ERROR=EDM home directory %SOLR_HOME% not found!"
goto err
)
)
I replace it with the following and it works.
IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
IF EXIST "%SOLR_HOME%\" (
IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
) ELSE IF EXIST "%cd%\%SOLR_HOME%" (
set "SOLR_HOME=%cd%\%SOLR_HOME%"
) ELSE (
set "SCRIPT_ERROR=EDM home directory %SOLR_HOME% not found!"
goto err
)
)
The problem seems to be that both the IF "%SOLR_HOME%"=="" and IF NOT EXIST
"%SOLR_HOME%\" mean the same thing, and thus the code didn't called the
custom directory. I replace it with IF EXIST "%SOLR_HOME%\" for the 2nd
line (removing the 'NOT').
The script which I used to startup is:
bin\solr.cmd start -cloud -p 8983 -s solrMain\node1\solr -m 12g -z
"localhost:2181,localhost:2182,localhost:2183"
Hope we can clarify some doubts here.
Regards,
Edwin
Re: Problem with starting Solr with custom core directories in Solr 5.3.0
Posted by Zheng Lin Edwin Yeo <ed...@gmail.com>.
Is this due to a bug with the code provided by Solr, or is it that I did
not configure my configurations in the other parts correctly?
Regards,
Edwin
On 9 September 2015 at 17:46, Zheng Lin Edwin Yeo <ed...@gmail.com>
wrote:
> Hi,
>
> Would like to check, is there any problem with this set of codes from Line
> 604-614 in solr.cmd for Solr 5.3.0? When using this set of codes, I'm not
> able to start solr with it pointing to custom core directories.
>
> IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
>
> IF NOT EXIST "%SOLR_HOME%\" (
>
> IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
>
> set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
>
> ) ELSE IF EXIST "%cd%\%SOLR_HOME%" (
>
> set "SOLR_HOME=%cd%\%SOLR_HOME%"
>
> ) ELSE (
>
> set "SCRIPT_ERROR=EDM home directory %SOLR_HOME% not found!"
>
> goto err
>
> )
>
> )
>
>
> I replace it with the following and it works.
>
> IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr"
>
> IF EXIST "%SOLR_HOME%\" (
>
> IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" (
>
> set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%"
>
> ) ELSE IF EXIST "%cd%\%SOLR_HOME%" (
>
> set "SOLR_HOME=%cd%\%SOLR_HOME%"
>
> ) ELSE (
>
> set "SCRIPT_ERROR=EDM home directory %SOLR_HOME% not found!"
>
> goto err
>
> )
>
> )
>
> The problem seems to be that both the IF "%SOLR_HOME%"=="" and IF NOT
> EXIST "%SOLR_HOME%\" mean the same thing, and thus the code didn't called
> the custom directory. I replace it with IF EXIST "%SOLR_HOME%\" for the
> 2nd line (removing the 'NOT').
>
> The script which I used to startup is:
> bin\solr.cmd start -cloud -p 8983 -s solrMain\node1\solr -m 12g -z
> "localhost:2181,localhost:2182,localhost:2183"
>
> Hope we can clarify some doubts here.
>
> Regards,
> Edwin
>