SOLR-7037: bin/solr start -e techproducts -c fails to start Solr in cloud mode

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1655058 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy Potter 2015-01-27 15:00:32 +00:00
parent 74d54410f9
commit 9c1e05d604
4 changed files with 26 additions and 2 deletions

View File

@ -556,6 +556,9 @@ Bug Fixes
* SOLR-7038: Validate the presence of configset before trying to create a collection. * SOLR-7038: Validate the presence of configset before trying to create a collection.
(Anshum Gupta, Mark Miller) (Anshum Gupta, Mark Miller)
* SOLR-7037: bin/solr start -e techproducts -c fails to start Solr in cloud mode
(Timothy Potter)
Optimizations Optimizations
---------------------- ----------------------

View File

@ -1022,6 +1022,7 @@ if [ "$EXAMPLE" != "" ]; then
mkdir -p $SOLR_HOME mkdir -p $SOLR_HOME
if [ ! -f "$SOLR_HOME/solr.xml" ]; then if [ ! -f "$SOLR_HOME/solr.xml" ]; then
cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml
cp $DEFAULT_SERVER_DIR/solr/zoo.cfg $SOLR_HOME/zoo.cfg
fi fi
EXAMPLE_CONFIGSET=sample_techproducts_configs EXAMPLE_CONFIGSET=sample_techproducts_configs
shift shift
@ -1035,6 +1036,7 @@ if [ "$EXAMPLE" != "" ]; then
mkdir -p $SOLR_HOME mkdir -p $SOLR_HOME
if [ ! -f "$SOLR_HOME/solr.xml" ]; then if [ ! -f "$SOLR_HOME/solr.xml" ]; then
cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml
cp $DEFAULT_SERVER_DIR/solr/zoo.cfg $SOLR_HOME/zoo.cfg
fi fi
EXAMPLE_CONFIGSET=data_driven_schema_configs EXAMPLE_CONFIGSET=data_driven_schema_configs
shift shift

View File

@ -569,6 +569,9 @@ IF "%EXAMPLE%"=="" (
IF NOT EXIST "!SOLR_HOME!\solr.xml" ( IF NOT EXIST "!SOLR_HOME!\solr.xml" (
copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml" copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml"
) )
IF NOT EXIST "!SOLR_HOME!\zoo.cfg" (
copy "%DEFAULT_SERVER_DIR%\solr\zoo.cfg" "!SOLR_HOME!\zoo.cfg"
)
) ELSE IF "%EXAMPLE%"=="cloud" ( ) ELSE IF "%EXAMPLE%"=="cloud" (
set SOLR_MODE=solrcloud set SOLR_MODE=solrcloud
goto cloud_example_start goto cloud_example_start
@ -580,6 +583,9 @@ IF "%EXAMPLE%"=="" (
IF NOT EXIST "!SOLR_HOME!\solr.xml" ( IF NOT EXIST "!SOLR_HOME!\solr.xml" (
copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml" copy "%DEFAULT_SERVER_DIR%\solr\solr.xml" "!SOLR_HOME!\solr.xml"
) )
IF NOT EXIST "!SOLR_HOME!\zoo.cfg" (
copy "%DEFAULT_SERVER_DIR%\solr\zoo.cfg" "!SOLR_HOME!\zoo.cfg"
)
) ELSE ( ) ELSE (
@echo. @echo.
@echo 'Unrecognized example %EXAMPLE%!' @echo 'Unrecognized example %EXAMPLE%!'

View File

@ -478,7 +478,16 @@ public class SolrCLI {
public Map<String,Object> handleResponse(HttpResponse response) throws ClientProtocolException, IOException { public Map<String,Object> handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
if (entity != null) { if (entity != null) {
Object resp = ObjectBuilder.getVal(new JSONParser(EntityUtils.toString(entity)));
String respBody = EntityUtils.toString(entity);
Object resp = null;
try {
resp = ObjectBuilder.getVal(new JSONParser(respBody));
} catch (JSONParser.ParseException pe) {
throw new ClientProtocolException("Expected JSON response from server but received: "+respBody+
"\nTypically, this indicates a problem with the Solr server; check the Solr server logs for more information.");
}
if (resp != null && resp instanceof Map) { if (resp != null && resp instanceof Map) {
return (Map<String,Object>)resp; return (Map<String,Object>)resp;
} else { } else {
@ -1502,6 +1511,10 @@ public class SolrCLI {
tool = new CreateCoreTool(); tool = new CreateCoreTool();
} }
result = tool.runTool(cli); result = tool.runTool(cli);
} catch (Exception exc) {
System.err.println("ERROR: create failed due to: "+exc.getMessage());
System.err.println();
result = 1;
} finally { } finally {
closeHttpClient(httpClient); closeHttpClient(httpClient);
} }