I am trying to uninstall elastic search MSI but can't find the elasticsearch-service.bat file

Hello,

I have been trying to install Elasticsearch using the msi version:
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.0.msi

But I have been encountering problems with setting up the passwords using the bin\Elasticsearch-setup-passwords interactive. It's returning this error:

Unexpected response code [405] from calling GET http://127.0.0.1:9200/_security/_authenticate?pretty
It doesn't look like the X-Pack security feature is enabled on this Elasticsearch node.
Please check if you have enabled X-Pack security in your elasticsearch.yml configuration file.

ERROR: X-Pack Security is disabled by configuration.

After some research, it seemed as though there's some problem with my Elasticsearch.yml file, but I simply cannot find the config file. I didn't change its path during the msi installation process (and frankly I forgot if it was installed in a different folder by default). I wanna try uninstalling Elasticsearch and re-install it but this time make sure of the config folder's location, but it cannot be uninstalled since Elasticsearch is running as a service. I tried to remove the service but there is no Elasticsearch-service.bat file in my bin folder.

Is there a way to locate my config file or uninstall the service?

Here's the default install locations - Install Elasticsearch with Windows MSI Installer | Elasticsearch Guide [7.10] | Elastic

Thank you! I found the config file, changed the xpack.security.enabled to true, but it's still not working. Here is my Elasticsearch.yml file :

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: DESKTOP-ELKL6PC
path.data: C:\ProgramData\Elastic\Elasticsearch\data
path.logs: C:\ProgramData\Elastic\Elasticsearch\logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic
xpack.security.enabled: true

Is there something I need to do for the changes to take effect? Or any additional configuration that needs to be done?

I found the solution for my problem, for those of you who have the same issue

Run this command with command prompt as administrator:

sc.exe stop Elasticsearch

This will stop the Elasticsearch service, making it possible for your Elasticsearch.yml file changes to take effect. You can restart the service with:

sc.exe start Elasticsearch

2 Likes

Thanks for sharing your solution!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.