How to remove elasticsearch and reinstall to reset cluster

I want to remove es on ec2 instance and reinstall it to initialize cluster and node info How can I?
I tried but it always had same cluster uuid even I uninstalled it

First I installed es following these steps

sudo rpm --import

sudo nano /etc/yum.repos.d/elasticsearch.repo

name=Elasticsearch repository for 8.x packages

sudo yum install --enablerepo=elasticsearch elasticsearch

after starting node I got single-node cluster
Then I uninstall es with sudo yum remove elasticsearch command

I installed es again following exactly same steps but It had same cluster uuid

I removed not only /var/lib/elasticsearch/nodes but also all the files and directories related to es but none of them worked
there is no way to completely remove and reinstall es on ec2 instance?

If you remove /var/lib/elasticsearch then it should work.

1 Like

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