2016-12-02 1 views
0

사용하여 원하는 rebuild_index 수 없습니다 건초 더미 + elasticsearchelasticsearch 내가

은 그래서 elasticsearch

$ brew info elasticsearch 

elasticsearch: stable 5.0.1, HEAD 
Distributed search & analytics engine 
https://www.elastic.co/products/elasticsearch 
/usr/local/Cellar/elasticsearch/5.0.1 (98 files, 34.8M) * 
    Built from source on 2016-11-29 at 17:52:15 
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/elasticsearch.rb 
==> Requirements 
Required: java >= 1.8 ✔ 
==> Caveats 
Data: /usr/local/var/elasticsearch/elasticsearch_hanminsoo/ 
Logs: /usr/local/var/log/elasticsearch/elasticsearch_hanminsoo.log 
Plugins: /usr/local/Cellar/elasticsearch/5.0.1/libexec/plugins/ 
Config: /usr/local/etc/elasticsearch/ 
plugin script: /usr/local/Cellar/elasticsearch/5.0.1/libexec/bin/plugin 

To have launchd start elasticsearch now and restart at login: 
    brew services start elasticsearch 
Or, if you don't want/need a background service you can just run: 
    elasticsearch 

설치하고 난 elasticsearch

$ brew services start elasticsearch 

==> Tapping homebrew/services 
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services'... 
remote: Counting objects: 10, done. 
remote: Compressing objects: 100% (7/7), done. 
remote: Total 10 (delta 0), reused 6 (delta 0), pack-reused 0 
Unpacking objects: 100% (10/10), done. 
Checking connectivity... done. 
Tapped 0 formulae (36 files, 47K) 
==> Successfully started `elasticsearch` (label: homebrew.mxcl.elasticsearch) 

시작하고 내 인덱스 rebulid 원하는

$ python manage.py rebuild_index 

WARNING: This will irreparably remove EVERYTHING from your search index in connection 'default'. 
Your choices after this are to restore from backups or rebuild via the `rebuild_index` command. 
Are you sure you wish to continue? [y/N] y 

하지만 그것은 오류

Removing all documents from your index because you said so. 
DELETE http://127.0.0.1:9200/haystack [status:N/A request:0.002s 

[...] 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "/Users/hanminsoo/.pyenv/versions/spec/lib/python3.5/site-packages/haystack/backends/elasticsearch_backend.py", line 231, in clear 
self.conn.indices.delete(index=self.index_name, ignore=404) 
    File "/Users/hanminsoo/.pyenv/versions/spec/lib/python3.5/site-packages/elasticsearch/client/utils.py", line 69, in _wrapped 
return func(*args, params=params, **kwargs) 
    File "/Users/hanminsoo/.pyenv/versions/spec/lib/python3.5/site-packages/elasticsearch/client/indices.py", line 198, in delete 
params=params) 
    File "/Users/hanminsoo/.pyenv/versions/spec/lib/python3.5/site-packages/elasticsearch/transport.py", line 307, in perform_request 
status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout) 
    File "/Users/hanminsoo/.pyenv/versions/spec/lib/python3.5/site-packages/elasticsearch/connection/http_urllib3.py", line 89, in perform_request 
raise ConnectionError('N/A', str(e), e) 
elasticsearch.exceptions.ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x110791e48>: Failed to establish a new connection: [Errno 61] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x110791e48>: Failed to establish a new connection: [Errno 61] Connection refused) 
All documents removed. 
Indexing 0 products 

제품이 인덱싱되지 않습니다 보여 ...

먼저 나는

$ curl -v -X GET 127.0.0.1:9200 

* Rebuilt URL to: 127.0.0.1:9200/ 
* Trying 127.0.0.1... 
* connect to 127.0.0.1 port 9200 failed: Connection refused 
* Failed to connect to 127.0.0.1 port 9200: Connection refused 
* Closing connection 0 
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused 

, 그것은 연결 오류라고 생각하지만 설정

# Django Haystack 
HAYSTACK_CONNECTIONS = { 
    'default': { 
    'ENGINE':'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', 
    'URL': 'http://127.0.0.1:9200/', 
    'INDEX_NAME': 'haystack', 
    'TIMEOUT': 10 
    }, 
} 
를 settings.py를

elasticsearch를 다시 시작하고 다시 설치해보십시오.

,210

하지만

동결 PIP 왜 ..... 이해할 수없는

appnope==0.1.0 
certifi==2016.9.26 
decorator==4.0.10 
Django==1.9.7 
django-debug-toolbar==1.5 
django-extensions==1.7.2 
django-haystack==2.5.1 
djangorestframework==3.4.4 
elasticsearch==1.9.0 
get==0.0.0 
httpie==0.9.6 
ipython==5.0.0 
ipython-genutils==0.1.0 
pep8==1.7.0 
pexpect==4.2.0 
pickleshare==0.7.3 
post==0.0.0 
prompt-toolkit==1.0.3 
ptyprocess==0.5.1 
public==0.0.0 
pyelasticsearch==1.4 
Pygments==2.1.3 
query-string==0.0.0 
requests==2.12.2 
setupfiles==0.0.0 
simplegeneric==0.8.1 
simplejson==3.10.0 
six==1.10.0 
sqlparse==0.2.1 
traitlets==4.2.2 
urllib3==1.19.1 
wcwidth==0.1.7 

자바 -verions

java version "1.8.0_112" 
Java(TM) SE Runtime Environment (build 1.8.0_112-b16) 
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode) 
+0

브라우저에 http://127.0.0.1:9200을 입력하면 어떻게됩니까? – Val

+0

@Val ummm ...... 나는'ERR_CONNECTION_REFUSED'를 얻는다.'127.0.0.1은 연결을 거부했다. '....하지만 나는 무엇이 문제인지 이해할 수 없다 ... 나는 무엇이 문제인지 물을지도 모른다. ..? –

+0

이것은 brew가 있다고해도 어떤 이유로 ES 서버가 실행되지 않고 있음을 의미합니다. '/ usr/local/var/log/elasticsearch/elasticsearch_hanminsoo.log'에 보이는 것을 보여줄 수 있습니까? – Val

답변

1

당신의 ES 서버가 시작되지 않은 때문입니다.

로그에 따르면 /usr/local/etc/elasticsearch/elasticsearch.yml 파일의 discovery.zen.ping.timeout에서 discovery.zen.ping_timeout으로 변경하고 ES를 다시 시작해야합니다.