-
Notifications
You must be signed in to change notification settings - Fork 0
ElasticSearch
Jake Jarvis edited this page Dec 21, 2022
·
8 revisions
- https://docs.joinmastodon.org/admin/optional/elasticsearch/
- https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-20-04
- memory usage: https://www.elastic.co/guide/en/elasticsearch/reference/7.17/advanced-configuration.html#set-jvm-heap-size
ElasticSearch 8.x was a huge headache — stick with 7.x.
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | gpg --dearmor -o /usr/share/keyrings/elastic.gpg
echo "deb [signed-by=/usr/share/keyrings/elastic.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
apt update
apt install openjdk-17-jre-headless elasticsearch
# configure as shown below
systemctl daemon-reload
systemctl enable --now elasticsearch
systemctl restart mastodon-web mastodon-sidekiq
cd /home/mastodon/live
sudo -u mastodon RAILS_ENV=production bin/tootctl search deploy
ES_ENABLED=true
ES_HOST=localhost
ES_PORT=9200
# conservative reserve for 8GB of RAM
-Xms1g
-Xmx1g
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
http.port: 9200
# shuts up constant warning logs about security (N/A because of strict firewall)
xpack.security.enabled: false