丼鯖を全文検索へ対応 » 履歴 » リビジョン 3
リビジョン 2 (白林檎 美和, 2020/07/16 02:17) → リビジョン 3/4 (白林檎 美和, 2021/10/09 01:11)
# 丼鯖を全文検索へ対応 ## 材料 * FreeBSD上で稼働する丼鯖 ## ElasticSearchのインスコ 1. 導入済みのportsを更新。 ``` # portsnap fetch update # portupgrade -a ``` 1. textproc/elasticsearch7をインスコ。 textproc/elasticsearch6をインスコ。最新版は7だが,**丼では使えない**。 ``` # make -C /usr/ports/textproc/elasticsearch7 /usr/ports/textproc/elasticsearch6 config-recursive install clean ``` 1. データ置き場を分けた方は, /usr/local/etc/elasticsearch/elasticsearch.yml の `path.data` を変更。 ``` path.data: /usr/home/elasticsearch ``` 1. /etc/rc.conf へ `elasticsearch_enable="YES"` を追加。 1. ElasticSearchを起動。 ``` # service elasticsearch start ``` ## 丼鯖の設定変更 1. ~/live/.env.production へ次を追加。 ``` ES_ENABLED=true ES_HOST=localhost ES_PORT=9200 ``` 1. 索引を作成。 ``` $ export RAILS_ENV=production $ bundle exec rake chewy:upgrade ``` 1. /usr/local/etc/rc.d/mastodon の `# REQUIRE:` へ, `elasticsearch` を追加。 ``` # REQUIRE: nginx postgresql redis elasticsearch ``` 1. 丼サービスを再起動。 ``` # service mastodon restart ```