vagrantのhomesteadでElasticsearchに接続できない時の設定

HomesteadでElasticsearchを使おうとしたら
http://192.168.20.10:9200でアクセスしても接続できなくて情報があまり載ってなくてなんとか解決したのでメモ。

sudo vi /etc/elasticsearch/elasticsearch.yml
に追加

network.host: 192.168.20.10

Homestead.yaml

ip: "192.168.20.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: your_local_path/.ssh/id_rsa.pub

keys:
    - your_local_path/.ssh/id_rsa

folders:
    - map: /your_local_path/Homestead/code
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/Laravel/public

databases:
    - homestead

elasticsearch: 6

変更したらvagrant reload またはvagrant haltからvagrant up

http://192.168.20.10:9200 にアクセスして
このjsonが表示されればok

{
  "name" : "6u-3v8M",
  "cluster_name" : "homestead",
  "cluster_uuid" : "1o27t6duTy67THv2moC1AQ",
  "version" : {
    "number" : "6.4.2",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "04711c2",
    "build_date" : "2018-09-26T13:34:09.098244Z",
    "build_snapshot" : false,
    "lucene_version" : "7.4.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

シェアする

  • このエントリーをはてなブックマークに追加

フォローする