即使做sudo service elasticsearch start
,我也无法访问http://localhost:9200/
:This site can’t be reached. localhost refused to connect.
但是当我达到弹性搜索状态时,我得到:
● 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 :(得分:0)
您是否重新启动了Web服务器,就像使用apache2一样,然后使用重新启动它
sudo service apache2 restart
如果您正在使用任何其他Web服务器(如nginx),请更改您的主机文件并尝试重新启动Web服务器。
如果这不起作用,那么检查它的端口是否正常工作,尝试在.conf文件中将其更改为8080或80。试试这个,如果你遇到任何问题,请告诉我。:)
答案 1 :(得分:0)
这是一个不相容的问题。更新ES版本解决了这个问题。 https://discuss.elastic.co/t/connecting-elasticsearch-in-ubuntu-17-04/113085/5