So, I have a self-hosted ELK Stack (v. 8.11) in which I've been working for a few weeks.
I've configured the certificates using the elasticsearch-certutil util and Elastic + Kibana are working fine.
After that I wanted to configure a Fleet server. I followed this steps given to me by my ELK instance in the Add a Fleet Server page:
curl -L -O https[:]//artifacts[.]elastic[.]co/downloads/beats/elastic-agent/elastic-agent-8.11.3-linux-x86_64.tar.gz
tar xzvf elastic-agent-8.11.3-linux-x86_64.tar.gz
cd elastic-agent-8.11.3-linux-x86_64
sudo ./elastic-agent install \
--fleet-server-es=http[:]//MY-IP-ADDRESS[:]9200 \
--fleet-server-service-token=MY_ENROLLMENT_TOKEN \
--fleet-server-policy=fleet-server-policy \
--fleet-server-port=8220
After running this I got an error which said.
"log.origin":{"file.name":"cmd/enroll_cmd.go","file.line":807},"message":"Fleet Server - Error - f
ailed version compatibility check with elasticsearch: tls: failed to verify certificate: x509: certificate signed by unknown authority","ecs.version":"1.6.0"}
So I started looking to correct that by generating the certificates and prepared the following command to run the installation again (Please note that, at this point, the Fleet Server waiting for a connection from the agent was still waiting, of course). The command was:
sudo ./elastic-agent install \
--fleet-server-es=https[:]//MY-IP-ADDRESS[:]9200
--fleet-server-service-token=MY-ENROLLMENT-TOKEN
--fleet-server-policy=fleet-server-policy
--fleet-server-es-ca=/etc/elasticsearch/certs/http_ca.crt
--certificate-authorities=/etc/ssl/fleet/ca/ca.crt
--fleet-server-cert=/etc/ssl/fleet/fleet-server/fleet-server.crt
--fleet-server-cert-key=/etc/ssl/fleet/fleet-server/fleet-server.key
--fleet-server-port=8220
After running that I got this error:
Error: already installed at: /opt/Elastic/Agent
So I tried to run the uninstall command:
./elastic-agent uninstall --uninstall-token MY-ENROLLMENT-TOKEN
ERROR: Error: can only be uninstalled by executing the installed Elastic Agent at: /usr/bin/elastic-agent
In /usr/bin/ I ran:
elastic-agent uninstall
And got this error:
ERROR: Error: can only be uninstalled by executing the installed Elastic Agent at: /usr/bin/elastic-agent
again.
At this point I'm not sure how or why this is happening. If maybe I could find a way to configure the settings on the agent I wouldn't need to go through the hassle of finding a way to uninstalling it. I've been trying to find a way to solve this but I didn't touch to much since I don't want to cause more error.
Is there a way to force uninstalling it?
Thanks!