Unable to change the elastic-agent grpc.port during fleet server setup

I'm trying to install fleet server 7.15 on an Ubuntu 20.04 machine but I'm running into a port conflict since is already in use by another application. I found a post that suggested running
./elastic-agent -c elastic-agent.yml -e
which showed:
Error: listen tcp bind: address already in use

I searched elastic-agent.yml and found the port number 6789 in the config file. I removed the comments from that section and changed the port number to 6788:

  # listen address for the GRPC server that spawned processes connect back to.
  address: localhost
  # port for the GRPC server that spawned processes connect back to.
  port: 6788

Running the command again showed the same message. Searching google I found the follow topic with a similar issue on 7.10:
I copied the three lines from that post into my config file and ran the same command but that too was ignored. Finally I tried moving the lines to the top of the config file but that also failed. Has anyone else been able to change the port with version 7.15? If it makes any difference I'm using the linux .tar.gz version of elastic-agent.

instead of elastic-agent.yml try modifying fleet.yml on a same path.
adding agent.grpc.port: 6788 should be enough

Thanks Michal! That worked right away and now I can run the command above to start the agent, metric beat and file beat start. Should the entries for agent.grpc be moved from elastic-agent.yml to fleet.yml or the documentation be updated?

On to the next problem, where installing fleet server returns an error indicating that it can't find the unix socket. I will troubleshoot that when I get a chance.

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