org.apache.solr.client.solrj.impl.HttpSolrClient $ RemoteSolrException: ошибка сервера в - PullRequest
0 голосов
/ 19 июня 2019

У меня есть приложение Spring, и я использую Solr для сохранения документов.Я использую Spring Data Solr для связи с ядрами Solr.Изначально у меня была локальная настройка Solr, поэтому в файле application.properties я написал spring.data.solr.host=http://localhost:8983/solr.Но теперь я развернул Solr на Google Cloud Platform и попытался подключить экземпляр solr к GCP, изменив вышеуказанную конфигурацию на spring.data.solr.host=http://ip-address-of-the-solr-instance/solr.Это дает мне 401 unauthorized Ниже приведена трассировка стека моего весеннего загрузочного приложения

<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>
; nested exception is 
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: 
Error from server at http://ip-address-of-gcp-instance/solr: Expected mime type 
application/octet-stream but got text/html. <!DOCTYPE HTML PUBLIC 
"-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>
] with root cause

org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: 
Error from server at http://ip-address-of-gcp-instance/solr: Expected mime type 
application/octet-stream but got text/html. <!DOCTYPE HTML PUBLIC 
"-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>
...