mirror of https://github.com/apache/lucene.git
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:
parent
74d54410f9
commit
9c1e05d604
|
@ -556,6 +556,9 @@ Bug Fixes
|
|||
* SOLR-7038: Validate the presence of configset before trying to create a collection.
|
||||
(Anshum Gupta, Mark Miller)
|
||||
|
||||
* SOLR-7037: bin/solr start -e techproducts -c fails to start Solr in cloud mode
|
||||
(Timothy Potter)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -1022,6 +1022,7 @@ if [ "$EXAMPLE" != "" ]; then
|
|||
mkdir -p $SOLR_HOME
|
||||
if [ ! -f "$SOLR_HOME/solr.xml" ]; then
|
||||
cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml
|
||||
cp $DEFAULT_SERVER_DIR/solr/zoo.cfg $SOLR_HOME/zoo.cfg
|
||||
fi
|
||||
EXAMPLE_CONFIGSET=sample_techproducts_configs
|
||||
shift
|
||||
|
@ -1035,6 +1036,7 @@ if [ "$EXAMPLE" != "" ]; then
|
|||
mkdir -p $SOLR_HOME
|
||||
if [ ! -f "$SOLR_HOME/solr.xml" ]; then
|
||||
cp $DEFAULT_SERVER_DIR/solr/solr.xml $SOLR_HOME/solr.xml
|
||||
cp $DEFAULT_SERVER_DIR/solr/zoo.cfg $SOLR_HOME/zoo.cfg
|
||||
fi
|
||||
EXAMPLE_CONFIGSET=data_driven_schema_configs
|
||||
shift
|
||||
|
|
|
@ -569,6 +569,9 @@ IF "%EXAMPLE%"=="" (
|
|||
IF NOT EXIST "!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" (
|
||||
set SOLR_MODE=solrcloud
|
||||
goto cloud_example_start
|
||||
|
@ -580,6 +583,9 @@ IF "%EXAMPLE%"=="" (
|
|||
IF NOT EXIST "!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 (
|
||||
@echo.
|
||||
@echo 'Unrecognized example %EXAMPLE%!'
|
||||
|
|
|
@ -478,7 +478,16 @@ public class SolrCLI {
|
|||
public Map<String,Object> handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
|
||||
HttpEntity entity = response.getEntity();
|
||||
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) {
|
||||
return (Map<String,Object>)resp;
|
||||
} else {
|
||||
|
@ -1495,13 +1504,17 @@ public class SolrCLI {
|
|||
int result = -1;
|
||||
Tool tool = null;
|
||||
try {
|
||||
Map<String,Object> systemInfo = getJson(httpClient, systemInfoUrl, 2);
|
||||
Map<String, Object> systemInfo = getJson(httpClient, systemInfoUrl, 2);
|
||||
if ("solrcloud".equals(systemInfo.get("mode"))) {
|
||||
tool = new CreateCollectionTool();
|
||||
} else {
|
||||
tool = new CreateCoreTool();
|
||||
}
|
||||
result = tool.runTool(cli);
|
||||
} catch (Exception exc) {
|
||||
System.err.println("ERROR: create failed due to: "+exc.getMessage());
|
||||
System.err.println();
|
||||
result = 1;
|
||||
} finally {
|
||||
closeHttpClient(httpClient);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue