2017-01-15 19 views
2

私は2つの異なるサーバーで自分のプロジェクトで作業しています。ホストに接続できませんでした、Elasticsearchがダウンしましたか? 500内部サーバーエラー - HttpException

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

S.O.:コードは、とても正確に同じであるが、そのうちの一つで、私はすべてのHTTP要求にこのエラーを取得するビットバケットからクローニングされました私はservice elasticsearch statusを実行するとUbuntuの16.04

私はこれを取得:

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: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused 

Iを得るcurl -XGET http://127.0.0.1:9200を実行します5日間検索していましたが、この問題は何かと考えていますアクセス許可。

+0

あなたのコードはどこですか? – aimme

+0

curlはうまく見えません。 –

+0

は、iptablesのようにポートを開く必要があります。 –

答えて

0

ありがとう@antonbormotov。私はそれが今実行しているelasticsearchを開始しようとして検索し、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

を発見されました!

関連する問題