2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【ElasticSearchエラー】Elasticsearch\Common\Exceptions\NoNodesAvailableException : No alive nodes found in your cluster/ Could not parse URElasticsearch

Last updated at Posted at 2019-12-10

elasticsearch-phpとLaravelを繋いで使ってた。

ローカルでやるのとAWSで使うのとで設定を多少変える必要があるので、
エラー出て一瞬ハマったのでその時のメモ。
結論.envに環境変数を入れれば良い。

.env
ELASTICSEARCH_ENABLED=true
ELASTICSEARCH_HOSTS="localhost:9200"

SEARCH_ENABLED=true
SEARCH_HOSTS=localhost:9200

あとはローカルの時。dockerとかで立ち上げてcurl通ることを確認。

AWSのelasticSearchクラスタ立ち上げてからcurl通ることを確認して
セキュリティグループでポート開けて下記の設定する。

.env
ELASTICSEARCH_ENABLED=true
ELASTICSEARCH_HOSTS="https://vpc-hoge.ap-northeast-1.es.amazonaws.com:443"

SEARCH_ENABLED=true
SEARCH_HOSTS=https://vpc-hoge.ap-northeast-1.es.amazonaws.com:443

参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?