Eric Guo's

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Setup Advanced Search in Gitlab 14.7 Log


Installation Elastic Search using Debian/Ubuntu repository

wget -qO - | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
curl localhost:9200/

Enable correct IP and other securty settings:

/etc/elasticsearch/elasticsearch.yml gitlab-elasticsearch
http.port: 9200
discovery.seed_hosts: [""] true true

Initial password and record it down.

/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto

Install analysis-smartcn

cd /usr/share/elasticsearch/
sudo bin/elasticsearch-plugin install analysis-smartcn
sudo systemctl restart elasticsearch

Install/Update indexer

export indexer_path=/home/git/gitlab-elasticsearch-indexer
sudo -u git -H bundle exec rake gitlab:indexer:install[$indexer_path] RAILS_ENV=production
cd $indexer_path && sudo make install