Hi All,
I have successfully enrolled my remote server/machine into my Fleet server and I can see my metrics and logs coming thru.
The issue is that at the beginning of the enrollment the status of the agent in kibana was Updating
then it turned to Offline
without ever being Online
till now.
The fleet server is Online:
Here are the results of elastic agent status:
elastic-agent status
State: HEALTHY
Message: Running
Fleet State: FAILED
Fleet Message: fail to checkin to fleet-server: all hosts failed: 1 error occurred:
* requester 0/1 to host https://localhost:8221/ errored: Post "https://localhost:8221/api/fleet/agents/f82222be-ec5e-49e2-a584-4f9c74bcf610/checkin?": dial tcp [::1]:8221: connect: network is unreachable
Components:
* filestream (HEALTHY)
Healthy: communicating with pid '795'
* log (HEALTHY)
Healthy: communicating with pid '775'
* system/metrics (HEALTHY)
Healthy: communicating with pid '780'
* beat/metrics (HEALTHY)
Healthy: communicating with pid '785'
* http/metrics (HEALTHY)
Healthy: communicating with pid '786'
The error showed in the elastic agent log file opt/Elastic/Agent/data/elastic-agent-10dc6a/logs/elastic-agent-20230524.ndjson
is this:
{"log.level":"error","@timestamp":"2023-05-24T09:34:18.986Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":197},"message":"Cannot checkin in with fleet-server, retrying","log":{"source":"elastic-agent"},"error":{"message":"fail to checkin to fleet-server: all hosts failed: 1 error occurred:\n\t* requester 0/1 to host https://localhost:8221/ errored: Post \"https://localhost:8221/api/fleet/agents/f82222be-ec5e-49e2-a584-..../checkin?\": dial tcp [::1]:8221: connect: network is unreachable\n\n"},"request_duration_ns":237691,"failed_checkins":100,"retry_after_ns"::553251097583,"ecs.version":"1.6.0"}
Why is the agent is trying to connect to port 8221
? In the enrollment it was 8220
!
I've passed by this thread but couldn't understand or find a solution.
Your help is much appreciated.