Elasticsearch Installation
Install Elasticsearch on a Dedicated Server
Procedure
- On the server on which you want to install Elasticsearch, install one of the following:
- OpenJDK V11
- Download OpenJDK 11 (LTS) from the AdoptOpenJDK website.
The OpenJDK 11 installer is downloaded to your local drive.
- Run the OpenJDK 11 installer and follow the instructions in the wizard.
- In the Custom Setup page, select the Set JAVA_HOME variable menu, and then select Will be installed on local hard drive.
- When the installation is complete, close the OpenJDK 11 installer.
- Download OpenJDK 11 (LTS) from the AdoptOpenJDK website.
- Oracle JDK V11
- Download and install Oracle JDK V11.
- Configure the JAVA_HOME environment variable to point Elasticsearch to the Java installation directory, and then add Java to the Path system variable.Note: For more information on how to configure the JAVA_HOME environment variable, refer to the Oracle documentation.
- OpenJDK V11
- Download the ZIP file for Windows, elasticsearch-7.9.3.zip, from the official Elasticsearch 7.9.3 Downloads page.
- Extract the contents of the zip file to C:\ElasticSearch.
- Go to C:\ElasticSearch\elasticsearch-7.9.3\config, and then access the elasticsearch.yml file.
- In the .yml file, uncomment the following properties, and then modify the values to match those shown here:
cluster.name: apm-cluster node.name: ${COMPUTERNAME} path.data: /ProgramData/Meridium/ElasticSearch path.logs: /ProgramData/Meridium/Logs bootstrap.memory_lock: true network.host: 0.0.0.0 http.port: 9200 action.destructive_requires_name: true
- Save and close the .yml file.
- Select the Start button on Windows, right-click Command Prompt, and then select Run as administrator.The Command Prompt window appears.
- At the command prompt, enter cd C:\ElasticSearch\elasticsearch-7.9.3\bin, and then press Enter.
- At the command prompt, enter elasticsearch-service install, and then press Enter.Elasticsearch is installed.
- Access the Microsoft Management Console (services.msc) and perform the following operations for the Elasticsearch service:
- Verify that the service runs as Local System.
- Modify the startup to be Automatic.
- Start the service to verify installation and configuration.
- On the server on which Elasticsearch is installed, go to http://localhost:9200/ in a web browser, and ensure that Elasticsearch runs successfully. A response that is similar to the following sample appears.
{ "name" : "apm-node", "cluster_name" : "apm-cluster", "cluster_uuid" : "58cS6NyzQJOLZ8Xr1e3vkg", "version" : { "number" : "7.9.3", "build_hash" : "3adb13b", "build_date" : "2017-03-23T03:31:50.652Z", "build_snapshot" : false, "lucene_version" : "6.4.1" },
- On the server on which Elasticsearch is installed, go to http://[elastic-search-server]:9200/ in a web browser, and ensure that Elasticsearch runs successfully. A response that is similar to the sample provided in the previous step appears.
- On the APM server, go to C:\ProgramData\Meridium\appsettings.Global.json.
- As needed, modify the following value.
"elasticSearch": { "url": "http://localhost:9200" },
- After all third-party services are configured, reset IIS and services on all APM App Servers.
What To Do Next
Add User Authentication for Elasticsearch
To enhance security, you can implement user authentication for Elasticsearch using the X-Pack security.
Procedure
- From the Elasticsearch installation folder, navigate to the config folder, and then access the file elasticsearch.yml.
- In the .yml file, add the following line of code:
xpack.security.enabled: true
- Based on your Elasticsearch cluster type, complete one of the following steps:
- For a single node cluster, add the following line of code in the elasticsearch.yml file:
discovery.type: single-node
Save and close the elasticsearch.yml file.
- For a multi-node cluster, Elasticsearch requires TLS communication between the nodes. For instructions, refer to https://www.elastic.co/guide/en/elasticsearch/reference/7.9/configuring-tls.html#node-certificates.
- For a single node cluster, add the following line of code in the elasticsearch.yml file:
- From the Elasticsearch installation folder, set the bootstrap password. To do so:
- Run the command prompt as an administrator.
- Change the directory to the Elasticsearch installation folder.
- Run the following command: bin/elasticsearch-keystore add "bootstrap.password"
- Enter the password.
- On the APM server, navigate to C:\ProgramData\Meridium, and then modify the appsettings.Global.json file to update the Elasticsearch settings with the password:
"elasticSearch": { "url": "http://localhost:9200", "password": "<value>" },
- Restart Elasticsearch, Search, and IIS.