Eric Guo's blog.cloud-mes.com

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

Setup Advanced Search in Gitlab 14.7 Log

Permalink

Installation Elastic Search using Debian/Ubuntu repository

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt 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
cluster.name: gitlab-elasticsearch
network.host: 192.168.100.20
http.port: 9200
discovery.seed_hosts: ["192.168.100.20"]
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: 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

Comments