2
0

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 1 year has passed since last update.

CircleCI上でOpenSearchを起動する

Posted at

OpenSearchを使ったCIをやりたかったで、CircleCI上でOpenSearchを起動させました。

前提

  • OpenSearch v2.9

方法

  • 以下のように設定することで可能です。
  - image: opensearchproject/opensearch:2.9.0
    environment:
      OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
    command: >
      bash -c '
        opensearch-plugin install analysis-kuromoji;
        opensearch-plugin install analysis-icu;
        echo "plugins.security.disabled: true" >> /usr/share/opensearch/config/opensearch.yml;
        echo "node.name: os-node" >> /usr/share/opensearch/config/opensearch.yml;
        echo "cluster.initial_cluster_manager_nodes: os-node" >> /usr/share/opensearch/config/opensearch.yml;
        echo -e "discovery.seed_hosts:\n  - os-node" >> /usr/share/opensearch/config/opensearch.yml;
        opensearch
      '

ポイント

  • プラグインはcommandで入れる
  • 各種設定はopensearch.ymlで必要ですが、これもやっぱりcommandで入れる

余談

  • 上記でCIが動くようになったのですが、データをputしても反映されるの時間がかかるので、ユニットテスト上でやるのは、どうなのか!?って思います。
  • テストを並列に実行したかったら、テストケース毎に、インデックスを変えれば良いと思います。
2
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?