gpt4 book ai didi

php - Elasticsearch无法连接到主机? 500内部服务器错误-HttpException

转载 作者:行者123 更新时间:2023-12-02 22:38:21 28 4
gpt4 key购买 nike

我在2个不同的服务器上的项目中工作。该代码是从bitbucket克隆的,因此完全相同,但是在其中一个中,我在每个HTTP请求中均收到此错误:

Couldn't connect to host, Elasticsearch down?
500 Internal Server Error - HttpException

所以。 Ubuntu 16.04

当我运行 service elasticsearch status时,我得到了:
    elasticsearch.service - LSB: Starts elasticsearch
Loaded: loaded (/etc/init.d/elasticsearch; bad; vendor preset: enabled)
Active: active (exited) since Sun 2017-01-15 11:05:25 CET; 1h 16min ago
Docs: man:systemd-sysv-generator(8)
Process: 1366 ExecStart=/etc/init.d/elasticsearch start (code=exited, status=0

Jan 15 11:05:25 ubuntu systemd[1]: Starting LSB: Starts elasticsearch...
Jan 15 11:05:25 ubuntu systemd[1]: Started LSB: Starts elasticsearch.

当我运行 fos:elastica:populate时,出现此错误:
[Elastica\Exception\Connection\HttpException]
Couldn't connect to host, Elasticsearch down?

并运行 curl -XGET http://127.0.0.1:9200我得到
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused

我搜索了5天,认为此问题与权限有关。

最佳答案

非常感谢@antonbormotov。我正在寻找开始 flex 搜索的过程,发现this response.

It seems that to get Elasticsearch to run on 16.04 you have to set START_DAEMON to true on /etc/default/elasticsearch. It comes commented out by default, and uncommenting it makes Elasticsearch start again just fine.

Be sure to use systemctl restart instead of just start because the service is started right after installation, and apparently there's some socket/pidfile/something that systemd keeps that must be released before being able to start the service again



它正在运行!

关于php - Elasticsearch无法连接到主机? 500内部服务器错误-HttpException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41661472/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com