Commit 230a34d6 authored by Valery Sizov's avatar Valery Sizov

ES: added doc

parent fe42a5e7
...@@ -114,6 +114,22 @@ sudo gitlab-rake gitlab:elastic:index_repositories ...@@ -114,6 +114,22 @@ sudo gitlab-rake gitlab:elastic:index_repositories
bundle exec rake gitlab:elastic:index_repositories RAILS_ENV=production bundle exec rake gitlab:elastic:index_repositories RAILS_ENV=production
``` ```
If you want to run several tasks in parallel (probably in separate terminal windows) you can pass parameters `ID_FROM` and `ID_TO` like this:
```
ID_FROM=1001 ID_TO=2000 sudo gitlab-rake gitlab:elastic:index_repositories
```
Both parameters are optional. Keep in mind also that this task will skip repositories (and certain commits) you have already indexed. It stores the last commit SHA of every indexed repository in the database.
As an example, if you have 3000 of repositories and you want to run tree separate indexer your commands would be like:
```
ID_TO=1000 sudo gitlab-rake gitlab:elastic:index_repositories
ID_FROM=1001 ID_TO=2000 sudo gitlab-rake gitlab:elastic:index_repositories
ID_FROM=2001 sudo gitlab-rake gitlab:elastic:index_repositories
```
To index all wikis: To index all wikis:
``` ```
...@@ -123,6 +139,7 @@ sudo gitlab-rake gitlab:elastic:index_wikis ...@@ -123,6 +139,7 @@ sudo gitlab-rake gitlab:elastic:index_wikis
# Installations from source # Installations from source
bundle exec rake gitlab:elastic:index_wikis RAILS_ENV=production bundle exec rake gitlab:elastic:index_wikis RAILS_ENV=production
``` ```
Wiki indexer also supports `ID_FROM` and `ID_TO` parameters if you want to limit a project set.
To index all database entities: To index all database entities:
...@@ -196,6 +213,28 @@ time drop. ...@@ -196,6 +213,28 @@ time drop.
curl -XPOST 'http://localhost:9200/_forcemerge?max_num_segments=5' curl -XPOST 'http://localhost:9200/_forcemerge?max_num_segments=5'
``` ```
To minimize a downtime of search feature we recommend next sequence of actions:
1. Configure elastic search in gitlab.yml or gitlab.rb for omnibus installations but
do not enable it, just set a host and port.
1. Create empty indexes. Run
```
# Omnibus installations
sudo gitlab-rake gitlab:elastic:create_empty_indexes
# Installations from source
bundle exec rake gitlab:elastic:create_empty_indexes
```
1. Index all repositories by `gitlab:elastic:index_repositories` rake task(see above). Probably you will do it in parallel
1. Enable elasticsearch and restart GitLab application.
1. Run indexers for database, wikis and repositories. By running reposotory indexer twise you will be sure that eveything is indexed because some commits could be pushed while you performed initial indexing. And don't worry, repository indexer will skip repositories and commits that are already indexed, in other words, it will be much faster this time.
[ee-109]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/109 "Elasticsearch Merge Request" [ee-109]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/109 "Elasticsearch Merge Request"
[elasticsearch]: https://www.elastic.co/products/elasticsearch "Elasticsearch website" [elasticsearch]: https://www.elastic.co/products/elasticsearch "Elasticsearch website"
[install]: https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html "Elasticsearch installation documentation" [install]: https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html "Elasticsearch installation documentation"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment