Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This section explains the installation and testing of Elasticsearch (ES) in Windows.

Installation with zip file

Testing Elasticsearch on HTTPS (with authentication using username and password)

  1. Download Elasticsearch 8.6.2

  2. Unzip the file in the preferred location.

  3. Open the command prompt as administrator, and go to {directory}\elasticsearch-8.6.2\bin path

  4. Run Elasticsearch with the elasticsearch.bat command.
    When you run Elasticsearch in a terminal for the first time, you get a password on the terminal as below:

  5. Run https://localhost:9200 in browser with default user 'elastic'. Use the ES password that you get after running ES first time.

  6. Configure Zephyr with https://localhost:9200 ES URL. configure in what?where?

  7. Stop the Zephyr application and make changes mentioned below, in the jdbc.properties for ES running on HTTPS.

  8. Uncomment elastic.rest.prop.xpack.security.user and change password after colon(:) with the ES password you got after running ES first time.

transport.nodes=https://localhost:9200
rest.nodes=https://localhost:9200
elastic.rest.prop.xpack.security.user=elastic:e16AISb=rYSvNBK36DSz

9. Start the Zephyr application after making these changes.

Testing Elasticsearch on HTTP(without authentication)

  1. Stop the Elasticsearch.

  2. Change the SSL security to false in elasticsearch.yml file in config folder as mentioned in the following sample.

    # Enable security features
    xpack.security.enabled: false
    xpack.security.enrollment.enabled: false
    # Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
    xpack.security.http.ssl:
      enabled: false
      keystore.path: certs/http.p12
    # Enable encryption and mutual authentication between cluster nodes
    xpack.security.transport.ssl:
      enabled: false

3. Run Elasticsearch and build the Zephyr application.

Testing Elasticsearch on HTTPS (using id and secret key)

  1. Execute the below given CURL to generate an API key:

    curl --location --request POST 'https://localhost:9200/_security/api_key' \
    --header 'Authorization: Basic ZWxhc3RpYzpwYXNzd29yZA==' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "name": "my-api-key",
        "role_descriptors": {
            "role-zephyr": {
                "cluster": [
                    "all"
                ],
                "index": [
                    {
                        "names": [
                            "zephyr-*"
                        ],
                        "privileges": [
                            "all"
                        ]
                    }
                ]
            }
        }
    }'
  2. Refer to the generated API key response:

    {
        "id": "i_n-KIgBbJC5TV1xKsjr",
        "name": "my-api-key",
        "api_key": "oSkuars1Rh-m4diuKe18hw",
        "encoded": "aV9uLUtJZ0JiSkM1VFYxeEtzanI6b1NrdWFyczFSaC1tNGRpdUtlMThodw=="
    }
  3. The <apiKey> would be base64 encoding of id:api_key i.e. base64 encoding of o3PG-n0Bf9efLymhVjzN:eR9bKD5OTeywOxovC7It2Q. We can use online utility like this(Base64 Encode and Decode - Online ) for base64 encoding.

  4. Build the Zephyr application.

  5. Stop Zephyr. Make changes in jdbc.properties file as mentioned below.

    Add following properties in jdbc.properties file:

    elastic.rest.prop.api.key.id=<id>
    elastic.rest.prop.api.key.secret=<api_key>
  6. Start the Zephyr service.

  • No labels