2017-12-23 7 views
0

에 9200 년 Elasticsearch를 연결할 수 없음 : This site can’t be reached. localhost refused to connect.내가 <code>http://localhost:9200/</code>에 액세스 할 수 아니에요, 우분투

을하지만 상태를 elasticsearch 쳤을 때, 나는 얻을 :

● elasticsearch.service - LSB: Starts elasticsearch 
Loaded: loaded (/etc/init.d/elasticsearch; generated; vendor preset 
Active: active (exited) since Sat 2017-12-23 15:41:20 -03; 23min ag 
    Docs: man:systemd-sysv-generator(8) 
Process: 29407 ExecStop=/etc/init.d/elasticsearch stop (code=exited, 
Process: 29442 ExecStart=/etc/init.d/elasticsearch start (code=exite 

dez 23 15:41:20 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts elasticsearch... 
dez 23 15:41:20 aleluia-Inspiron-5548 elasticsearch[29442]: * Starting Elasticsearch Server 
dez 23 15:41:20 aleluia-Inspiron-5548 elasticsearch[29442]: ...done. 
dez 23 15:41:20 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts elasticsearch. 

이미 START_DAEMON에서 주석 문자를 제거하려고 시도했으며, 여기에 제안 된대로 많은 사람들에게 효과가있는 것으로 보입니다 : https://discuss.elastic.co/t/cant-start-elasticsearch-with-ubuntu-16-04/48730/11. 나는 elasticsearch.yml 파일을 명시 적으로 편집하여 network.host를 127.0.0.1 (또는 0.0.0.0)으로 설정하고 http.port를 9200으로 명시 적으로 설정했습니다. 또한 나는이 솔루션을 섞어 보았지만 그들 중 누구도 일하지 않았다.

또한 elasticsearch를 시작한 후에 netstat -a -n | grep tcp | grep 9200은 아무 것도 반환하지 않습니다. 내가 journalctl -u elasticsearch 충돌하는 경우

, 내가 얻을 :

-- Logs begin at Sat 2017-12-23 12:31:03 -03, end at Sat 2017-12-23 16 
dez 23 12:31:11 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 12:31:11 aleluia-Inspiron-5548 elasticsearch[1449]: * Starting 
dez 23 12:31:11 aleluia-Inspiron-5548 elasticsearch[1449]: ...done. 
dez 23 12:31:11 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 12:58:42 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 12:58:42 aleluia-Inspiron-5548 elasticsearch[7235]: * Stopping 
dez 23 12:58:42 aleluia-Inspiron-5548 elasticsearch[7235]: ...done. 
dez 23 12:58:42 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 12:58:42 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 12:58:42 aleluia-Inspiron-5548 elasticsearch[7271]: * Starting 
dez 23 12:58:42 aleluia-Inspiron-5548 elasticsearch[7271]: ...done. 
dez 23 12:58:42 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 12:59:34 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 12:59:34 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 12:59:34 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 12:59:34 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 13:24:49 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 13:24:49 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 13:33:24 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 13:33:24 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 13:35:46 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 13:35:46 aleluia-Inspiron-5548 elasticsearch[16475]: * Stoppin 
dez 23 13:35:46 aleluia-Inspiron-5548 elasticsearch[16475]: ...done 
dez 23 13:35:46 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 13:35:46 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 13:35:46 aleluia-Inspiron-5548 elasticsearch[16511]: * Startin 
dez 23 13:35:46 aleluia-Inspiron-5548 elasticsearch[16511]: ...done 
dez 23 13:35:46 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:04:11 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:04:11 aleluia-Inspiron-5548 elasticsearch[19271]: * Stoppin 
dez 23 14:04:11 aleluia-Inspiron-5548 elasticsearch[19271]: ...done 
dez 23 14:04:11 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:04:11 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:04:11 aleluia-Inspiron-5548 elasticsearch[19306]: * Startin 
dez 23 14:04:11 aleluia-Inspiron-5548 elasticsearch[19306]: ...done 
dez 23 14:04:11 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:06:11 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:06:11 aleluia-Inspiron-5548 elasticsearch[19573]: * Stoppin 
dez 23 14:06:11 aleluia-Inspiron-5548 elasticsearch[19573]: ...done 
dez 23 14:06:11 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:06:11 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:06:11 aleluia-Inspiron-5548 elasticsearch[19609]: * Startin 
dez 23 14:06:11 aleluia-Inspiron-5548 elasticsearch[19609]: ...done 
dez 23 14:06:11 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:11:39 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 

dez 23 14:11:39 aleluia-Inspiron-5548 elasticsearch[20165]: * Stoppin 
dez 23 14:11:39 aleluia-Inspiron-5548 elasticsearch[20165]: ...done 
dez 23 14:11:39 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:11:39 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:11:40 aleluia-Inspiron-5548 elasticsearch[20200]: * Startin 
dez 23 14:11:40 aleluia-Inspiron-5548 elasticsearch[20200]: ...done 
dez 23 14:11:40 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:14:07 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:14:07 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:14:07 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:14:07 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:25:03 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:25:03 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:25:03 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:25:03 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:26:29 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:26:29 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:26:29 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:26:29 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:26:58 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:26:58 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:26:58 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:26:58 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:27:06 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:27:06 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:27:06 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:27:06 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 14:31:59 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 14:31:59 aleluia-Inspiron-5548 elasticsearch[23414]: * Stoppin 
dez 23 14:31:59 aleluia-Inspiron-5548 elasticsearch[23414]: ...done 
dez 23 14:31:59 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 14:31:59 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 14:31:59 aleluia-Inspiron-5548 elasticsearch[23449]: * Startin 
dez 23 14:31:59 aleluia-Inspiron-5548 elasticsearch[23449]: ...done 
dez 23 14:31:59 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 15:09:59 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 15:09:59 aleluia-Inspiron-5548 elasticsearch[26624]: * Stoppin 
dez 23 15:09:59 aleluia-Inspiron-5548 elasticsearch[26624]: ...done 
dez 23 15:09:59 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 15:09:59 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 15:09:59 aleluia-Inspiron-5548 elasticsearch[26661]: * Startin 
dez 23 15:09:59 aleluia-Inspiron-5548 elasticsearch[26661]: ...done 
dez 23 15:09:59 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 15:35:13 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 15:35:13 aleluia-Inspiron-5548 elasticsearch[28869]: * Stoppin 
dez 23 15:35:13 aleluia-Inspiron-5548 elasticsearch[28869]: ...done 
dez 23 15:35:13 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 15:35:13 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 15:35:13 aleluia-Inspiron-5548 elasticsearch[28904]: * Startin 
dez 23 15:35:13 aleluia-Inspiron-5548 elasticsearch[28904]: ...done 
dez 23 15:35:13 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
dez 23 15:41:20 aleluia-Inspiron-5548 systemd[1]: Stopping LSB: Starts 
dez 23 15:41:20 aleluia-Inspiron-5548 elasticsearch[29407]: * Stoppin 
dez 23 15:41:20 aleluia-Inspiron-5548 elasticsearch[29407]: ...done 
dez 23 15:41:20 aleluia-Inspiron-5548 systemd[1]: Stopped LSB: Starts 
dez 23 15:41:20 aleluia-Inspiron-5548 systemd[1]: Starting LSB: Starts 
dez 23 15:41:20 aleluia-Inspiron-5548 elasticsearch[29442]: * Startin 
dez 23 15:41:20 aleluia-Inspiron-5548 elasticsearch[29442]: ...done 
dez 23 15:41:20 aleluia-Inspiron-5548 systemd[1]: Started LSB: Starts 
+0

'/ var/log/elasticsearch /'폴더에'.log' 파일이 있습니까? 로그 파일에 오류/예외가 있는지 확인하십시오. – Bless

+0

불행히도'/ var/log/elasticsearch /'안에는 .log가 없으며 실제로는 비어 있습니다. 다른 로그 파일을 찾았지만 찾지 못했습니다. 내가 찾은 가장 가까운 위치에있는 것이었다. 'dez 23 13:35:46 aleluia-Inspiron-5548 systemd [1] : 시작 LSB : 시작' 'dez 23 13:35:46 aleluia-Inspiron-5548 elasticsearch [ 16511] : * 시작 ' 'dez 23 13:35:46 aleluia-Inspiron-5548 elasticsearch [16511] : 완료 ... 'dez 23 13:35:46 aleluia-Inspiron-5548 systemd [1] : 시작됨 LSB : 시작은 으로 시작하는 것으로 보입니다. –

+0

'journalctl -u elasticsearch'를 시도해 거기에 오류/예외가 기록되어 있는지 확인하십시오. – Bless

답변

0

당신이 아파치를 사용하는 경우처럼, 다음의 nginx 같은 다른 웹 서버를 사용하는 경우 sudo service apache2 restart 을 사용하여 다시 시작, 웹 서버를 다시 시작한 호스트 파일을 변경하고 웹 서버를 다시 시작하십시오.

이 방법으로 문제가 해결되지 않으면 포트가 정상적으로 작동하는지 확인하고, .conf 파일에서 8080 또는 80으로 변경하십시오. 어떤 문제에 직면하면 이걸 시도해보십시오. :)

+0

저는 Ruby on Rails 프로젝트에 있고, 개발 환경에서 http : // localhost : 3000만을 사용하고 있습니다. 다시 시작하려고 시도했지만 작동하지 않았습니다. 포트 9200에서 8000으로 변경해 보았습니다. 사실,'transport.tcp.port'와'http.port'를'/ etc/elasticsearch/elasticsearch '에 설정하려고했습니다.yml 파일. 아무도 일하지 않았다. 이 yml 파일은 .conf 파일이라고 불리는 파일입니까? 도와 주셔서 감사합니다 (: –