2013-03-28 1 views
1

이전에 Whoosh을 검색 백엔드로 사용했지만 지금은 elasticsearch으로 전환하고 작동하도록 노력하고 있습니다.건초 더미로 elasticsearch 설정

나는 오류가 인덱스를 다시 작성하려고 할 때 :

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /_bulk?op_type=create (Caused by <class 'socket.error'>: [Errno 61] Connection refused) 

내 settings.py에서 다음과 같습니다

HAYSTACK_CONNECTIONS = { 
    'default': { 
     'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 
     'URL': 'http://localhost:8000/', 
     'INDEX_NAME': 'haystack', 
    }, 
} 

내 질문은, URL이 사용하고 무엇 무엇 내가 뒀어? 나는 개발을 위해 지역적으로 일을하고 있으며, 나는 Heroku에 배치되어 있습니다.

+0

당신이 다시 구성하지 않는 한 ES의 기본 포트 그래서 9200입니다 포트 번호를 8000으로 변경하십시오. –

답변

4

포트는 또한 9200

HAYSTACK_CONNECTIONS = { 
'default': { 
     'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 
     'URL': 'http://127.0.0.1:9200/', 
     'INDEX_NAME': 'haystack', 
    }, 
} 

해야합니다, 당신은 당신이 건초 더미의 개발 버전 (2.0)을 사용하고 있는지 확인해야합니다.


편집 :

당신은 아마 ElasticSearch 다음 명령을 실행하여 실행되고 있는지 먼저 확인하려면

:

curl -XGET 'http://127.0.0.1:9200/my_index/_mapping?pretty=1' 
+0

나는 당신의 답을 따라 왔지만 여전히 위의 오류가 발생하고 있습니다. – picomon

+0

정확히 같은 에러'requests.exceptions.ConnectionError : HTTPConnectionPool (host = 'localhost', port = 8000)'를 얻었 으면, 코드를 잘못된 위치에 두었습니다. 프로젝트 및 사용중인 서버에 따라 다시 시작해야 함). 오류가'requests.exceptions.ConnectionError : HTTPConnectionPool (host = 'localhost', port : 9200)'라고 표시되면 ElasticSearch가 컴퓨터에서 실행되지 않거나 다른 포트에서 작동 할 가능성이 적습니다. –

+0

터미널에서 다음 명령을 실행하여 ElasticSearch가 실행 중인지 테스트 할 수 있습니다. 'curl -XGET'http : //127.0.0.1 : 9200/my_index/_mapping? pretty = 1'' –

관련 문제