5
4

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 5 years have passed since last update.

ローカルのElasticsearchをポート指定で起動する方法

Posted at

忙しい人のために

指定したいポート番号を9250とすると

> elasticsearch --http.port=9250

でOK

以下経緯など

developmentとtest環境でelasticsearchを起動仕様とした場合に単純に以下のようにしてしも9250番ポートで起動してくれない

# NG
> elasticsearch -p 9250
# NG
> elasticsearch --port 9250

ヘルプを確認すると以下のように、 --propと言うのがプロパティ設定のようだ

> elasticsearch -h
Usage: /usr/local/bin/elasticsearch [-vdh] [-p pidfile] [-D prop] [-X prop]
Start elasticsearch.
    -d            daemonize (run in background)
    -p pidfile    write PID to <pidfile>
    -h
    --help        print command line options
    -v            print elasticsearch version, then exit
    -D prop       set JAVA system property
    -X prop       set non-standard JAVA system property
   --prop=val
   --prop val     set elasticsearch property (i.e. -Des.<prop>=<val>)
> set elasticsearch property (i.e. -Des.<prop>=<val>)

ドキュメントのポート指定方法を確認するとportのプロパティ名はhttp.prop
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html

なので以下のように9250ポートで起動する例は以下のようになる

# OK
> elasticsearch --http.port=9250
5
4
1

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
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?