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

DockerでSolrCloudの検証環境を作成

Last updated at Posted at 2020-11-02

solr.in.shの準備

公式のgitからコピーして以下の箇所を変更し.docker/etc/default/solr.in.shに置く
ディレクトリは環境に合わせて変更してください。

#ZK_HOST

↓

ZK_HOST="zookeeper1:2181/"

docker-compose.yml

version: '3.8'
services:
  solr_node1:
    image: solr:8.6
    container_name: solr_node1
    volumes:
      - ./.docker/etc/default/solr.in.sh:/etc/default/solr.in.sh
    ports:
      - "8981:8983"
    depends_on:
      - zookeeper1
  solr_node2:
    image: solr:8.6
    container_name: solr_node2
    volumes:
      - ./.docker/etc/default/solr.in.sh:/etc/default/solr.in.sh
    ports:
      - "8982:8983"
    depends_on:
      - zookeeper1
  zookeeper1:
    image: zookeeper:3.6
    container_name: zookeeper1
    environment:
      ZOO_MY_ID: 1
      ZOO_SERVERS: server.1=zookeeper1:2888:3888;2181
      ZOO_4LW_COMMANDS_WHITELIST: mntr,conf,ruok

infoStreamの設定

infoStreamを有効にするとindex生成関連の詳細なログが出力されるようになります。

solrconfig.xml
  <indexConfig>
     <infoStream>true</infoStream>
  </indexConfig>

solrconfig.xmlの上記の設定を書くと有効になります。

/var/solr/log4j2.xml
<AsyncLogger name="org.apache.solr.update.LoggingInfoStream" level="off"/><AsyncLogger name="org.apache.solr.update.LoggingInfoStream" level="info"/>

LoggingInfoStreamのlevelがoffだと出力されないのでinfoに変更します。
これでsolr.logに出力されるようになります。

起動

docker-compose up -d

http://localhost:8982/solr/#/
にアクセスすると画面が表示されます。

3
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
3
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?