diff options
author | Jose Torres <torres@balameb.com> | 2017-04-06 20:45:06 -0600 |
---|---|---|
committer | Jose Torres <torres@balameb.com> | 2017-04-06 20:45:53 -0600 |
commit | e7912df00555b5816d648a5210b27586d3e7edb7 (patch) | |
tree | 50041f1e9e1a2d3618251d72ae362fc838a45f6f | |
parent | 659cfc8745ccd89e036060f73ca40b8ca107ad8e (diff) | |
download | gitlab-ce-docker-aws-elasticsearch-guide.tar.gz |
[ci skip] Change network name, configuration procedure and typosdocker-aws-elasticsearch-guide
-rw-r--r-- | doc/university/gitlab-advanced/elasticsearch.md | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/doc/university/gitlab-advanced/elasticsearch.md b/doc/university/gitlab-advanced/elasticsearch.md index ee846fbaba6..9dc838c2fff 100644 --- a/doc/university/gitlab-advanced/elasticsearch.md +++ b/doc/university/gitlab-advanced/elasticsearch.md @@ -12,10 +12,9 @@ doc. ## Elasticsearch Docker Container For this setup we want to have GitLab as a container and Elasticsearch as another -container both communicating through a Docker bridge network. This example is -running on an EC2 instance so we'll be seeing some specific AWS values as part -of the code blocks but also notice that this setup does require at least 8GB of -RAM. +container both communicating through a Docker network. This example is running +on an EC2 instance so we'll be seeing some specific AWS values as part of the +code blocks but also notice that this setup does require at least 8GB of RAM. Update the host machine: @@ -32,7 +31,7 @@ sudo docker run hello-world Now we can create the network where `gitlab` stands for the network name. ``` - sudo docker network create gitlab + sudo docker network create gitlab_network ``` Get GitLab's Docker image and start a container. In this code block we are using @@ -60,11 +59,11 @@ sudo docker run --detach \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ - --network gitlab \ + --network gitlab_network \ gitlab/gitlab-ee:latest ``` -Let's turn to Elasticsearch now. For GItLab preior to version 9.0 we need +Let's turn to Elasticsearch now. For GitLab prior to version 9.0 we need Elasticsearch version 2.4 and from 9.0 upwards we need version 5.1. Also notice that version 2.4 requires manually installing the `delete-by-query` plugin. @@ -73,7 +72,7 @@ to our `gitlab` network. If installing a different version you should change the number at the end of the command. ``` -sudo docker run -d --name elasticsearch --network gitlab elasticsearch:5.1 +sudo docker run -d --name elasticsearch --network gitlab_network elasticsearch:5.1 ``` If you went with the 2.4 version you can login in to the container and install @@ -160,23 +159,34 @@ policies directly. Look for the recently saved policy and select it. Before moving out of the IAM screen we'll need to get a few more details. Look for the user again and copy the `User ARN` from it's profile screen. Now click on the security credentials tab and press the Create access key button. Make - sure to copy the Access and Secret access key. We'll be using this info in + sure to copy the Access and Secret access key. We'll be using this info shortly. Now we can start creating an Elasticsearch cluster. Navigate to the Elasticsearch service. The name is unimportant just make sure to choose the 5.1 -Elasticsearch version. I would also suggest at least a medium sized instance for -the cluster node type. Now for the policy choose from the dropdown menu the - `Allow or deny access to one or more AWS accounts or IAM users`. On the pop up - screen choose to allow and paste the User's ARN in the text field. now save and - confirm. +Elasticsearch version. Note that AWS does not offer a 2.3 version. I would also +suggest at least a medium sized instance for the cluster node type. Now for the +policy choose from the dropdown menu the `Allow or deny access to one or more +AWS accounts or IAM users`. On the pop up screen choose to allow and paste the +User's ARN in the text field. now save and confirm. It takes a while but when the cluster is finally ready make sure to copy the Endpoint value. -Now let's go back to our GitLab UI. From the admin UI you'll need to activate -Elasticsearch by going to the Settings screen which you'll find under the gear -icon's drop down menu. +Now let's create the indexes on the `gitlab` instance. We'll just index +everything but if you have a larger instance please go through the indexing +procedure from the docs. SSH into your GitLab server and run the following +commands: + +``` +sudo gitlab-rake gitlab:elastic:create_empty_index +sudo gitlab-rake gitlab:elastic:index_repositories +sudo gitlab-rake gitlab:elastic:index_database +``` + +The final part of this configuration is done through the admin UI. You'll need +to activate Elasticsearch by going to the Settings screen which you'll find +under the gear icon's drop down menu. Closer to the bottom there is an Elasticsearch section with two checkboxes that you'll need to click on: `Elasticsearch indexing` and @@ -189,15 +199,5 @@ console. Now the `AWS Access Key` and `AWS Secret Access Key` are the two values we copied from the IAM user profile under the security credentials tab. Don't forget to save the changes. -The final part of this configuration is to create the indexes on the `gitlab` -instance. We'll just index everything but if you have a larger instance please - go through the indexing procedure from the docs. SSH into the GitLab instance -server and run the following commands: - -``` -sudo gitlab-rake gitlab:elastic:create_empty_index -sudo gitlab-rake gitlab:elastic:index_repositories -``` - Done! Go into your instance and try searching for a code pattern. You will now see the code and merge request categories.
\ No newline at end of file |