Elasticsearch Single Node - In Windows

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

Installation with zip file

Install and configure ES on HTTPS (with authentication using username and password)

  1. Download Elasticsearch 8.6.2

  2. Could you unzip the file in the preferred location?

    Notice

    You need not add configurations to the .yml file; they are added once you start the ES.

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

  4. Run ES with the elasticsearch.bat command.

  5. When you run ES in a terminal for the first time, you get a password on the terminal as below. You must note down the password for future reference.

    3647537153.png

    The following is the sample .yml file.

    Cluster.name: zephyr
    node.name: node-1
    http.port: 9200
    network.host: 192.168.0.1
    xpack.security.enabled: true
    xpack.security.enrollment.enabled: true
    xpack.security.http.ssl:
      enabled: true
      keystore.path: certs/http.p12
    xpack.security.transport.ssl:
      enabled: true
      verification_mode: certificate
      keystore.path: certs/transport.p12
      truststore.path: certs/transport.p12
    http.host: 0.0.0.0
    indices.query.bool.max_clause_count: 9024
    action.auto_create_index: ".watches,.triggered_watches,.watcher-history-*,-zephyr*,+*"
  6. Run https://localhost:9200 in browser with default user 'elastic'. Use the ES password that you got in the step4.

    3647275011.png
    3647602690.png
  7. Install Zephyr by giving ES URL as https://localhost:9200

  8. Upon successful Zephyr installation, stop the Zephyr and navigate to the {ZephyrDir}\tomcat\webapps\flex\WEB-INF\classes location.

  9. Make changes as mentioned in the below steps, to the jdbc.properties for ES running on HTTPS.

  10. Uncomment elastic.rest.prop.xpack.security.user and change password after colon(:) with the ES password you got after step 4. The default username is “elastic”.

    transport.nodes=https://localhost:9200
    rest.nodes=https://localhost:9200
    elastic.rest.prop.xpack.security.user=username:password
  11. Start the Zephyr application after making these changes.

Install and configure ES on HTTP (without authentication)

  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 ES with the elasticsearch.bat command.

  5. Stop the Elasticsearch.

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

    cluster.name: zephyr
    node.name: node-1
    http.port: 9200
    network.host: 192.168.0.1
    xpack.security.enabled: false
    xpack.security.enrollment.enabled: false
    xpack.security.http.ssl:
      enabled: false 
    xpack.security.transport.ssl:
      enabled: false
    http.host: 0.0.0.0
    indices.query.bool.max_clause_count: 9024
    action.auto_create_index: ".watches,.triggered_watches,.watcher-history-*,-zephyr*,+*"
  7. Start Elasticsearch.

  8. Now install Zephyr with ES URL http://localhost:9200

Install ES on HTTPS (using id and secret key)

  1. Download Elasticsearch 8.6.2

  2. Unzip the file in the preferred location.

    Notice

    You need not add configurations in .yml file. The configurations get added in .yml file, once you start the ES.

  3. Open the command prompt as administrator and go to

    {directory}\elasticsearch-8.6.2\bin path.

  4. Run ES with the

    elasticsearch.bat command.

  5. 5. When you run ES in a terminal for the first time, you get a password on the terminal as below. You must note down the password for future reference.

    3647537153.png

    The following is the sample .yml file.

    cluster.name: zephyr
    node.name: node-1
    http.port: 9200
    network.host: 192.168.0.1
    xpack.security.enabled: true
    xpack.security.enrollment.enabled: true
    xpack.security.http.ssl:
      enabled: true
      keystore.path: certs/http.p12
    xpack.security.transport.ssl:
      enabled: true
      verification_mode: certificate
      keystore.path: certs/transport.p12
      truststore.path: certs/transport.p12
    http.host: 0.0.0.0
    indices.query.bool.max_clause_count: 9024
    action.auto_create_index: ".watches,.triggered_watches,.watcher-history-*,-zephyr*,+*"
  6. 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"
                        ]
                    }
                ]
            }
        }
    }'
  7. Refer to the generated API key response:

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

  9. Install the Zephyr application.

  10. Upon successful Zephyr installation, stop the Zephyr and navigate to the {ZephyrDir}\tomcat\webapps\flex\WEB-INF\classes location.

  11. Make changes as mentioned in the below steps, to the

    jdbc.properties for ES running on HTTPS.

  12. Add following properties in jdbc.properties file:

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

Install ES as a service in Windows

Enable TLS 1.2 and 1.3 versions for Elasticsearch

You need to add the following two lines in the elasticsearch.yml file:

xpack.security.http.ssl:
  supported_protocols: TLSv1.3, TLSv1.2
xpack.security.transport.ssl:
  supported_protocols: TLSv1.3, TLSv1.2

The following is the sample .yml file:

cluster.name: zephyr
node.name: node-1
http.port: 9200
network.host: 192.168.0.1
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12
  supported_protocols: TLSv1.3, TLSv1.2
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
  supported_protocols: TLSv1.3, TLSv1.2
http.host: 0.0.0.0
indices.query.bool.max_clause_count: 9024
action.auto_create_index: ".watches,.triggered_watches,.watcher-history-*,-zephyr*,+*"

Connect Zephyr to ES

ES must be running before you install Zephyr Enterprise. You connect Zephyr to ES during the product installation. To do this, specify either the IP address of your ES server or its host name, depending on the settings you have specified in the elasticsearch.yml file.

  • Single-node installation

    Specify http://192.168.0.1:9200, or http://localhost:9200 when prompted to configure Elasticsearch.

    The Zephyr setup screen will appear and display information on configuring Elasticsearch. Enter the hostname or IP address and port used by Elasticsearch—for example, localhost:9200.

Publication date: