Environment Overview
    The servers are configured to be three Elasticsearch clusters with the following details:

    Details of cluster1**

    • A 3-node Elasticsearch cluster with a Kibana instance: | Server Name | IP address | Comments | | —- | —- | —- | | node1 | 10.11.1.1 | An Elasticsearch node in cluster 1 | | node2 | 10.11.1.2 | An Elasticsearch node in cluster 1 | | node3 | 10.11.1.3 | An Elasticsearch node in cluster 1 | | kibana1 | 10.11.1.4 | Kibana is configured to connect to the cluster |


    Details of cluster2**

    • A 1-node Elasticsearch cluster with a Kibana instance: | Server Name | IP address | Comments | | —- | —- | —- | | datanode2 | 10.11.1.5 | An Elasticsearch node in cluster 2 | | kibana2 | 10.11.1.6 | Kibana is configured to connect to the cluster |

    Details of cluster 3

    • A 1-node Elasticsearch cluster with a Kibana instance: | Server Name | IP address | Comments | | —- | —- | —- | | prod1 | 10.11.1.7 | An Elasticsearch node in cluster 3(rack:rack1) | | prod2 | 10.11.1.8 | An Elasticsearch node in cluster 3(rack:rack2) | | kibana3 | 10.11.1.9 | Kibana is configured to connect to the cluster |

    Task1
    The hosts node1, node2 and node3 are configured to communicate with each other.
    These three nodes are currently not running. The relative Kibana instance is also not running which is on port 5601.
    Deploy an Elasticsearch cluster that satisfies the following requirements:

      • the name of the cluster is cluster1
      • the node names match the server names of each node
      • node1 is a dedicated master node and the only master-eligible node in the cluster
      • node2 and node3 are data and ingest node only
      • the heap size and attributes of all nodes are as below:
    hostname node name Heap Size attrname box_type attrname rack
    node1 node1 1GB
    node2 node2 1GB hot rack1
    node3 node3 1GB warm rack2

    Task2

    • Enable security feature on cluster1 and satisfies the following requirements:
      • set password elastic for built-in user elastic
      • create a new user named log_user with password log123
          • this user have access to kibana
          • this user is granted read/write/create privileges to all indices beginning with nginx-logs

    Task3
    Suppose you have documents that looks like the following:

    1. {
    2. "name":"Zing",
    3. "age": 21,
    4. "geo": {
    5. "city":"beijing",
    6. "country":"China"
    7. },
    8. "bio":"I'm 21 years old. I'm from China. My favorite song is <I believe I can fly>"
    9. }

    Define a new index on cluster2 that satisfies the following requirements:

      • The name of the index is user-task
      • The number of primary shard is 3 and the number of replicas is 0
      • The name field is mapped as a keyword only
      • The fields in geo are all mapped as both text and keyword
      • The bio field is indexed as text three different ways: using the standard analyzer, the english analyzer, and the dutch analyzer

    Index the document above into your new index with an _id of 000001

    Task4
    There is an index named movies on cluster2.
    The document count meeting the following two query is 12 an 0 .

    # document count is 12
    GET movies/_search
    {
      "query": {
        "match": {
          "title": "x-men"
        }
      }
    }
    
    # document count is 0
    GET movies/_search
    {
      "query": {
        "match": {
          "title": "xmen"
        }
      }
    }
    

    Please reindex current movies index to a new movies_new index and satisfies the following requirements.

    • only return the true x-men relative movie, shoule be one document
    • document count should be the same(1) no matter the search keyword is x-men or xmen
    • For other words connected by - are also required to return the same result, e.g. super-man and superman should result in the same result.

    Task5
    There is an index named movies on cluster2. Please reindex it to movie_fixed index satisfying the following requirements.

    • split string field keywords to array and store it to keyword_list field
    • add a new field number_of_keywords which is the length of keyword_list

    Task6
    Write a single search on the shakespeare index on cluster2 that satisfies the following requirements:

    • at least two fields of play_name, speaker, text_entry contain “Henry”.(case insensitive)
    • highlight match content in text_entry field . the pre_tags is and the post_tags is
    • The results are sorted first by play_name descending , then line_id ascending
    • return page 2 with page size 3

    In the text field below, provide only the JSON portion of you search request

    Task7
    Write a single search on the earthquakes index on cluster2 that satisfies the following requirements:

    • calculate the count of earthquake per month
    • calculate the average number of magnitude per month(mag field)
    • find the max average magnitude value and the corresponding month

    In the text field below, provide only the JSON portion of you search request

    Task8
    Write a single search on the movies_fixed index( From Task 5) on cluster2 that satisfies the following requirements:

    • list the keywords for movies between 2000 to 2018 (keyword_list and release_date field)
    • calculate the average rating for each keyword
    • The results are sorted first by average rating descending
    • Just return top 10 keyword

    In the text field below, provide only the JSON portion of you search request

    Task9
    Create a pipeline to transform earthquakes index on cluster2 that satisfies the following requirements:

    • change source field to uppercase
    • add a new field batch_num which record the update count. batch_num increase by 1 when you update the index through this pipeline
    • No need to create a new index.

    Task10
    There is an index test_snapshot on cluster2. Backup this index and satisfy the following requirements:

    • the repo for this back is on local path ~/backup
    • create one snapshot named test_snapshot-1 for index test_snapshot without global cluster state
    • restore from test_snapshot-1 to restore-test_snapshot

    Task11
    There is an index test_css on cluster2 and cluster3. Please use ccs feature to satisfy the following requirements:

    • search test_ccs data from cluster2 and cluster3 on cluster2

    Task12
    The health of cluster3 is not green. Please find the reason and fix it to green without data loss.

    Task13
    Write a search template named earthquake_magType_search for index earthquakes on cluster2 that satisfies the following requirements:

    • The magType field match the specified parameter
    • The return size is also specified by parameter

    Task14
    Define a new index on cluster1 that satisfies the following requirements:

    • the name of the index is nginx-logs-2021-01-01
    • the number of the primary shard is 3, the number of replicas is 1
    • all the shards should be only allocated to nodes with attribute box_type:hot
    • shard allocation strategy for this cluster should take into consider node attribute rack